File tree Expand file tree Collapse file tree 5 files changed +28
-3
lines changed Expand file tree Collapse file tree 5 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,6 @@ cd "${PROJECT_ROOT}"
13
13
# https://stackoverflow.com/questions/3004811/how-do-you-run-multiple-programs-in-parallel-from-a-bash-script
14
14
(
15
15
trap ' kill 0' SIGINT
16
- CODERV2_HOST=http://127.0.0.1:3000 yarn --cwd=./site dev &
16
+ CODERV2_HOST=http://127.0.0.1:3000 INSPECT_XSTATE=true yarn --cwd=./site dev &
17
17
go run cmd/coder/main.go start --dev --tunnel=false
18
18
)
Original file line number Diff line number Diff line change 28
28
"@material-ui/core" : " 4.9.4" ,
29
29
"@material-ui/icons" : " 4.5.1" ,
30
30
"@material-ui/lab" : " 4.0.0-alpha.42" ,
31
+ "@xstate/inspect" : " ^0.6.4" ,
31
32
"@xstate/react" : " 2.0.1" ,
32
33
"axios" : " 0.26.1" ,
33
34
"formik" : " 2.2.9" ,
Original file line number Diff line number Diff line change 1
1
import React from "react"
2
2
import ReactDOM from "react-dom"
3
-
3
+ import { inspect } from "@xstate/inspect"
4
+ import { Interpreter } from "xstate"
4
5
import { App } from "./app"
5
6
7
+ // if this is a development build and the developer wants to inspect
8
+ if ( process . env . NODE_ENV === "development" && process . env . INSPECT_XSTATE === "true" ) {
9
+ // configure the XState inspector to open in a new tab
10
+ inspect ( {
11
+ url : "https://stately.ai/viz?inspect" ,
12
+ iframe : false ,
13
+ } )
14
+ // configure all XServices to use the inspector
15
+ Interpreter . defaultOptions . devTools = true
16
+ }
17
+
6
18
// This is the entry point for the app - where everything start.
7
19
// In the future, we'll likely bring in more bootstrapping logic -
8
20
// like: https://github.com/coder/m/blob/50898bd4803df7639bd181e484c74ac5d84da474/product/coder/site/pages/_app.tsx#L32
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ interface XServiceContextType {
18
18
export const XServiceContext = createContext ( { } as XServiceContextType )
19
19
20
20
export const XServiceProvider : React . FC = ( { children } ) => {
21
- const userXService = useInterpret ( userMachine , { devTools : true } )
21
+ const userXService = useInterpret ( userMachine )
22
22
23
23
return < XServiceContext . Provider value = { { userXService } } > { children } </ XServiceContext . Provider >
24
24
}
Original file line number Diff line number Diff line change 4201
4201
commander "^8.0.0"
4202
4202
xstate "^4.29.0"
4203
4203
4204
+ "@xstate/inspect@^0.6.4":
4205
+ version "0.6.4"
4206
+ resolved "https://registry.yarnpkg.com/@xstate/inspect/-/inspect-0.6.4.tgz#dd12abb30375dcb0471b81e8db3b81377cd00be6"
4207
+ integrity sha512-2Gz5wu/RdpeLEpQ93qWQe/lDybJHQq8NzgWyB/EmDUBhOggCeZu4JqJCT7/RsQ7FNSEenZILFbNTftOY00Kg4A==
4208
+ dependencies:
4209
+ fast-safe-stringify "^2.0.7"
4210
+
4204
4211
"@xstate/machine-extractor@0.6.2":
4205
4212
version "0.6.2"
4206
4213
resolved "https://registry.yarnpkg.com/@xstate/machine-extractor/-/machine-extractor-0.6.2.tgz#2fe5edb6b965fd1f45fa68644a4ef69f125c4fc0"
@@ -7365,6 +7372,11 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6:
7365
7372
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
7366
7373
integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=
7367
7374
7375
+ fast-safe-stringify@^2.0.7:
7376
+ version "2.1.1"
7377
+ resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884"
7378
+ integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==
7379
+
7368
7380
fastest-levenshtein@^1.0.12:
7369
7381
version "1.0.12"
7370
7382
resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2"
You can’t perform that action at this time.
0 commit comments