Skip to content

Commit

Permalink
chore: update xstate and adjust code to not use deprecated transient …
Browse files Browse the repository at this point in the history
…transitions (#25483)
  • Loading branch information
pieh committed Jul 2, 2020
1 parent 6dc5458 commit e2af89d
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 33 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby-recipes/package.json
Expand Up @@ -70,7 +70,7 @@
"unist-util-visit": "^2.0.2",
"urql": "^1.9.8",
"ws": "^7.3.0",
"xstate": "^4.10.0"
"xstate": "^4.11.0"
},
"devDependencies": {
"@babel/cli": "^7.10.3",
Expand Down
30 changes: 14 additions & 16 deletions packages/gatsby-recipes/src/recipe-machine/index.js
Expand Up @@ -163,22 +163,20 @@ const recipeMachine = Machine(
},
hasAnotherStep: {
entry: [`incrementStep`],
on: {
"": [
{
target: `creatingPlan`,
// The 'searchValid' guard implementation details are
// specified in the machine config
cond: `hasNextStep`,
},
{
target: `done`,
// The 'searchValid' guard implementation details are
// specified in the machine config
cond: `atLastStep`,
},
],
},
always: [
{
target: `creatingPlan`,
// The 'searchValid' guard implementation details are
// specified in the machine config
cond: `hasNextStep`,
},
{
target: `done`,
// The 'searchValid' guard implementation details are
// specified in the machine config
cond: `atLastStep`,
},
],
},
done: {
type: `final`,
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-source-filesystem/package.json
Expand Up @@ -21,7 +21,7 @@
"progress": "^2.0.3",
"read-chunk": "^3.2.0",
"valid-url": "^1.0.9",
"xstate": "^4.10.0"
"xstate": "^4.11.0"
},
"devDependencies": {
"@babel/cli": "^7.10.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/package.json
Expand Up @@ -150,7 +150,7 @@
"webpack-hot-middleware": "^2.25.0",
"webpack-merge": "^4.2.2",
"webpack-stats-plugin": "^0.3.1",
"xstate": "^4.10.0",
"xstate": "^4.11.0",
"yaml-loader": "^0.6.0"
},
"devDependencies": {
Expand Down
16 changes: 7 additions & 9 deletions packages/gatsby/src/redux/machines/page-component.ts
Expand Up @@ -74,15 +74,13 @@ export const componentMachine = machine<IContext, IState, IEvent>(
},
states: {
inactive: {
on: {
// Transient transition
// Will transition to either 'inactiveWhileBootstrapping' or idle
// immediately upon entering 'inactive' state if the condition is met.
"": [
{ target: `inactiveWhileBootstrapping`, cond: `isBootstrapping` },
{ target: `idle`, cond: `isNotBootstrapping` },
],
},
// Transient transition
// Will transition to either 'inactiveWhileBootstrapping' or idle
// immediately upon entering 'inactive' state if the condition is met.
always: [
{ target: `inactiveWhileBootstrapping`, cond: `isBootstrapping` },
{ target: `idle`, cond: `isNotBootstrapping` },
],
},
inactiveWhileBootstrapping: {
on: {
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Expand Up @@ -19123,7 +19123,7 @@ regenerator-runtime@^0.11.0:
version "0.11.1"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9"

regenerator-runtime@^0.13.2, regenerator-runtime@^0.13.3, regenerator-runtime@^0.13.4:
regenerator-runtime@^0.13.3, regenerator-runtime@^0.13.4:
version "0.13.5"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz#d878a1d094b4306d10b9096484b33ebd55e26697"
integrity sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==
Expand Down Expand Up @@ -24828,10 +24828,10 @@ xss@^1.0.6:
commander "^2.20.3"
cssfilter "0.0.10"

xstate@^4.10.0:
version "4.10.0"
resolved "https://registry.yarnpkg.com/xstate/-/xstate-4.10.0.tgz#f87e4ef593fe40300b8eec50a5d9f0763aa4f622"
integrity sha512-nncQ9gW+xgk5iUEvpBOXhbzSCS0uwzzT4bOAXxo6oUoALgbxzqEyMmaMYwuvOHrabDTdMJYnF+xe2XD8RRgWmA==
xstate@^4.11.0:
version "4.11.0"
resolved "https://registry.yarnpkg.com/xstate/-/xstate-4.11.0.tgz#dc0bd31079fe22918c2c27c118d6310bef3dcd9e"
integrity sha512-v+S3jF2YrM2tFOit8o7+4N3FuFd9IIGcIKHyfHeeNjMlmNmwuiv/IbY9uw7ECifx7H/A9aGLcxPSr0jdjTGDww==

xtend@^4.0.0, xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.0, xtend@~4.0.1:
version "4.0.2"
Expand Down

0 comments on commit e2af89d

Please sign in to comment.