Skip to content

Commit e2af89d

Browse files
authoredJul 2, 2020
chore: update xstate and adjust code to not use deprecated transient transitions (#25483)
1 parent 6dc5458 commit e2af89d

File tree

6 files changed

+29
-33
lines changed

6 files changed

+29
-33
lines changed
 

‎packages/gatsby-recipes/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"unist-util-visit": "^2.0.2",
7171
"urql": "^1.9.8",
7272
"ws": "^7.3.0",
73-
"xstate": "^4.10.0"
73+
"xstate": "^4.11.0"
7474
},
7575
"devDependencies": {
7676
"@babel/cli": "^7.10.3",

‎packages/gatsby-recipes/src/recipe-machine/index.js

+14-16
Original file line numberDiff line numberDiff line change
@@ -163,22 +163,20 @@ const recipeMachine = Machine(
163163
},
164164
hasAnotherStep: {
165165
entry: [`incrementStep`],
166-
on: {
167-
"": [
168-
{
169-
target: `creatingPlan`,
170-
// The 'searchValid' guard implementation details are
171-
// specified in the machine config
172-
cond: `hasNextStep`,
173-
},
174-
{
175-
target: `done`,
176-
// The 'searchValid' guard implementation details are
177-
// specified in the machine config
178-
cond: `atLastStep`,
179-
},
180-
],
181-
},
166+
always: [
167+
{
168+
target: `creatingPlan`,
169+
// The 'searchValid' guard implementation details are
170+
// specified in the machine config
171+
cond: `hasNextStep`,
172+
},
173+
{
174+
target: `done`,
175+
// The 'searchValid' guard implementation details are
176+
// specified in the machine config
177+
cond: `atLastStep`,
178+
},
179+
],
182180
},
183181
done: {
184182
type: `final`,

‎packages/gatsby-source-filesystem/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"progress": "^2.0.3",
2222
"read-chunk": "^3.2.0",
2323
"valid-url": "^1.0.9",
24-
"xstate": "^4.10.0"
24+
"xstate": "^4.11.0"
2525
},
2626
"devDependencies": {
2727
"@babel/cli": "^7.10.3",

‎packages/gatsby/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
"webpack-hot-middleware": "^2.25.0",
151151
"webpack-merge": "^4.2.2",
152152
"webpack-stats-plugin": "^0.3.1",
153-
"xstate": "^4.10.0",
153+
"xstate": "^4.11.0",
154154
"yaml-loader": "^0.6.0"
155155
},
156156
"devDependencies": {

‎packages/gatsby/src/redux/machines/page-component.ts

+7-9
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,13 @@ export const componentMachine = machine<IContext, IState, IEvent>(
7474
},
7575
states: {
7676
inactive: {
77-
on: {
78-
// Transient transition
79-
// Will transition to either 'inactiveWhileBootstrapping' or idle
80-
// immediately upon entering 'inactive' state if the condition is met.
81-
"": [
82-
{ target: `inactiveWhileBootstrapping`, cond: `isBootstrapping` },
83-
{ target: `idle`, cond: `isNotBootstrapping` },
84-
],
85-
},
77+
// Transient transition
78+
// Will transition to either 'inactiveWhileBootstrapping' or idle
79+
// immediately upon entering 'inactive' state if the condition is met.
80+
always: [
81+
{ target: `inactiveWhileBootstrapping`, cond: `isBootstrapping` },
82+
{ target: `idle`, cond: `isNotBootstrapping` },
83+
],
8684
},
8785
inactiveWhileBootstrapping: {
8886
on: {

‎yarn.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -19123,7 +19123,7 @@ regenerator-runtime@^0.11.0:
1912319123
version "0.11.1"
1912419124
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9"
1912519125

19126-
regenerator-runtime@^0.13.2, regenerator-runtime@^0.13.3, regenerator-runtime@^0.13.4:
19126+
regenerator-runtime@^0.13.3, regenerator-runtime@^0.13.4:
1912719127
version "0.13.5"
1912819128
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz#d878a1d094b4306d10b9096484b33ebd55e26697"
1912919129
integrity sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==
@@ -24828,10 +24828,10 @@ xss@^1.0.6:
2482824828
commander "^2.20.3"
2482924829
cssfilter "0.0.10"
2483024830

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

2483624836
xtend@^4.0.0, xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.0, xtend@~4.0.1:
2483724837
version "4.0.2"

0 commit comments

Comments
 (0)
Please sign in to comment.