@xmachines/docs 1.0.0-beta.46 → 1.0.0-beta.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +135 -7
- package/api/@xmachines/play/README.md +134 -57
- package/api/@xmachines/play/classes/NonNullableError.md +4 -4
- package/api/@xmachines/play/classes/PlayError.md +4 -4
- package/api/@xmachines/play/functions/assertNonNullable.md +1 -1
- package/api/@xmachines/play/type-aliases/PlayEvent.md +2 -2
- package/api/@xmachines/play-actor/README.md +130 -155
- package/api/@xmachines/play-actor/classes/AbstractActor.md +3 -3
- package/api/@xmachines/play-actor/functions/typedSpec.md +1 -1
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +5 -5
- package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +5 -5
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +2 -2
- package/api/@xmachines/play-actor/interfaces/Routable.md +3 -3
- package/api/@xmachines/play-actor/interfaces/Viewable.md +2 -2
- package/api/@xmachines/play-dom/README.md +140 -232
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +4 -4
- package/api/@xmachines/play-dom/functions/connectRenderer.md +1 -1
- package/api/@xmachines/play-dom/functions/createPlayUI.md +1 -1
- package/api/@xmachines/play-dom/functions/createRenderer.md +1 -1
- package/api/@xmachines/play-dom/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-dom/functions/renderSpec.md +3 -3
- package/api/@xmachines/play-dom/interfaces/ComponentContext.md +7 -7
- package/api/@xmachines/play-dom/interfaces/ConnectRendererOptions.md +13 -13
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +6 -6
- package/api/@xmachines/play-dom/interfaces/DefineRegistryResult.md +4 -4
- package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +12 -12
- package/api/@xmachines/play-dom/interfaces/EventHandle.md +4 -4
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +3 -3
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +5 -5
- package/api/@xmachines/play-dom/interfaces/UIProviderOptions.md +5 -5
- package/api/@xmachines/play-dom/type-aliases/ActionFn.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/Actions.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/BaseComponentProps.md +7 -7
- package/api/@xmachines/play-dom/type-aliases/CatalogHasActions.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/ComponentFn.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/ComponentRegistry.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/DefineRegistryOptions.md +2 -2
- package/api/@xmachines/play-dom/type-aliases/DomComponentRenderer.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/DomSchema.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/SetState.md +1 -1
- package/api/@xmachines/play-dom/variables/schema.md +1 -1
- package/api/@xmachines/play-dom-router/README.md +160 -158
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createRouter.md +1 -1
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +4 -4
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +4 -4
- package/api/@xmachines/play-dom-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-react/README.md +109 -320
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +5 -5
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
- package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +8 -8
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +4 -4
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +3 -3
- package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +8 -8
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-react/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-react/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-react/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-react-router/README.md +107 -124
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +23 -23
- package/api/@xmachines/play-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-react-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-router/README.md +235 -475
- package/api/@xmachines/play-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +23 -23
- package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +1 -1
- package/api/@xmachines/play-router/functions/buildRouteTree.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMatcher.md +1 -1
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/extractQuery.md +1 -1
- package/api/@xmachines/play-router/functions/extractRouteParams.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteById.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteByPath.md +1 -1
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/isRouteReachable.md +1 -1
- package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
- package/api/@xmachines/play-router/functions/routeExists.md +1 -1
- package/api/@xmachines/play-router/functions/sanitizePathname.md +1 -1
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +1 -1
- package/api/@xmachines/play-router/functions/validateStateExists.md +1 -1
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +4 -4
- package/api/@xmachines/play-router/interfaces/LocationLike.md +3 -3
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +3 -3
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +5 -5
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +8 -8
- package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouteMatcher.md +4 -4
- package/api/@xmachines/play-router/interfaces/RouteNode.md +10 -10
- package/api/@xmachines/play-router/interfaces/RouteObject.md +2 -2
- package/api/@xmachines/play-router/interfaces/RouteTree.md +5 -5
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-router/interfaces/WindowLike.md +3 -3
- package/api/@xmachines/play-router/type-aliases/MachineGraph.md +1 -1
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-signals/README.md +105 -73
- package/api/@xmachines/play-signals/functions/watchSignal.md +1 -1
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalState.md +3 -3
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +4 -4
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
- package/api/@xmachines/play-solid/README.md +117 -263
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +8 -8
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +8 -8
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-solid/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-solid/variables/ActorContext.md +1 -1
- package/api/@xmachines/play-solid/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-solid-router/README.md +93 -606
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +24 -24
- package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +3 -3
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
- package/api/@xmachines/play-svelte/README.md +111 -103
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-svelte/functions/getActorContext.md +1 -1
- package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +1 -1
- package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
- package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +8 -8
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +4 -4
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +11 -11
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-svelte/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/README.md +156 -17
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +4 -4
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-sveltekit-router/README.md +168 -17
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +4 -4
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/README.md +147 -122
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +23 -23
- package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/README.md +195 -173
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +24 -24
- package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +3 -3
- package/api/@xmachines/play-vue/README.md +126 -271
- package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-vue/functions/getPlayViewContext.md +1 -1
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +5 -5
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +8 -8
- package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
- package/api/@xmachines/play-vue/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue-router/README.md +148 -528
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +24 -24
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-xstate/README.md +167 -496
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +12 -12
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +1 -1
- package/api/@xmachines/play-xstate/functions/composeGuards.md +1 -1
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +1 -1
- package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +1 -1
- package/api/@xmachines/play-xstate/functions/definePlayer.md +1 -1
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +1 -1
- package/api/@xmachines/play-xstate/functions/eventMatches.md +1 -1
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +1 -1
- package/api/@xmachines/play-xstate/functions/hasContext.md +1 -1
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +1 -1
- package/api/@xmachines/play-xstate/functions/negateGuard.md +1 -1
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +3 -3
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +2 -2
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +6 -6
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +5 -5
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +4 -4
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +4 -4
- package/api/@xmachines/shared/README.md +81 -294
- package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
- package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
- package/contributing/README.md +10 -0
- package/contributing/configuration.md +540 -0
- package/contributing/deployment.md +314 -0
- package/contributing/development.md +617 -0
- package/contributing/testing.md +460 -0
- package/examples/@xmachines/play-dom-demo/README.md +3 -3
- package/examples/@xmachines/play-dom-demo/functions/createNavBar.md +1 -1
- package/examples/@xmachines/play-dom-demo/functions/initShell.md +1 -1
- package/examples/@xmachines/play-dom-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-dom-router-demo/README.md +2 -2
- package/examples/@xmachines/play-react-demo/README.md +1 -1
- package/examples/@xmachines/play-react-demo/functions/App.md +1 -1
- package/examples/@xmachines/play-react-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/DebugPanel.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/NavBar.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Shell.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-react-router-demo/README.md +1 -1
- package/examples/@xmachines/play-solid-demo/README.md +1 -1
- package/examples/@xmachines/play-solid-demo/functions/App.md +1 -1
- package/examples/@xmachines/play-solid-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/DebugPanel.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/NavBar.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Shell.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-svelte-demo/README.md +1 -1
- package/examples/@xmachines/play-svelte-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-svelte-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-svelte-spa-router-demo/README.md +2 -2
- package/examples/@xmachines/play-sveltekit-router-demo/README.md +2 -2
- package/examples/@xmachines/play-vue-demo/README.md +1 -1
- package/examples/@xmachines/play-vue-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-vue-demo/variables/App.md +1 -1
- package/examples/@xmachines/play-vue-demo/variables/authCatalog.md +1 -1
- package/examples/README.md +24 -25
- package/examples/form-validation.md +2 -2
- package/guides/README.md +11 -7
- package/guides/actor-model.md +18 -18
- package/guides/architecture.md +500 -0
- package/guides/getting-started.md +351 -142
- package/guides/signals.md +19 -19
- package/guides/state-machines.md +16 -16
- package/package.json +7 -5
- package/guides/installation.md +0 -257
package/guides/signals.md
CHANGED
|
@@ -27,7 +27,7 @@ This model is sometimes called _glitch-free reactivity_: intermediate invalid st
|
|
|
27
27
|
|
|
28
28
|
## The three Signal primitives
|
|
29
29
|
|
|
30
|
-
XMachines uses three primitives from the [TC39 Signals proposal](https://github.com/tc39/proposal-signals), accessed via `@xmachines/play-signals
|
|
30
|
+
XMachines uses three primitives from the [TC39 Signals proposal](https://github.com/tc39/proposal-signals), accessed via [`@xmachines/play-signals`](../api/@xmachines/play-signals/README.md):
|
|
31
31
|
|
|
32
32
|
### `Signal.State` — writable values
|
|
33
33
|
|
|
@@ -78,13 +78,13 @@ actor.currentRoute.get(); // initial read required to arm the watcher
|
|
|
78
78
|
|
|
79
79
|
Watcher notifications are **one-shot**: if you do not call `watch()` again after draining pending signals, you will miss subsequent changes.
|
|
80
80
|
|
|
81
|
-
Router bridges and renderers use `Signal.subtle.Watcher` internally. For most application code, the `watchSignal()` helper covers the common case.
|
|
81
|
+
Router bridges and renderers use `Signal.subtle.Watcher` internally. For most application code, the [`watchSignal()`](../api/@xmachines/play-signals/functions/watchSignal.md) helper covers the common case.
|
|
82
82
|
|
|
83
83
|
---
|
|
84
84
|
|
|
85
|
-
## `watchSignal()` — the safe helper
|
|
85
|
+
## [`watchSignal()`](../api/@xmachines/play-signals/functions/watchSignal.md) — the safe helper
|
|
86
86
|
|
|
87
|
-
`@xmachines/play-signals` exports `watchSignal(signal, onValue)` as a lifecycle-safe wrapper around the raw watcher pattern. It returns a cleanup function:
|
|
87
|
+
[`@xmachines/play-signals`](../api/@xmachines/play-signals/README.md) exports [`watchSignal(signal, onValue)`](../api/@xmachines/play-signals/functions/watchSignal.md) as a lifecycle-safe wrapper around the raw watcher pattern. It returns a cleanup function:
|
|
88
88
|
|
|
89
89
|
```typescript
|
|
90
90
|
import { watchSignal } from "@xmachines/play-signals";
|
|
@@ -97,15 +97,15 @@ const stop = watchSignal(actor.currentRoute, (route) => {
|
|
|
97
97
|
stop();
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
`watchSignal()` handles three subtle correctness concerns for you:
|
|
100
|
+
[`watchSignal()`](../api/@xmachines/play-signals/functions/watchSignal.md) handles three subtle correctness concerns for you:
|
|
101
101
|
|
|
102
|
-
| Concern | What happens without it | How `watchSignal` handles it
|
|
103
|
-
| ---------------------- | -------------------------------------------------- |
|
|
104
|
-
| **Use-after-free** | Callback fires after component unmounts | `disposed` flag checked before invoking callback
|
|
105
|
-
| **Coalescing** | Rapid synchronous changes cause multiple callbacks | `needsEnqueue` guard — only one microtask queued per synchronous burst
|
|
106
|
-
| **Idempotent cleanup** | Calling the cleanup twice throws | Safe to call multiple times
|
|
102
|
+
| Concern | What happens without it | How [`watchSignal`](../api/@xmachines/play-signals/functions/watchSignal.md) handles it |
|
|
103
|
+
| ---------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- |
|
|
104
|
+
| **Use-after-free** | Callback fires after component unmounts | `disposed` flag checked before invoking callback |
|
|
105
|
+
| **Coalescing** | Rapid synchronous changes cause multiple callbacks | `needsEnqueue` guard — only one microtask queued per synchronous burst |
|
|
106
|
+
| **Idempotent cleanup** | Calling the cleanup twice throws | Safe to call multiple times |
|
|
107
107
|
|
|
108
|
-
Use `watchSignal()` in framework adapters and application code. Use the raw `Signal.subtle.Watcher` only when building infrastructure that needs to watch multiple signals independently.
|
|
108
|
+
Use [`watchSignal()`](../api/@xmachines/play-signals/functions/watchSignal.md) in framework adapters and application code. Use the raw `Signal.subtle.Watcher` only when building infrastructure that needs to watch multiple signals independently.
|
|
109
109
|
|
|
110
110
|
---
|
|
111
111
|
|
|
@@ -113,7 +113,7 @@ Use `watchSignal()` in framework adapters and application code. Use the raw `Sig
|
|
|
113
113
|
|
|
114
114
|
The XMachines architecture chose TC39 Signals over observable libraries and event emitters for three reasons:
|
|
115
115
|
|
|
116
|
-
**1. Standardization.** Signals are a Stage 1 TC39 proposal. They are not tied to any library, bundler, or framework. Isolating the polyfill behind `@xmachines/play-signals` means the entire ecosystem can migrate to native signals when the proposal lands, with a single package update.
|
|
116
|
+
**1. Standardization.** Signals are a Stage 1 TC39 proposal. They are not tied to any library, bundler, or framework. Isolating the polyfill behind [`@xmachines/play-signals`](../api/@xmachines/play-signals/README.md) means the entire ecosystem can migrate to native signals when the proposal lands, with a single package update.
|
|
117
117
|
|
|
118
118
|
**2. Synchronous atomic propagation.** RxJS streams are asynchronous by default. Event emitters fire immediately but serially — a listener registered halfway through a sequence can see inconsistent state. Signals propagate atomically: all computeds update before any watcher fires.
|
|
119
119
|
|
|
@@ -139,7 +139,7 @@ The Play RFC defines five invariants that govern how signals are used:
|
|
|
139
139
|
|
|
140
140
|
Signals do not clean themselves up when they go out of scope. Every watcher you create must be explicitly disposed when the consuming component or adapter unmounts.
|
|
141
141
|
|
|
142
|
-
- Framework lifecycle hooks (`useEffect` cleanup in React, `onUnmounted` in Vue, `onCleanup` in Solid) must call `unwatch()` or the cleanup returned by `watchSignal()
|
|
142
|
+
- Framework lifecycle hooks (`useEffect` cleanup in React, `onUnmounted` in Vue, `onCleanup` in Solid) must call `unwatch()` or the cleanup returned by [`watchSignal()`](../api/@xmachines/play-signals/functions/watchSignal.md).
|
|
143
143
|
- Router bridge `disconnect()` methods must unwatch all signal subscriptions.
|
|
144
144
|
- If you use the raw `Signal.subtle.Watcher` API, pair every `watch()` call with `unwatch()` in teardown.
|
|
145
145
|
|
|
@@ -149,12 +149,12 @@ Failing to clean up watchers causes memory leaks and stale callbacks firing afte
|
|
|
149
149
|
|
|
150
150
|
## Summary
|
|
151
151
|
|
|
152
|
-
| Primitive
|
|
153
|
-
|
|
|
154
|
-
| `Signal.State`
|
|
155
|
-
| `Signal.Computed`
|
|
156
|
-
| `Signal.subtle.Watcher`
|
|
157
|
-
| `watchSignal()`
|
|
152
|
+
| Primitive | Role in XMachines | Who uses it |
|
|
153
|
+
| -------------------------------------------------------------------------- | ---------------------------------------------- | ---------------------------------- |
|
|
154
|
+
| `Signal.State` | Actor output: writable snapshot and view state | Actor writes; infrastructure reads |
|
|
155
|
+
| `Signal.Computed` | Lazy derivations: routes, view specs | Actor defines; adapters read |
|
|
156
|
+
| `Signal.subtle.Watcher` | Low-level reactive observation | Framework adapters, router bridges |
|
|
157
|
+
| [`watchSignal()`](../api/@xmachines/play-signals/functions/watchSignal.md) | Lifecycle-safe single-signal subscription | Application code, adapter code |
|
|
158
158
|
|
|
159
159
|
## See also
|
|
160
160
|
|
package/guides/state-machines.md
CHANGED
|
@@ -24,7 +24,7 @@ In traditional component-level state (e.g., boolean flags, `useState` combinatio
|
|
|
24
24
|
|
|
25
25
|
## How XMachines uses XState v5
|
|
26
26
|
|
|
27
|
-
XMachines wraps XState v5 via `@xmachines/play-xstate
|
|
27
|
+
XMachines wraps XState v5 via [`@xmachines/play-xstate`](../api/@xmachines/play-xstate/README.md). You define machines using XState's `setup().createMachine()` API:
|
|
28
28
|
|
|
29
29
|
```typescript
|
|
30
30
|
import { setup } from "xstate";
|
|
@@ -124,13 +124,13 @@ const appMachine = setup({
|
|
|
124
124
|
|
|
125
125
|
`meta.route` is a string path. When the machine enters a state, `actor.currentRoute` (a `Signal.Computed`) derives this path and emits it. The router bridge reads it and updates the URL.
|
|
126
126
|
|
|
127
|
-
`meta.view` is a `PlaySpec` — a `@json-render/core` spec object describing what to render. Use `typedSpec<TContext>(...)` from `@xmachines/play-actor` to validate `contextProps` entries at compile time. When the machine enters a state, `actor.currentView` is updated with this spec. The renderer reads it and projects it through framework components.
|
|
127
|
+
`meta.view` is a [`PlaySpec`](../api/@xmachines/play-actor/interfaces/PlaySpec.md) — a `@json-render/core` spec object describing what to render. Use `typedSpec<TContext>(...)` from [`@xmachines/play-actor`](../api/@xmachines/play-actor/README.md) to validate `contextProps` entries at compile time. When the machine enters a state, `actor.currentView` is updated with this spec. The renderer reads it and projects it through framework components.
|
|
128
128
|
|
|
129
129
|
**The machine is the single source of truth for both routing and views.** There is no separate route configuration file. There is no switch statement in a component deciding what to render based on the URL. The state machine encodes all of that.
|
|
130
130
|
|
|
131
131
|
---
|
|
132
132
|
|
|
133
|
-
## `formatPlayRouteTransitions` — automatic route event wiring
|
|
133
|
+
## [`formatPlayRouteTransitions`](../api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md) — automatic route event wiring
|
|
134
134
|
|
|
135
135
|
For routing to work, the machine must respond to `play.route` events (sent by router bridges when the user navigates). Writing these transitions by hand is mechanical:
|
|
136
136
|
|
|
@@ -150,7 +150,7 @@ states: {
|
|
|
150
150
|
}
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
`formatPlayRouteTransitions` from `@xmachines/play-xstate` generates these transitions automatically from the `id` and `meta.route` fields you already have:
|
|
153
|
+
[`formatPlayRouteTransitions`](../api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md) from [`@xmachines/play-xstate`](../api/@xmachines/play-xstate/README.md) generates these transitions automatically from the `id` and `meta.route` fields you already have:
|
|
154
154
|
|
|
155
155
|
```typescript
|
|
156
156
|
import { formatPlayRouteTransitions } from "@xmachines/play-xstate";
|
|
@@ -170,7 +170,7 @@ const appMachine = setup({
|
|
|
170
170
|
);
|
|
171
171
|
```
|
|
172
172
|
|
|
173
|
-
`formatPlayRouteTransitions` inspects all state nodes with a `meta.route` and generates the corresponding `play.route` guard transitions. The machine's context must include `params` and `query` fields (populated by the router bridge when params or query strings are present):
|
|
173
|
+
[`formatPlayRouteTransitions`](../api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md) inspects all state nodes with a `meta.route` and generates the corresponding `play.route` guard transitions. The machine's context must include `params` and `query` fields (populated by the router bridge when params or query strings are present):
|
|
174
174
|
|
|
175
175
|
```typescript
|
|
176
176
|
types: {
|
|
@@ -202,16 +202,16 @@ Guards are evaluated by XState before a transition fires. If the guard returns `
|
|
|
202
202
|
|
|
203
203
|
This is the **Actor Authority** invariant in practice: the machine decides, infrastructure adjusts.
|
|
204
204
|
|
|
205
|
-
XMachines provides guard combinators in `@xmachines/play-xstate` for composing complex conditions:
|
|
205
|
+
XMachines provides guard combinators in [`@xmachines/play-xstate`](../api/@xmachines/play-xstate/README.md) for composing complex conditions:
|
|
206
206
|
|
|
207
|
-
| Function
|
|
208
|
-
|
|
|
209
|
-
| `composeGuards(...guards)`
|
|
210
|
-
| `composeGuardsOr(...guards)`
|
|
211
|
-
| `negateGuard(guard)`
|
|
212
|
-
| `hasContext(key)`
|
|
213
|
-
| `contextFieldMatches(key, value)` | Checks a context field against a value |
|
|
214
|
-
| `eventMatches(type)`
|
|
207
|
+
| Function | What it does |
|
|
208
|
+
| --------------------------------------------------------------------------------------------------- | --------------------------------------- |
|
|
209
|
+
| [`composeGuards(...guards)`](../api/@xmachines/play-xstate/functions/composeGuards.md) | AND — all guards must pass |
|
|
210
|
+
| [`composeGuardsOr(...guards)`](../api/@xmachines/play-xstate/functions/composeGuardsOr.md) | OR — any guard must pass |
|
|
211
|
+
| [`negateGuard(guard)`](../api/@xmachines/play-xstate/functions/negateGuard.md) | NOT — inverts the guard result |
|
|
212
|
+
| [`hasContext(key)`](../api/@xmachines/play-xstate/functions/hasContext.md) | Checks that a context field is non-null |
|
|
213
|
+
| [`contextFieldMatches(key, value)`](../api/@xmachines/play-xstate/functions/contextFieldMatches.md) | Checks a context field against a value |
|
|
214
|
+
| [`eventMatches(type)`](../api/@xmachines/play-xstate/functions/eventMatches.md) | Checks the event type |
|
|
215
215
|
|
|
216
216
|
---
|
|
217
217
|
|
|
@@ -261,7 +261,7 @@ actor.start();
|
|
|
261
261
|
// Actor resumes from where it left off
|
|
262
262
|
```
|
|
263
263
|
|
|
264
|
-
`definePlayer` accepts an optional `restore` argument for this purpose. Restoration is useful for server-side rendering (hydrate with the server's snapshot), session persistence (resume after page reload), and testing (start from a known mid-flow state).
|
|
264
|
+
[`definePlayer`](../api/@xmachines/play-xstate/functions/definePlayer.md) accepts an optional `restore` argument for this purpose. Restoration is useful for server-side rendering (hydrate with the server's snapshot), session persistence (resume after page reload), and testing (start from a known mid-flow state).
|
|
265
265
|
|
|
266
266
|
---
|
|
267
267
|
|
|
@@ -283,6 +283,6 @@ actor.start();
|
|
|
283
283
|
- [Understanding TC39 Signals](signals.md) — how the actor's state is observed by infrastructure
|
|
284
284
|
- [Getting Started](getting-started.md) — step-by-step walkthrough building your first machine and actor
|
|
285
285
|
- [Routing Patterns](../examples/routing-patterns.md) — worked examples of `meta.route` and guards
|
|
286
|
-
- [@xmachines/play-xstate README](../api/@xmachines/play-xstate/README.md) — full API reference for `definePlayer
|
|
286
|
+
- [@xmachines/play-xstate README](../api/@xmachines/play-xstate/README.md) — full API reference for [`definePlayer`](../api/@xmachines/play-xstate/functions/definePlayer.md), [`PlayerActor`](../api/@xmachines/play-xstate/classes/PlayerActor.md), guard combinators
|
|
287
287
|
- [XState v5 documentation](https://stately.ai/docs/xstate) — upstream state machine library documentation
|
|
288
288
|
- [Play RFC](../rfc/play.md) — complete architectural specification
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmachines/docs",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.50",
|
|
4
4
|
"description": "Documentation for XMachines",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"documentation",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
22
|
"api",
|
|
23
|
+
"contributing",
|
|
23
24
|
"examples",
|
|
24
25
|
"guides",
|
|
25
26
|
"rfc",
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
"import": "./index.js"
|
|
34
35
|
},
|
|
35
36
|
"./api/*": "./api/*",
|
|
37
|
+
"./contributing/*": "./contributing/*",
|
|
36
38
|
"./examples/*": "./examples/*",
|
|
37
39
|
"./guides/*": "./guides/*",
|
|
38
40
|
"./rfc/*": "./rfc/*"
|
|
@@ -49,12 +51,12 @@
|
|
|
49
51
|
"test": "vitest run"
|
|
50
52
|
},
|
|
51
53
|
"devDependencies": {
|
|
52
|
-
"@xmachines/shared": "1.0.0-beta.
|
|
53
|
-
"oxfmt": "^0.
|
|
54
|
-
"oxlint": "^1.
|
|
54
|
+
"@xmachines/shared": "1.0.0-beta.50",
|
|
55
|
+
"oxfmt": "^0.47.0",
|
|
56
|
+
"oxlint": "^1.62.0",
|
|
55
57
|
"typedoc": "^0.28.19",
|
|
56
58
|
"typedoc-plugin-llms-txt": "^0.1.2",
|
|
57
59
|
"typedoc-plugin-markdown": "^4.11.0",
|
|
58
|
-
"vitest": "^4.1.
|
|
60
|
+
"vitest": "^4.1.5"
|
|
59
61
|
}
|
|
60
62
|
}
|
package/guides/installation.md
DELETED
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
<!-- generated-by: gsd-doc-writer -->
|
|
2
|
-
|
|
3
|
-
# Installation
|
|
4
|
-
|
|
5
|
-
Install XMachines packages for your platform.
|
|
6
|
-
|
|
7
|
-
## Prerequisites
|
|
8
|
-
|
|
9
|
-
- **Node.js 22+** (or compatible runtime)
|
|
10
|
-
- **TypeScript 5.7+** with `strict: true` and `"type": "module"` in `package.json`
|
|
11
|
-
- A package manager: npm, pnpm, or yarn
|
|
12
|
-
|
|
13
|
-
XMachines packages are **ESM-only** — no CommonJS builds. All packages use `"type": "module"`.
|
|
14
|
-
|
|
15
|
-
## Core Packages
|
|
16
|
-
|
|
17
|
-
The minimum installation for defining machines and actors:
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
npm install @xmachines/play-xstate @xmachines/play-actor @xmachines/play-signals xstate
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
| Package | Role |
|
|
24
|
-
| ------------------------- | ----------------------------------------------------------- |
|
|
25
|
-
| `xstate` | XState v5 peer dependency — `setup`, `assign`, etc. |
|
|
26
|
-
| `@xmachines/play-xstate` | `definePlayer`, `formatPlayRouteTransitions`, `PlayerActor` |
|
|
27
|
-
| `@xmachines/play-actor` | `AbstractActor`, `typedSpec` — actor base class |
|
|
28
|
-
| `@xmachines/play-signals` | TC39 Signals polyfill, `watchSignal` |
|
|
29
|
-
|
|
30
|
-
### Minimal working example
|
|
31
|
-
|
|
32
|
-
```typescript
|
|
33
|
-
import { setup } from "xstate";
|
|
34
|
-
import { definePlayer } from "@xmachines/play-xstate";
|
|
35
|
-
|
|
36
|
-
const machine = setup({
|
|
37
|
-
types: {
|
|
38
|
-
context: {} as { count: number },
|
|
39
|
-
events: {} as { type: "increment" },
|
|
40
|
-
input: {} as undefined,
|
|
41
|
-
},
|
|
42
|
-
}).createMachine({
|
|
43
|
-
id: "counter",
|
|
44
|
-
initial: "idle",
|
|
45
|
-
context: { count: 0 },
|
|
46
|
-
states: {
|
|
47
|
-
idle: {},
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
const createPlayer = definePlayer({ machine });
|
|
52
|
-
const actor = createPlayer();
|
|
53
|
-
actor.start();
|
|
54
|
-
|
|
55
|
-
console.log("✓ XMachines installed successfully");
|
|
56
|
-
console.log("Current state:", actor.getSnapshot().value);
|
|
57
|
-
|
|
58
|
-
actor.stop();
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Run with:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
npx tsx my-script.ts
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## Framework-Specific Additions
|
|
68
|
-
|
|
69
|
-
### Vanilla DOM
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
npm install @xmachines/play-dom @xmachines/play-dom-router @xmachines/play-router @json-render/core
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
| Package | Role |
|
|
76
|
-
| ---------------------------- | -------------------------------------------------------------------------------- |
|
|
77
|
-
| `@xmachines/play-dom` | `createRenderer`, `connectRenderer`, `defineRegistry`, `ComponentFn`, `ActionFn` |
|
|
78
|
-
| `@xmachines/play-dom-router` | `connectRouter`, `createBrowserHistory`, `createRouter`, `createRouteMap` |
|
|
79
|
-
| `@xmachines/play-router` | `extractMachineRoutes`, `getRoutableRoutes`, `formatPlayRouteTransitions` |
|
|
80
|
-
| `@json-render/core` | Catalog and schema definitions (`defineCatalog`) |
|
|
81
|
-
|
|
82
|
-
### React
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
npm install @xmachines/play-react @xmachines/play-router @json-render/core @json-render/react
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
With routing:
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
# TanStack React Router
|
|
92
|
-
npm install @xmachines/play-tanstack-react-router @tanstack/react-router
|
|
93
|
-
|
|
94
|
-
# React Router v7
|
|
95
|
-
npm install @xmachines/play-react-router react-router
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
| Package | Role |
|
|
99
|
-
| --------------------------------------- | ---------------------------------------------------------------- |
|
|
100
|
-
| `@xmachines/play-react` | `PlayRenderer`, `defineRegistry` |
|
|
101
|
-
| `@xmachines/play-tanstack-react-router` | `PlayRouterProvider`, `createRouteMapFromTree` |
|
|
102
|
-
| `@xmachines/play-react-router` | `PlayRouterProvider`, `createRouteMapFromTree` (React Router v7) |
|
|
103
|
-
|
|
104
|
-
### Vue 3
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
npm install @xmachines/play-vue @xmachines/play-vue-router @xmachines/play-router @json-render/core vue-router
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
| Package | Role |
|
|
111
|
-
| ---------------------------- | -------------------------------------- |
|
|
112
|
-
| `@xmachines/play-vue` | `PlayRenderer`, `defineRegistry` |
|
|
113
|
-
| `@xmachines/play-vue-router` | `PlayRouterProvider`, `createRouteMap` |
|
|
114
|
-
|
|
115
|
-
### SolidJS
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
npm install @xmachines/play-solid @xmachines/play-router @json-render/core
|
|
119
|
-
|
|
120
|
-
# With router:
|
|
121
|
-
npm install @xmachines/play-solid-router @solidjs/router
|
|
122
|
-
# or TanStack:
|
|
123
|
-
npm install @xmachines/play-tanstack-solid-router @tanstack/solid-router
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
| Package | Role |
|
|
127
|
-
| --------------------------------------- | ------------------------------------------------------- |
|
|
128
|
-
| `@xmachines/play-solid` | `PlayRenderer`, `defineRegistry` |
|
|
129
|
-
| `@xmachines/play-solid-router` | `PlayRouterProvider`, `createRouteMap` (SolidJS Router) |
|
|
130
|
-
| `@xmachines/play-tanstack-solid-router` | `PlayRouterProvider`, `createRouteMap` (TanStack Solid) |
|
|
131
|
-
|
|
132
|
-
### Svelte 5
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
npm install @xmachines/play-svelte @xmachines/play-router @json-render/core
|
|
136
|
-
|
|
137
|
-
# With SvelteKit routing:
|
|
138
|
-
npm install @xmachines/play-sveltekit-router
|
|
139
|
-
|
|
140
|
-
# With svelte-spa-router (hash routing):
|
|
141
|
-
npm install @xmachines/play-svelte-spa-router
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
| Package | Role |
|
|
145
|
-
| ----------------------------------- | ----------------------------------------------------- |
|
|
146
|
-
| `@xmachines/play-svelte` | `PlayRenderer`, `defineRegistry` |
|
|
147
|
-
| `@xmachines/play-sveltekit-router` | `connectRouter`, `createRouteMap` (SvelteKit) |
|
|
148
|
-
| `@xmachines/play-svelte-spa-router` | `connectRouter`, `createRouteMap` (svelte-spa-router) |
|
|
149
|
-
|
|
150
|
-
## TypeScript Configuration
|
|
151
|
-
|
|
152
|
-
All XMachines packages require TypeScript strict mode and ESM module resolution.
|
|
153
|
-
|
|
154
|
-
**Recommended `tsconfig.json`:**
|
|
155
|
-
|
|
156
|
-
```json
|
|
157
|
-
{
|
|
158
|
-
"compilerOptions": {
|
|
159
|
-
"target": "ESNext",
|
|
160
|
-
"module": "ESNext",
|
|
161
|
-
"moduleResolution": "bundler",
|
|
162
|
-
"strict": true,
|
|
163
|
-
"esModuleInterop": true,
|
|
164
|
-
"skipLibCheck": false,
|
|
165
|
-
"resolveJsonModule": true
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
For Node.js projects (without a bundler), use `"moduleResolution": "node16"` or `"nodenext"`.
|
|
171
|
-
|
|
172
|
-
**ESM import extensions:** Always use `.js` extensions in TypeScript import paths, even when importing `.ts` source files:
|
|
173
|
-
|
|
174
|
-
```typescript
|
|
175
|
-
// ✅ Correct
|
|
176
|
-
import { authMachine } from "./auth-machine.js";
|
|
177
|
-
|
|
178
|
-
// ❌ Wrong — will fail at runtime
|
|
179
|
-
import { authMachine } from "./auth-machine";
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
**`package.json` for your project:**
|
|
183
|
-
|
|
184
|
-
```json
|
|
185
|
-
{
|
|
186
|
-
"type": "module",
|
|
187
|
-
"dependencies": {
|
|
188
|
-
"@xmachines/play-xstate": "latest",
|
|
189
|
-
"@xmachines/play-actor": "latest",
|
|
190
|
-
"@xmachines/play-signals": "latest",
|
|
191
|
-
"xstate": "latest"
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
## ESM Setup for Node.js
|
|
197
|
-
|
|
198
|
-
XMachines uses ESM exclusively. For Node.js:
|
|
199
|
-
|
|
200
|
-
```json
|
|
201
|
-
{
|
|
202
|
-
"type": "module"
|
|
203
|
-
}
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
Or use `.mjs` file extensions. Dynamic imports work in CommonJS contexts:
|
|
207
|
-
|
|
208
|
-
```javascript
|
|
209
|
-
const { definePlayer } = await import("@xmachines/play-xstate");
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
## Deno
|
|
213
|
-
|
|
214
|
-
XMachines works with Deno via npm specifiers:
|
|
215
|
-
|
|
216
|
-
```typescript
|
|
217
|
-
import { setup } from "npm:xstate";
|
|
218
|
-
import { definePlayer } from "npm:@xmachines/play-xstate";
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
## Troubleshooting
|
|
222
|
-
|
|
223
|
-
### `Cannot find module '@xmachines/play-xstate'`
|
|
224
|
-
|
|
225
|
-
```bash
|
|
226
|
-
# Verify installation
|
|
227
|
-
npm list @xmachines/play-xstate
|
|
228
|
-
|
|
229
|
-
# Reinstall
|
|
230
|
-
npm install
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
### `SyntaxError: Cannot use import statement outside a module`
|
|
234
|
-
|
|
235
|
-
Add `"type": "module"` to your `package.json`, or rename files to `.mjs`.
|
|
236
|
-
|
|
237
|
-
### `Could not find a declaration file for module`
|
|
238
|
-
|
|
239
|
-
Types are built-in — no separate `@types/` package needed. Check:
|
|
240
|
-
|
|
241
|
-
- `moduleResolution` in `tsconfig.json` is set to `"bundler"`, `"node16"`, or `"nodenext"`
|
|
242
|
-
- TypeScript version is 5.7+
|
|
243
|
-
- Run `npm install` again to ensure dist files are present
|
|
244
|
-
|
|
245
|
-
### Type incompatibilities between packages
|
|
246
|
-
|
|
247
|
-
Install all XMachines packages with matching major versions:
|
|
248
|
-
|
|
249
|
-
```bash
|
|
250
|
-
npm install @xmachines/play-xstate@latest @xmachines/play-actor@latest @xmachines/play-signals@latest
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
## Next Steps
|
|
254
|
-
|
|
255
|
-
- **[Getting Started →](getting-started.md)** — Build your first machine and actor
|
|
256
|
-
- **[Examples](../examples/README.md)** — Routing patterns, form validation, multi-router demos
|
|
257
|
-
- **[API Reference](../api/README.md)** — Generated API docs for all packages
|