@xmachines/docs 1.0.0-beta.9 → 1.1.0
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 +159 -39
- package/api/@xmachines/play/classes/NonNullableError.md +189 -0
- package/api/@xmachines/play/classes/PlayError.md +251 -0
- package/api/@xmachines/play/functions/assertNonNullable.md +56 -0
- package/api/@xmachines/play/type-aliases/PlayEvent.md +6 -6
- package/api/@xmachines/play-actor/README.md +153 -160
- package/api/@xmachines/play-actor/classes/AbstractActor.md +106 -121
- package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +40 -0
- package/api/@xmachines/play-actor/functions/toAtomState.md +33 -0
- package/api/@xmachines/play-actor/functions/typedSpec.md +54 -0
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +46 -0
- package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +33 -0
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +28 -0
- package/api/@xmachines/play-actor/interfaces/Routable.md +6 -21
- package/api/@xmachines/play-actor/interfaces/Viewable.md +12 -6
- package/api/@xmachines/play-dom/README.md +385 -0
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +115 -0
- package/api/@xmachines/play-dom/functions/createPlayUI.md +28 -0
- package/api/@xmachines/play-dom/functions/createRenderer.md +44 -0
- package/api/@xmachines/play-dom/functions/defineRegistry.md +26 -0
- package/api/@xmachines/play-dom/functions/renderSpec.md +67 -0
- package/api/@xmachines/play-dom/interfaces/ComponentContext.md +23 -0
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +34 -0
- package/api/@xmachines/play-dom/interfaces/DefineRegistryResult.md +17 -0
- package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +28 -0
- package/api/@xmachines/play-dom/interfaces/EventHandle.md +15 -0
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +18 -0
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +30 -0
- package/api/@xmachines/play-dom/interfaces/RenderSpecOptions.md +26 -0
- package/api/@xmachines/play-dom/interfaces/UIProviderOptions.md +32 -0
- package/api/@xmachines/play-dom/type-aliases/ActionFn.md +46 -0
- package/api/@xmachines/play-dom/type-aliases/Actions.md +18 -0
- package/api/@xmachines/play-dom/type-aliases/BaseComponentProps.md +114 -0
- package/api/@xmachines/play-dom/type-aliases/CatalogHasActions.md +25 -0
- package/api/@xmachines/play-dom/type-aliases/ComponentFn.md +26 -0
- package/api/@xmachines/play-dom/type-aliases/ComponentRegistry.md +15 -0
- package/api/@xmachines/play-dom/type-aliases/ConfirmHandler.md +44 -0
- package/api/@xmachines/play-dom/type-aliases/DefineRegistryOptions.md +39 -0
- package/api/@xmachines/play-dom/type-aliases/DomComponentRenderer.md +20 -0
- package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +9 -0
- package/api/@xmachines/play-dom/type-aliases/DomSchema.md +9 -0
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +27 -0
- package/api/@xmachines/play-dom/type-aliases/RenderErrorHandler.md +23 -0
- package/api/@xmachines/play-dom/type-aliases/SetState.md +30 -0
- package/api/@xmachines/play-dom/variables/schema.md +62 -0
- package/api/@xmachines/play-dom-router/README.md +272 -0
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +43 -0
- package/api/@xmachines/{play-router → play-dom-router}/functions/createBrowserHistory.md +10 -2
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +39 -0
- package/api/@xmachines/play-dom-router/functions/createRouter.md +54 -0
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +176 -0
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +69 -0
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +15 -0
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +129 -0
- package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +68 -0
- package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +54 -0
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +121 -0
- package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +13 -0
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +27 -0
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +28 -0
- package/api/@xmachines/play-react/README.md +185 -333
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +46 -42
- package/api/@xmachines/play-react/functions/ActionProvider.md +21 -0
- package/api/@xmachines/play-react/functions/JSONUIProvider.md +21 -0
- package/api/@xmachines/play-react/functions/Renderer.md +21 -0
- package/api/@xmachines/play-react/functions/StateProvider.md +27 -0
- package/api/@xmachines/play-react/functions/ValidationProvider.md +21 -0
- package/api/@xmachines/play-react/functions/VisibilityProvider.md +21 -0
- package/api/@xmachines/play-react/functions/defineRegistry.md +49 -0
- package/api/@xmachines/play-react/functions/useActor.md +13 -0
- package/api/@xmachines/play-react/functions/useBoundProp.md +45 -0
- package/api/@xmachines/play-react/functions/usePlayView.md +32 -0
- package/api/@xmachines/play-react/functions/useSignalEffect.md +29 -20
- package/api/@xmachines/play-react/interfaces/ActionProviderProps.md +15 -0
- package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +27 -0
- package/api/@xmachines/play-react/interfaces/ComponentContext.md +37 -0
- package/api/@xmachines/play-react/interfaces/JSONUIProviderProps.md +22 -0
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +7 -7
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +6 -6
- package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +26 -0
- package/api/@xmachines/play-react/interfaces/RendererProps.md +17 -0
- package/api/@xmachines/play-react/interfaces/StateProviderProps.md +16 -0
- package/api/@xmachines/play-react/interfaces/ValidationProviderProps.md +14 -0
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +20 -0
- package/api/@xmachines/play-react/interfaces/VisibilityProviderProps.md +13 -0
- package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +11 -0
- package/api/@xmachines/play-react/type-aliases/ComponentFn.md +36 -0
- package/api/@xmachines/play-react/type-aliases/RenderErrorHandler.md +23 -0
- package/api/@xmachines/play-react/variables/ActorProvider.md +33 -0
- package/api/@xmachines/play-react/variables/PlayRenderer.md +6 -56
- package/api/@xmachines/play-react/variables/PlayUIProvider.md +43 -0
- package/api/@xmachines/play-react-router/README.md +130 -115
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +19 -242
- package/api/@xmachines/play-react-router/classes/RouteMap.md +48 -36
- package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +45 -0
- package/api/@xmachines/play-react-router/functions/createRouteMap.md +39 -0
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +23 -12
- package/api/@xmachines/play-react-router/interfaces/PlayActor.md +68 -0
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +22 -12
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +32 -0
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +25 -9
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +13 -0
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +19 -9
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +8 -8
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +30 -0
- package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +32 -0
- package/api/@xmachines/play-router/README.md +275 -352
- package/api/@xmachines/play-router/classes/RouteMap.md +149 -0
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +21 -221
- package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +32 -0
- package/api/@xmachines/play-router/functions/buildRouteTree.md +12 -2
- package/api/@xmachines/play-router/functions/createRouteMap.md +22 -36
- package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +46 -0
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +14 -7
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +10 -46
- package/api/@xmachines/play-router/functions/extractQuery.md +22 -0
- package/api/@xmachines/play-router/functions/extractRouteParams.md +54 -0
- package/api/@xmachines/play-router/functions/findRouteById.md +2 -2
- package/api/@xmachines/play-router/functions/findRouteByPath.md +2 -2
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +2 -2
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +2 -2
- package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +43 -0
- package/api/@xmachines/play-router/functions/isRouteReachable.md +38 -0
- package/api/@xmachines/play-router/functions/machineToGraph.md +19 -0
- package/api/@xmachines/play-router/functions/routeExists.md +2 -2
- package/api/@xmachines/play-router/functions/sanitizePathname.md +40 -0
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +10 -9
- package/api/@xmachines/play-router/functions/validateStateExists.md +9 -9
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +13 -0
- package/api/@xmachines/play-router/interfaces/LocationLike.md +27 -0
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +15 -0
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +17 -0
- package/api/@xmachines/play-router/interfaces/PlayActor.md +68 -0
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +22 -12
- package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +17 -0
- package/api/@xmachines/play-router/interfaces/RoutableActor.md +64 -0
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +11 -11
- package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +13 -0
- package/api/@xmachines/play-router/interfaces/RouteMapping.md +27 -0
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +12 -0
- package/api/@xmachines/play-router/interfaces/RouteNode.md +13 -13
- package/api/@xmachines/play-router/interfaces/RouteObject.md +5 -5
- package/api/@xmachines/play-router/interfaces/RouteTree.md +8 -7
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +55 -0
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +8 -8
- package/api/@xmachines/play-router/interfaces/WindowLike.md +65 -0
- package/api/@xmachines/play-router/type-aliases/MachineGraph.md +20 -0
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +2 -2
- package/api/@xmachines/play-signals/README.md +117 -65
- package/api/@xmachines/play-signals/functions/watchSignal.md +42 -0
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +7 -5
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +3 -3
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +7 -5
- package/api/@xmachines/play-signals/interfaces/SignalState.md +4 -4
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +5 -5
- package/api/@xmachines/play-signals/namespaces/Signal/README.md +1 -1
- package/api/@xmachines/play-signals/namespaces/Signal/classes/Computed.md +7 -7
- package/api/@xmachines/play-signals/namespaces/Signal/classes/State.md +8 -8
- package/api/@xmachines/play-signals/namespaces/Signal/interfaces/Options.md +7 -7
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/README.md +1 -1
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/classes/Watcher.md +9 -9
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/currentComputed.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSinks.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSources.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSinks.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSources.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/untrack.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/unwatched.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/watched.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isComputed.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isState.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isWatcher.md +2 -2
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +2 -2
- package/api/@xmachines/play-solid/README.md +196 -233
- package/api/@xmachines/play-solid/functions/ActionProvider.md +19 -0
- package/api/@xmachines/play-solid/functions/JSONUIProvider.md +21 -0
- package/api/@xmachines/play-solid/functions/Renderer.md +21 -0
- package/api/@xmachines/play-solid/functions/StateProvider.md +19 -0
- package/api/@xmachines/play-solid/functions/ValidationProvider.md +19 -0
- package/api/@xmachines/play-solid/functions/VisibilityProvider.md +20 -0
- package/api/@xmachines/play-solid/functions/defineRegistry.md +49 -0
- package/api/@xmachines/play-solid/functions/useAction.md +24 -0
- package/api/@xmachines/play-solid/functions/useActions.md +13 -0
- package/api/@xmachines/play-solid/functions/useActor.md +13 -0
- package/api/@xmachines/play-solid/functions/useBoundProp.md +45 -0
- package/api/@xmachines/play-solid/functions/useFieldValidation.md +29 -0
- package/api/@xmachines/play-solid/functions/useIsVisible.md +19 -0
- package/api/@xmachines/play-solid/functions/useOptionalValidation.md +13 -0
- package/api/@xmachines/play-solid/functions/usePlayView.md +30 -0
- package/api/@xmachines/play-solid/functions/useStateBinding.md +25 -0
- package/api/@xmachines/play-solid/functions/useStateStore.md +13 -0
- package/api/@xmachines/play-solid/functions/useStateValue.md +25 -0
- package/api/@xmachines/play-solid/functions/useVisibility.md +13 -0
- package/api/@xmachines/play-solid/interfaces/ActionProviderProps.md +12 -0
- package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +30 -0
- package/api/@xmachines/play-solid/interfaces/ComponentContext.md +37 -0
- package/api/@xmachines/play-solid/interfaces/DefineRegistryResult.md +15 -0
- package/api/@xmachines/play-solid/interfaces/JSONUIProviderProps.md +22 -0
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +26 -0
- package/api/@xmachines/play-solid/interfaces/RendererProps.md +17 -0
- package/api/@xmachines/play-solid/interfaces/StateProviderProps.md +13 -0
- package/api/@xmachines/play-solid/interfaces/ValidationProviderProps.md +11 -0
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +21 -0
- package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +11 -0
- package/api/@xmachines/play-solid/type-aliases/ComponentFn.md +36 -0
- package/api/@xmachines/play-solid/type-aliases/ComponentRegistry.md +11 -0
- package/api/@xmachines/play-solid/type-aliases/RenderErrorHandler.md +23 -0
- package/api/@xmachines/play-solid/type-aliases/SetState.md +21 -0
- package/api/@xmachines/play-solid/type-aliases/VisibilityProviderProps.md +9 -0
- package/api/@xmachines/play-solid/variables/ActorContext.md +13 -0
- package/api/@xmachines/play-solid/variables/ActorProvider.md +27 -0
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +6 -62
- package/api/@xmachines/play-solid/variables/PlayUIProvider.md +26 -0
- package/api/@xmachines/play-solid-router/README.md +151 -559
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +31 -32
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +27 -242
- package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +44 -0
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +18 -11
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +99 -114
- package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +68 -0
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +22 -12
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +30 -0
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +25 -9
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +13 -0
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +20 -7
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +8 -8
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +34 -0
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +8 -4
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +22 -19
- package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +52 -0
- package/api/@xmachines/play-svelte/README.md +270 -0
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +31 -0
- package/api/@xmachines/play-svelte/functions/getActorContext.md +21 -0
- package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +19 -0
- package/api/@xmachines/play-svelte/functions/setActorContext.md +19 -0
- package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +44 -0
- package/api/@xmachines/play-svelte/interfaces/BaseComponentProps.md +29 -0
- package/api/@xmachines/play-svelte/interfaces/ComponentContext.md +29 -0
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +24 -0
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +43 -0
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +24 -0
- package/api/@xmachines/play-svelte/type-aliases/ActionFn.md +30 -0
- package/api/@xmachines/play-svelte/type-aliases/Actions.md +17 -0
- package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +11 -0
- package/api/@xmachines/play-svelte/type-aliases/ComponentFn.md +18 -0
- package/api/@xmachines/play-svelte/type-aliases/JSONUIProviderProps.md +7 -0
- package/api/@xmachines/play-svelte/type-aliases/PlayRenderer.md +9 -0
- package/api/@xmachines/play-svelte/type-aliases/RenderErrorHandler.md +23 -0
- package/api/@xmachines/play-svelte/type-aliases/SetState.md +21 -0
- package/api/@xmachines/play-svelte/variables/PlayRenderer.md +9 -0
- package/api/@xmachines/play-svelte-spa-router/README.md +197 -0
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +149 -0
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +32 -0
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +39 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +17 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +129 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +13 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +27 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +65 -0
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +9 -0
- package/api/@xmachines/play-sveltekit-router/README.md +212 -0
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +149 -0
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +32 -0
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +39 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +13 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +27 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +129 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +13 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +27 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +9 -0
- package/api/@xmachines/play-tanstack-react-router/README.md +155 -125
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +48 -36
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +31 -252
- package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +45 -0
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +22 -36
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +23 -12
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +28 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +68 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +22 -12
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +32 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +25 -9
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +13 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +19 -9
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +6 -6
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +8 -8
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +30 -0
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +2 -2
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +40 -18
- package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +34 -0
- package/api/@xmachines/play-tanstack-router/README.md +61 -0
- package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +131 -0
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +57 -0
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +100 -0
- package/api/@xmachines/play-tanstack-solid-router/README.md +216 -175
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +31 -32
- package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +121 -0
- package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +44 -0
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +18 -11
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +68 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +22 -12
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +31 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +23 -9
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +13 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +14 -10
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +8 -8
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +30 -0
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +8 -4
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +40 -18
- package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +33 -0
- package/api/@xmachines/play-vue/README.md +190 -210
- package/api/@xmachines/play-vue/functions/defineRegistry.md +32 -0
- package/api/@xmachines/play-vue/functions/getPlayViewContext.md +28 -0
- package/api/@xmachines/play-vue/functions/useActor.md +13 -0
- package/api/@xmachines/play-vue/functions/useBoundProp.md +45 -0
- package/api/@xmachines/play-vue/interfaces/ActionProviderProps.md +12 -0
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +25 -0
- package/api/@xmachines/play-vue/interfaces/ComponentContext.md +37 -0
- package/api/@xmachines/play-vue/interfaces/DefineRegistryResult.md +15 -0
- package/api/@xmachines/play-vue/interfaces/JSONUIProviderProps.md +21 -0
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +24 -0
- package/api/@xmachines/play-vue/interfaces/RendererProps.md +17 -0
- package/api/@xmachines/play-vue/interfaces/StateProviderProps.md +15 -0
- package/api/@xmachines/play-vue/interfaces/ValidationProviderProps.md +11 -0
- package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +21 -0
- package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +5 -0
- package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +11 -0
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +16 -0
- package/api/@xmachines/play-vue/type-aliases/ComponentFn.md +35 -0
- package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +15 -0
- package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +22 -0
- package/api/@xmachines/play-vue/type-aliases/RenderErrorHandler.md +23 -0
- package/api/@xmachines/play-vue/variables/ActionProvider.md +64 -0
- package/api/@xmachines/play-vue/variables/JSONUIProvider.md +105 -0
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +2 -2
- package/api/@xmachines/play-vue/variables/Renderer.md +88 -0
- package/api/@xmachines/play-vue/variables/StateProvider.md +79 -0
- package/api/@xmachines/play-vue/variables/ValidationProvider.md +55 -0
- package/api/@xmachines/play-vue/variables/VisibilityProvider.md +40 -0
- package/api/@xmachines/play-vue-router/README.md +173 -486
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +56 -116
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +23 -271
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +26 -6
- package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +68 -0
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +22 -12
- package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +13 -0
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +20 -8
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +8 -8
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +8 -4
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +12 -6
- package/api/@xmachines/play-xstate/README.md +203 -354
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +195 -201
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +24 -20
- package/api/@xmachines/play-xstate/functions/composeGuards.md +8 -3
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +8 -3
- package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +43 -0
- package/api/@xmachines/play-xstate/functions/definePlayer.md +14 -63
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +3 -3
- package/api/@xmachines/play-xstate/functions/eventMatches.md +8 -3
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +3 -3
- package/api/@xmachines/play-xstate/functions/hasContext.md +8 -5
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +2 -2
- package/api/@xmachines/play-xstate/functions/negateGuard.md +8 -3
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +10 -14
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +22 -0
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +14 -16
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +15 -13
- package/api/@xmachines/play-xstate/interfaces/RouteObject.md +17 -0
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +8 -3
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +8 -6
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +9 -7
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +15 -18
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +15 -5
- package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +9 -0
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +22 -6
- package/api/@xmachines/shared/README.md +95 -295
- package/api/@xmachines/shared/vite-aliases/README.md +11 -0
- package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +38 -0
- package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +27 -0
- package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +35 -0
- package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +42 -0
- package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +33 -0
- package/api/@xmachines/shared/vitest/README.md +12 -0
- package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +42 -0
- package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +34 -0
- package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +16 -0
- package/api/README.md +6 -7
- package/api/llms.txt +72 -23
- package/contributing/README.md +10 -0
- package/contributing/architecture.md +601 -0
- package/contributing/configuration.md +368 -0
- package/contributing/deployment.md +333 -0
- package/contributing/development.md +503 -0
- package/contributing/testing.md +461 -0
- package/examples/@xmachines/play-dom-demo/README.md +181 -0
- package/examples/@xmachines/play-dom-demo/functions/createNavBar.md +24 -0
- package/examples/@xmachines/play-dom-demo/functions/initShell.md +25 -0
- package/examples/@xmachines/play-dom-demo/type-aliases/AuthCatalog.md +9 -0
- package/examples/@xmachines/play-dom-demo/variables/About.md +12 -0
- package/examples/@xmachines/play-dom-demo/variables/Contact.md +12 -0
- package/examples/@xmachines/play-dom-demo/variables/Dashboard.md +13 -0
- package/examples/@xmachines/play-dom-demo/variables/Home.md +13 -0
- package/examples/@xmachines/play-dom-demo/variables/Login.md +13 -0
- package/examples/@xmachines/play-dom-demo/variables/NavBarView.md +16 -0
- package/examples/@xmachines/play-dom-demo/variables/Navigation.md +13 -0
- package/examples/@xmachines/play-dom-demo/variables/Overview.md +13 -0
- package/examples/@xmachines/play-dom-demo/variables/Profile.md +13 -0
- package/examples/@xmachines/play-dom-demo/variables/Settings.md +13 -0
- package/examples/@xmachines/play-dom-demo/variables/Stats.md +13 -0
- package/examples/@xmachines/play-dom-demo/variables/authCatalog.md +172 -0
- package/examples/@xmachines/play-dom-router-demo/README.md +145 -0
- package/examples/@xmachines/play-react-demo/README.md +187 -0
- package/examples/@xmachines/play-react-demo/functions/App.md +13 -0
- package/examples/@xmachines/play-react-demo/functions/DebugPanel.md +20 -0
- package/examples/@xmachines/play-react-demo/functions/HeaderNav.md +20 -0
- package/examples/@xmachines/play-react-demo/functions/Shell.md +22 -0
- package/examples/@xmachines/play-react-demo/type-aliases/AuthCatalog.md +9 -0
- package/examples/@xmachines/play-react-demo/variables/About.md +14 -0
- package/examples/@xmachines/play-react-demo/variables/Contact.md +14 -0
- package/examples/@xmachines/play-react-demo/variables/Dashboard.md +15 -0
- package/examples/@xmachines/play-react-demo/variables/DebugPanel.md +16 -0
- package/examples/@xmachines/play-react-demo/variables/Home.md +14 -0
- package/examples/@xmachines/play-react-demo/variables/Login.md +16 -0
- package/examples/@xmachines/play-react-demo/variables/NavBar.md +16 -0
- package/examples/@xmachines/play-react-demo/variables/NavBarView.md +15 -0
- package/examples/@xmachines/play-react-demo/variables/Navigation.md +14 -0
- package/examples/@xmachines/play-react-demo/variables/Overview.md +14 -0
- package/examples/@xmachines/play-react-demo/variables/Profile.md +14 -0
- package/examples/@xmachines/play-react-demo/variables/Settings.md +14 -0
- package/examples/@xmachines/play-react-demo/variables/Shell.md +19 -0
- package/examples/@xmachines/play-react-demo/variables/Stats.md +14 -0
- package/examples/@xmachines/play-react-demo/variables/authCatalog.md +172 -0
- package/examples/@xmachines/play-react-router-demo/README.md +151 -0
- package/examples/@xmachines/play-solid-demo/README.md +187 -0
- package/examples/@xmachines/play-solid-demo/functions/App.md +13 -0
- package/examples/@xmachines/play-solid-demo/functions/DebugPanel.md +20 -0
- package/examples/@xmachines/play-solid-demo/functions/HeaderNav.md +20 -0
- package/examples/@xmachines/play-solid-demo/functions/Shell.md +22 -0
- package/examples/@xmachines/play-solid-demo/type-aliases/AuthCatalog.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/About.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Contact.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Dashboard.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/DebugPanel.md +17 -0
- package/examples/@xmachines/play-solid-demo/variables/Home.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Login.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/NavBar.md +11 -0
- package/examples/@xmachines/play-solid-demo/variables/NavBarView.md +15 -0
- package/examples/@xmachines/play-solid-demo/variables/Navigation.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Overview.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Profile.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Settings.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Shell.md +18 -0
- package/examples/@xmachines/play-solid-demo/variables/Stats.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/authCatalog.md +172 -0
- package/examples/@xmachines/play-solid-router-demo/README.md +137 -0
- package/examples/@xmachines/play-svelte-demo/README.md +143 -0
- package/examples/@xmachines/play-svelte-demo/type-aliases/App.md +9 -0
- package/examples/@xmachines/play-svelte-demo/type-aliases/AuthCatalog.md +9 -0
- package/examples/@xmachines/play-svelte-demo/variables/App.md +9 -0
- package/examples/@xmachines/play-svelte-demo/variables/authCatalog.md +172 -0
- package/examples/@xmachines/play-svelte-spa-router-demo/README.md +129 -0
- package/examples/@xmachines/play-sveltekit-router-demo/README.md +133 -0
- package/examples/@xmachines/play-tanstack-react-router-demo/README.md +156 -0
- package/examples/@xmachines/play-tanstack-solid-router-demo/README.md +139 -0
- package/examples/@xmachines/play-vue-demo/README.md +183 -0
- package/examples/@xmachines/play-vue-demo/type-aliases/AuthCatalog.md +9 -0
- package/examples/@xmachines/play-vue-demo/variables/App.md +9 -0
- package/examples/@xmachines/play-vue-demo/variables/authCatalog.md +172 -0
- package/examples/@xmachines/play-vue-router-demo/README.md +139 -0
- package/examples/README.md +78 -30
- package/examples/basic-state-machine.md +73 -31
- package/examples/form-validation.md +259 -118
- package/examples/multi-router-integration.md +312 -194
- package/examples/routing-patterns.md +228 -189
- package/examples/traffic-light.md +112 -65
- package/guides/README.md +7 -21
- package/guides/actor-model.md +180 -0
- package/guides/getting-started.md +627 -137
- package/guides/signals.md +166 -0
- package/guides/state-machines.md +284 -0
- package/package.json +21 -7
- package/rfc/broker.md +100 -0
- package/rfc/browser.md +44 -0
- package/rfc/cli.md +118 -0
- package/rfc/git.md +61 -0
- package/rfc/mcp.md +43 -0
- package/rfc/node.md +36 -0
- package/rfc/play.md +472 -0
- package/rfc/rest.md +102 -0
- package/rfc/run.md +159 -0
- package/rfc/streams.md +168 -0
- package/api/@xmachines/play-actor/interfaces/ViewMetadata.md +0 -17
- package/api/@xmachines/play-catalog/README.md +0 -331
- package/api/@xmachines/play-catalog/functions/defineCatalog.md +0 -98
- package/api/@xmachines/play-catalog/functions/defineComponents.md +0 -134
- package/api/@xmachines/play-catalog/type-aliases/Catalog.md +0 -48
- package/api/@xmachines/play-catalog/type-aliases/ComponentsFor.md +0 -20
- package/api/@xmachines/play-catalog/type-aliases/InferComponentProps.md +0 -65
- package/api/@xmachines/play-catalog/type-aliases/NoExtraKeys.md +0 -17
- package/api/@xmachines/play-react/interfaces/PlayRendererProps.md +0 -15
- package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +0 -19
- package/api/@xmachines/play-react-router-demo/README.md +0 -137
- package/api/@xmachines/play-router/classes/BaseRouteMap.md +0 -142
- package/api/@xmachines/play-router/functions/connectRouter.md +0 -67
- package/api/@xmachines/play-router/functions/crawlMachine.md +0 -92
- package/api/@xmachines/play-router/functions/createRouter.md +0 -76
- package/api/@xmachines/play-router/functions/extractRoute.md +0 -45
- package/api/@xmachines/play-router/interfaces/BaseRouteMapping.md +0 -27
- package/api/@xmachines/play-router/interfaces/BrowserHistory.md +0 -172
- package/api/@xmachines/play-router/interfaces/BrowserWindow.md +0 -69
- package/api/@xmachines/play-router/interfaces/ConnectRouterOptions.md +0 -13
- package/api/@xmachines/play-router/interfaces/RouteMap.md +0 -56
- package/api/@xmachines/play-router/interfaces/StateVisit.md +0 -15
- package/api/@xmachines/play-router/interfaces/VanillaRouter.md +0 -28
- package/api/@xmachines/play-router-demo/README.md +0 -137
- package/api/@xmachines/play-solid/interfaces/PlayRendererProps.md +0 -15
- package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +0 -19
- package/api/@xmachines/play-solid-router-demo/README.md +0 -127
- package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +0 -19
- package/api/@xmachines/play-tanstack-react-router/functions/extractParams.md +0 -38
- package/api/@xmachines/play-tanstack-react-router/functions/extractQueryParams.md +0 -33
- package/api/@xmachines/play-tanstack-react-router/variables/extractMachineRoutes.md +0 -64
- package/api/@xmachines/play-tanstack-react-router-demo/README.md +0 -126
- package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +0 -343
- package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +0 -19
- package/api/@xmachines/play-tanstack-solid-router-demo/README.md +0 -126
- package/api/@xmachines/play-vue/interfaces/PlayRendererProps.md +0 -14
- package/api/@xmachines/play-vue-router/classes/VueBaseRouteMap.md +0 -201
- package/api/@xmachines/play-vue-router-demo/README.md +0 -133
- package/api/@xmachines/play-xstate/functions/mergeViewProps.md +0 -26
- package/api/@xmachines/play-xstate/functions/stateMatches.md +0 -25
- package/api/@xmachines/play-xstate/functions/validateComponentBinding.md +0 -39
- package/api/@xmachines/play-xstate/functions/validateViewProps.md +0 -80
- package/api/@xmachines/play-xstate/interfaces/CatalogEntry.md +0 -16
- package/api/@xmachines/play-xstate/type-aliases/Catalog.md +0 -21
- package/api/@xmachines/play-xstate/type-aliases/ValidationResult.md +0 -17
- package/api/@xmachines/play-xstate/type-aliases/ViewMergeContext.md +0 -35
- package/api/@xmachines/shared/functions/defineXmVitestConfig.md +0 -29
- package/api/@xmachines/shared/functions/xmAliases.md +0 -24
- package/guides/installation.md +0 -323
|
@@ -1,277 +1,395 @@
|
|
|
1
|
-
# Multi-Router Integration
|
|
1
|
+
# Multi-Router Integration
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
How to integrate XMachines Play with the 8 router adapters shipped in this monorepo.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
XMachines provides router adapters for every major JavaScript framework. All adapters implement the same **Actor Authority** invariant — the state machine guards control navigation, and the router passively observes `actor.currentRoute`.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
2. **Vanilla Router** - JSX frameworks (Preact, Solid, Vue) with framework-agnostic router
|
|
11
|
-
3. **Pure Browser** - Manual integration for jQuery, Alpine, vanilla JS
|
|
9
|
+
There are two integration patterns:
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
| Pattern | Used by | Key API |
|
|
12
|
+
| --------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------- |
|
|
13
|
+
| **Provider pattern** | React (TanStack, React Router), SolidJS (TanStack, SolidJS Router), Vue Router | `<PlayRouterProvider actor router routeMap renderer={...} />` |
|
|
14
|
+
| **`connectRouter` pattern** | Vanilla DOM, SvelteKit, Svelte SPA Router | `connectRouter({ actor, routeMap })` |
|
|
14
15
|
|
|
15
|
-
##
|
|
16
|
+
## Pattern 1: Provider Pattern
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
Used by framework adapters that have a React/Solid/Vue provider context. The `PlayRouterProvider` owns the bridge lifecycle and calls a `renderer` prop with the current actor and router.
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
### React + TanStack Router (`@xmachines/play-tanstack-react-router`)
|
|
20
21
|
|
|
21
22
|
```typescript
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
import { useEffect, useMemo } from "react";
|
|
24
|
+
import { createRouter, createRootRoute } from "@tanstack/react-router";
|
|
25
|
+
import { PlayRouterProvider, createRouteMapFromTree } from "@xmachines/play-tanstack-react-router";
|
|
26
|
+
import { extractMachineRoutes } from "@xmachines/play-router";
|
|
27
|
+
import { definePlayer } from "@xmachines/play-xstate";
|
|
28
|
+
import { defineRegistry } from "@xmachines/play-react";
|
|
29
|
+
import { authMachine, authCatalog } from "@xmachines/play-actor-shared";
|
|
30
|
+
|
|
31
|
+
const createPlayer = definePlayer({ machine: authMachine });
|
|
32
|
+
|
|
33
|
+
const { registry } = defineRegistry(authCatalog, {
|
|
34
|
+
components: { /* ...your components */ },
|
|
35
|
+
actions: { login: async () => {}, logout: async () => {}, /* ... */ },
|
|
36
|
+
});
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
function createAppRuntime() {
|
|
39
|
+
const actor = createPlayer();
|
|
40
|
+
actor.start();
|
|
30
41
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
42
|
+
const routeTree = extractMachineRoutes(authMachine);
|
|
43
|
+
const routeMap = createRouteMapFromTree(routeTree);
|
|
44
|
+
const router = createRouter({ routeTree: createRootRoute(), defaultPreload: "intent" });
|
|
34
45
|
|
|
35
|
-
|
|
46
|
+
return { actor, routeMap, router };
|
|
47
|
+
}
|
|
36
48
|
|
|
37
|
-
|
|
49
|
+
export function App() {
|
|
50
|
+
const { actor, routeMap, router } = useMemo(createAppRuntime, []);
|
|
38
51
|
|
|
39
|
-
|
|
40
|
-
const routeTree = createPlayRouter({ machine });
|
|
41
|
-
const router = createRouter({ routeTree, history: createMemoryHistory() });
|
|
42
|
-
|
|
43
|
-
<PlayTanStackRouterProvider
|
|
44
|
-
actor={actor}
|
|
45
|
-
router={router}
|
|
46
|
-
routeMap={routeMap} // Explicit mapping
|
|
47
|
-
renderer={(actor) => <PlayRenderer actor={actor} components={components} />}
|
|
48
|
-
/>
|
|
49
|
-
```
|
|
52
|
+
useEffect(() => () => { actor.stop(); }, [actor]);
|
|
50
53
|
|
|
51
|
-
|
|
54
|
+
return (
|
|
55
|
+
<PlayRouterProvider
|
|
56
|
+
actor={actor}
|
|
57
|
+
router={router}
|
|
58
|
+
routeMap={routeMap}
|
|
59
|
+
renderer={(currentActor, currentRouter) => (
|
|
60
|
+
<Shell actor={currentActor} router={currentRouter} registry={registry} />
|
|
61
|
+
)}
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
```
|
|
52
66
|
|
|
53
|
-
|
|
67
|
+
### React + React Router v7 (`@xmachines/play-react-router`)
|
|
54
68
|
|
|
55
69
|
```typescript
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
</RouterProvider>
|
|
61
|
-
```
|
|
70
|
+
import { createBrowserRouter, RouterProvider } from "react-router";
|
|
71
|
+
import { PlayRouterProvider, createRouteMapFromTree } from "@xmachines/play-react-router";
|
|
72
|
+
import { extractMachineRoutes } from "@xmachines/play-router";
|
|
73
|
+
import { definePlayer } from "@xmachines/play-xstate";
|
|
62
74
|
|
|
63
|
-
|
|
75
|
+
const createPlayer = definePlayer({ machine: authMachine });
|
|
64
76
|
|
|
65
|
-
|
|
77
|
+
function createAppRuntime() {
|
|
78
|
+
const actor = createPlayer();
|
|
79
|
+
actor.start();
|
|
66
80
|
|
|
67
|
-
|
|
81
|
+
const routeTree = extractMachineRoutes(authMachine);
|
|
82
|
+
const routeMap = createRouteMapFromTree(routeTree);
|
|
68
83
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
import { definePlayer } from '@xmachines/play-xstate';
|
|
76
|
-
|
|
77
|
-
// 1. Create actor
|
|
78
|
-
const createPlayer = definePlayer({ machine, catalog });
|
|
79
|
-
const actor = createPlayer();
|
|
84
|
+
// React Router requires route elements upfront — use a catch-all
|
|
85
|
+
let router!: ReturnType<typeof createBrowserRouter>;
|
|
86
|
+
function RoutedShell() {
|
|
87
|
+
return <Shell actor={actor} router={router} registry={registry} />;
|
|
88
|
+
}
|
|
89
|
+
router = createBrowserRouter([{ path: "*", element: <RoutedShell /> }]);
|
|
80
90
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const router = createRouter({
|
|
84
|
-
routeTree,
|
|
85
|
-
history: createMemoryHistory()
|
|
86
|
-
});
|
|
91
|
+
return { actor, routeMap, router };
|
|
92
|
+
}
|
|
87
93
|
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<h1>Home</h1>
|
|
93
|
-
<button onClick={() => send({ type: 'play.route', to: '/about' })}>
|
|
94
|
-
Go to About
|
|
95
|
-
</button>
|
|
96
|
-
</div>
|
|
97
|
-
),
|
|
98
|
-
AboutView: ({ send }) => (
|
|
99
|
-
<div>
|
|
100
|
-
<h1>About</h1>
|
|
101
|
-
<button onClick={() => send({ type: 'play.route', to: '/' })}>
|
|
102
|
-
Go to Home
|
|
103
|
-
</button>
|
|
104
|
-
</div>
|
|
105
|
-
)
|
|
106
|
-
};
|
|
94
|
+
export default function App() {
|
|
95
|
+
const { actor, routeMap, router } = useMemo(createAppRuntime, []);
|
|
96
|
+
|
|
97
|
+
useEffect(() => () => { actor.stop(); }, [actor]);
|
|
107
98
|
|
|
108
|
-
// 4. Render with provider + renderer prop
|
|
109
|
-
function App() {
|
|
110
99
|
return (
|
|
111
|
-
<
|
|
100
|
+
<PlayRouterProvider
|
|
112
101
|
actor={actor}
|
|
113
102
|
router={router}
|
|
114
|
-
|
|
103
|
+
routeMap={routeMap}
|
|
104
|
+
renderer={(currentActor, currentRouter) => (
|
|
105
|
+
<RouterProvider router={currentRouter} />
|
|
106
|
+
)}
|
|
115
107
|
/>
|
|
116
108
|
);
|
|
117
109
|
}
|
|
118
|
-
|
|
119
|
-
const root = createRoot(document.getElementById('app')!);
|
|
120
|
-
root.render(<StrictMode><App /></StrictMode>);
|
|
121
110
|
```
|
|
122
111
|
|
|
123
|
-
###
|
|
112
|
+
### SolidJS + SolidJS Router (`@xmachines/play-solid-router`)
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
import { Router, Route } from "@solidjs/router";
|
|
116
|
+
import { onCleanup } from "solid-js";
|
|
117
|
+
import { PlayRouterProvider, createRouteMap } from "@xmachines/play-solid-router";
|
|
118
|
+
import { extractMachineRoutes, getRoutableRoutes } from "@xmachines/play-router";
|
|
119
|
+
import { definePlayer } from "@xmachines/play-xstate";
|
|
120
|
+
|
|
121
|
+
const createPlayer = definePlayer({ machine: authMachine });
|
|
122
|
+
const actor = createPlayer();
|
|
123
|
+
actor.start();
|
|
124
|
+
|
|
125
|
+
const routeTree = extractMachineRoutes(authMachine);
|
|
126
|
+
const routes = getRoutableRoutes(routeTree);
|
|
127
|
+
const routeMap = createRouteMap(authMachine);
|
|
128
|
+
|
|
129
|
+
// Layout rendered inside Router — has access to navigate/location/params hooks
|
|
130
|
+
const Layout = () => {
|
|
131
|
+
const navigate = useNavigate();
|
|
132
|
+
const location = useLocation();
|
|
133
|
+
const params = useParams();
|
|
124
134
|
|
|
125
|
-
|
|
126
|
-
- Type-safe routing with TanStack Router
|
|
127
|
-
- Browser history integration automatic
|
|
128
|
-
- Signal reactivity via `PlayRenderer`
|
|
135
|
+
onCleanup(() => { actor.stop(); });
|
|
129
136
|
|
|
130
|
-
|
|
137
|
+
return (
|
|
138
|
+
<PlayRouterProvider
|
|
139
|
+
actor={actor}
|
|
140
|
+
routeMap={routeMap}
|
|
141
|
+
router={{ navigate, location, params }}
|
|
142
|
+
renderer={(currentActor, currentRouter) => (
|
|
143
|
+
<Shell actor={currentActor} router={currentRouter} registry={registry} />
|
|
144
|
+
)}
|
|
145
|
+
/>
|
|
146
|
+
);
|
|
147
|
+
};
|
|
131
148
|
|
|
132
|
-
|
|
149
|
+
export default function App() {
|
|
150
|
+
return (
|
|
151
|
+
<Router root={Layout}>
|
|
152
|
+
{routes.map((route) => (
|
|
153
|
+
<Route path={route.fullPath} component={() => <div />} />
|
|
154
|
+
))}
|
|
155
|
+
</Router>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### SolidJS + TanStack Solid Router (`@xmachines/play-tanstack-solid-router`)
|
|
133
161
|
|
|
134
162
|
```typescript
|
|
135
|
-
import {
|
|
136
|
-
import {
|
|
163
|
+
import { createRouter, createRootRoute, createRoute, RouterProvider } from "@tanstack/solid-router";
|
|
164
|
+
import { onCleanup } from "solid-js";
|
|
165
|
+
import { PlayRouterProvider, createRouteMap } from "@xmachines/play-tanstack-solid-router";
|
|
166
|
+
import { extractMachineRoutes, getRoutableRoutes } from "@xmachines/play-router";
|
|
167
|
+
import { definePlayer } from "@xmachines/play-xstate";
|
|
137
168
|
|
|
138
|
-
|
|
139
|
-
const createPlayer = definePlayer({ machine, catalog });
|
|
169
|
+
const createPlayer = definePlayer({ machine: authMachine });
|
|
140
170
|
const actor = createPlayer();
|
|
171
|
+
actor.start();
|
|
141
172
|
|
|
142
|
-
|
|
143
|
-
const
|
|
173
|
+
const routeTree = extractMachineRoutes(authMachine);
|
|
174
|
+
const routes = getRoutableRoutes(routeTree);
|
|
175
|
+
const routeMap = createRouteMap(authMachine);
|
|
144
176
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
177
|
+
const rootRoute = createRootRoute({ component: Layout });
|
|
178
|
+
|
|
179
|
+
// Convert XMachines :param to TanStack $param format
|
|
180
|
+
const tanstackRoutes = routes.map((route) => {
|
|
181
|
+
const tanstackPath = route.fullPath.replace(/:(\w+)/g, "$$$1");
|
|
182
|
+
return createRoute({ getParentRoute: () => rootRoute, path: tanstackPath, component: () => <div /> });
|
|
151
183
|
});
|
|
152
184
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
render(h(components[view.component], viewProps), container);
|
|
185
|
+
const router = createRouter({ routeTree: rootRoute.addChildren(tanstackRoutes) });
|
|
186
|
+
|
|
187
|
+
function Layout() {
|
|
188
|
+
onCleanup(() => { actor.stop(); });
|
|
158
189
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
190
|
+
return (
|
|
191
|
+
<PlayRouterProvider
|
|
192
|
+
actor={actor}
|
|
193
|
+
router={router}
|
|
194
|
+
routeMap={routeMap}
|
|
195
|
+
renderer={(currentActor, currentRouter) => (
|
|
196
|
+
<Shell actor={currentActor} router={currentRouter} registry={registry} />
|
|
197
|
+
)}
|
|
198
|
+
/>
|
|
199
|
+
);
|
|
200
|
+
}
|
|
162
201
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
202
|
+
export default function App() {
|
|
203
|
+
return <RouterProvider router={router} />;
|
|
204
|
+
}
|
|
166
205
|
```
|
|
167
206
|
|
|
168
|
-
###
|
|
207
|
+
### Vue + Vue Router (`@xmachines/play-vue-router`)
|
|
208
|
+
|
|
209
|
+
```html
|
|
210
|
+
<!-- App.vue -->
|
|
211
|
+
<template>
|
|
212
|
+
<PlayRouterProvider
|
|
213
|
+
:actor="actor"
|
|
214
|
+
:route-map="routeMap"
|
|
215
|
+
:router="router"
|
|
216
|
+
:renderer="renderShell"
|
|
217
|
+
/>
|
|
218
|
+
</template>
|
|
219
|
+
|
|
220
|
+
<script setup lang="ts">
|
|
221
|
+
import { h, inject } from "vue";
|
|
222
|
+
import { createRouter, createWebHistory } from "vue-router";
|
|
223
|
+
import { PlayRouterProvider, createRouteMap } from "@xmachines/play-vue-router";
|
|
224
|
+
import { defineRegistry } from "@xmachines/play-vue";
|
|
225
|
+
import { authMachine, authCatalog } from "@xmachines/play-actor-shared";
|
|
226
|
+
|
|
227
|
+
const actor = inject("actor");
|
|
228
|
+
|
|
229
|
+
const routeMap = createRouteMap(authMachine);
|
|
230
|
+
|
|
231
|
+
const router = createRouter({
|
|
232
|
+
history: createWebHistory(),
|
|
233
|
+
routes: [
|
|
234
|
+
{
|
|
235
|
+
path: "/:pathMatch(.*)*",
|
|
236
|
+
name: "xmachines-play",
|
|
237
|
+
component: { render: () => h("div") },
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
const { registry } = defineRegistry(authCatalog, {
|
|
243
|
+
components: {/* ...your Vue SFC components */},
|
|
244
|
+
actions: { login: async () => {}, logout: async () => {} /* ... */ },
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
const renderShell = (currentActor, currentRouter) =>
|
|
248
|
+
h(Shell, { actor: currentActor, router: currentRouter, registry });
|
|
249
|
+
</script>
|
|
250
|
+
```
|
|
169
251
|
|
|
170
|
-
|
|
171
|
-
- Manual control over routing integration
|
|
172
|
-
- No React dependency
|
|
173
|
-
- Same actor/signal API
|
|
252
|
+
## Pattern 2: `connectRouter` Pattern
|
|
174
253
|
|
|
175
|
-
|
|
254
|
+
Used by vanilla DOM and Svelte adapters. Call `connectRouter` directly after creating the actor — no provider component needed.
|
|
176
255
|
|
|
177
|
-
|
|
256
|
+
### Vanilla DOM (`@xmachines/play-dom-router`)
|
|
178
257
|
|
|
179
258
|
```typescript
|
|
180
|
-
import {
|
|
181
|
-
|
|
182
|
-
|
|
259
|
+
import {
|
|
260
|
+
createBrowserHistory,
|
|
261
|
+
createRouter,
|
|
262
|
+
connectRouter,
|
|
263
|
+
createRouteMap,
|
|
264
|
+
} from "@xmachines/play-dom-router";
|
|
265
|
+
import { extractMachineRoutes } from "@xmachines/play-router";
|
|
266
|
+
import { definePlayer } from "@xmachines/play-xstate";
|
|
267
|
+
import { createPlayUI, defineRegistry } from "@xmachines/play-dom";
|
|
268
|
+
import { authMachine, authCatalog } from "@xmachines/play-actor-shared";
|
|
269
|
+
|
|
270
|
+
const createPlayer = definePlayer({ machine: authMachine });
|
|
183
271
|
const actor = createPlayer();
|
|
272
|
+
actor.start();
|
|
184
273
|
|
|
185
|
-
//
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
renderView();
|
|
191
|
-
},
|
|
192
|
-
});
|
|
274
|
+
// Router setup
|
|
275
|
+
const routeTree = extractMachineRoutes(authMachine);
|
|
276
|
+
const routeMap = createRouteMap(authMachine);
|
|
277
|
+
const history = createBrowserHistory({ window });
|
|
278
|
+
const router = createRouter({ routeTree, history });
|
|
193
279
|
|
|
194
|
-
//
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
// Vanilla JS rendering
|
|
199
|
-
if (view.component === "HomeView") {
|
|
200
|
-
document.getElementById("app").innerHTML = `
|
|
201
|
-
<h1>Home</h1>
|
|
202
|
-
<button onclick="navigateToAbout()">Go to About</button>
|
|
203
|
-
`;
|
|
204
|
-
} else if (view.component === "AboutView") {
|
|
205
|
-
document.getElementById("app").innerHTML = `
|
|
206
|
-
<h1>About</h1>
|
|
207
|
-
<button onclick="navigateToHome()">Go to Home</button>
|
|
208
|
-
`;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
280
|
+
// connectRouter handles bidirectional sync:
|
|
281
|
+
// - actor.currentRoute changes → browser URL updated
|
|
282
|
+
// - browser URL changes → play.route event sent to actor
|
|
283
|
+
const disconnect = connectRouter({ actor, router, routeMap });
|
|
211
284
|
|
|
212
|
-
//
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
285
|
+
// Renderer setup
|
|
286
|
+
const registryResult = defineRegistry(authCatalog, {
|
|
287
|
+
components: {/* ...your DOM components */},
|
|
288
|
+
});
|
|
289
|
+
const mount = createPlayUI(registryResult);
|
|
290
|
+
const disconnectRenderer = mount(actor, document.getElementById("app")!);
|
|
291
|
+
|
|
292
|
+
// Cleanup
|
|
293
|
+
window.addEventListener("beforeunload", () => {
|
|
294
|
+
disconnect();
|
|
295
|
+
router.destroy();
|
|
296
|
+
disconnectRenderer();
|
|
297
|
+
actor.stop();
|
|
216
298
|
});
|
|
299
|
+
```
|
|
217
300
|
|
|
218
|
-
|
|
219
|
-
function navigateToAbout() {
|
|
220
|
-
actor.send({ type: "play.route", to: "/about" });
|
|
221
|
-
}
|
|
301
|
+
### SvelteKit (`@xmachines/play-sveltekit-router`)
|
|
222
302
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}
|
|
303
|
+
```typescript
|
|
304
|
+
// lib/router.ts
|
|
305
|
+
import { defineRegistry } from "@xmachines/play-svelte";
|
|
306
|
+
import { authCatalog, authMachine } from "@xmachines/play-actor-shared";
|
|
307
|
+
import { definePlayer } from "@xmachines/play-xstate";
|
|
308
|
+
import { connectRouter, createRouteMap } from "@xmachines/play-sveltekit-router";
|
|
309
|
+
|
|
310
|
+
const createDemoPlayer = definePlayer({ machine: authMachine });
|
|
226
311
|
|
|
227
|
-
|
|
312
|
+
const { registry } = defineRegistry(authCatalog, {
|
|
313
|
+
components: {/* ...your Svelte components */},
|
|
314
|
+
actions: { login: async () => {}, logout: async () => {} /* ... */ },
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
export const actor = createDemoPlayer();
|
|
228
318
|
actor.start();
|
|
229
|
-
|
|
319
|
+
|
|
320
|
+
export const routeMap = createRouteMap(authMachine);
|
|
321
|
+
export const disconnectRouter = connectRouter({ actor, routeMap });
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
```html
|
|
325
|
+
<!-- App.svelte -->
|
|
326
|
+
<script lang="ts">
|
|
327
|
+
import Shell from "./Shell.svelte";
|
|
328
|
+
import { actor, registry } from "./lib/router.js";
|
|
329
|
+
</script>
|
|
330
|
+
|
|
331
|
+
<Shell {actor} {registry} />
|
|
230
332
|
```
|
|
231
333
|
|
|
232
|
-
###
|
|
334
|
+
### Svelte SPA Router (`@xmachines/play-svelte-spa-router`)
|
|
335
|
+
|
|
336
|
+
```typescript
|
|
337
|
+
// lib/router.ts — identical pattern to SvelteKit, different import
|
|
338
|
+
import { connectRouter, createRouteMap } from "@xmachines/play-svelte-spa-router";
|
|
339
|
+
import { definePlayer } from "@xmachines/play-xstate";
|
|
340
|
+
import { authMachine } from "@xmachines/play-actor-shared";
|
|
341
|
+
|
|
342
|
+
const createDemoPlayer = definePlayer({ machine: authMachine });
|
|
343
|
+
|
|
344
|
+
export const actor = createDemoPlayer();
|
|
345
|
+
actor.start();
|
|
346
|
+
|
|
347
|
+
export const routeMap = createRouteMap(authMachine);
|
|
348
|
+
export const disconnectRouter = connectRouter({ actor, routeMap });
|
|
349
|
+
```
|
|
233
350
|
|
|
234
|
-
|
|
235
|
-
- Maximum control and flexibility
|
|
236
|
-
- Works with jQuery, Alpine.js, HTMX, etc.
|
|
237
|
-
- Signals available via `actor.currentView.get()`
|
|
351
|
+
## Adapter Summary
|
|
238
352
|
|
|
239
|
-
|
|
353
|
+
| Package | Framework | Pattern | Key Import |
|
|
354
|
+
| --------------------------------------- | --------------------- | --------------- | ------------------------------------------------------------------------- |
|
|
355
|
+
| `@xmachines/play-dom-router` | Vanilla DOM | `connectRouter` | `connectRouter`, `createRouteMap`, `createBrowserHistory`, `createRouter` |
|
|
356
|
+
| `@xmachines/play-react-router` | React Router v7 | Provider | `PlayRouterProvider`, `createRouteMapFromTree` |
|
|
357
|
+
| `@xmachines/play-tanstack-react-router` | TanStack React Router | Provider | `PlayRouterProvider`, `createRouteMapFromTree` |
|
|
358
|
+
| `@xmachines/play-solid-router` | SolidJS Router | Provider | `PlayRouterProvider`, `createRouteMap` |
|
|
359
|
+
| `@xmachines/play-tanstack-solid-router` | TanStack Solid Router | Provider | `PlayRouterProvider`, `createRouteMap` |
|
|
360
|
+
| `@xmachines/play-vue-router` | Vue Router | Provider | `PlayRouterProvider`, `createRouteMap` |
|
|
361
|
+
| `@xmachines/play-sveltekit-router` | SvelteKit | `connectRouter` | `connectRouter`, `createRouteMap` |
|
|
362
|
+
| `@xmachines/play-svelte-spa-router` | Svelte SPA Router | `connectRouter` | `connectRouter`, `createRouteMap` |
|
|
240
363
|
|
|
241
|
-
|
|
364
|
+
## Renderer Packages
|
|
242
365
|
|
|
243
|
-
|
|
244
|
-
| ----------- | ---------------------------------- | ------------------------------------ | -------------------------- |
|
|
245
|
-
| Actor | `createPlayer()` | `createPlayer()` | `createPlayer()` |
|
|
246
|
-
| Router | `createRouter()` (TanStack) | `createPlayRouter()` | `connectRouter()` |
|
|
247
|
-
| Integration | `<PlayTanStackRouterProvider>` | Manual via `onNavigate` callback | Manual + `window.popstate` |
|
|
248
|
-
| Rendering | `<PlayRenderer>` via renderer prop | Framework-specific (h, Dynamic, etc) | `innerHTML` or DOM API |
|
|
249
|
-
| Events | Component `onClick` → `send()` | Same | Same |
|
|
250
|
-
| Signals | Observed by `useSignalEffect` | Manual `actor.currentView.get()` | Same |
|
|
366
|
+
Each framework also has a companion renderer package for the view layer:
|
|
251
367
|
|
|
252
|
-
|
|
368
|
+
| Package | Framework | Key API |
|
|
369
|
+
| ------------------------ | ----------- | -------------------------------------------------- |
|
|
370
|
+
| `@xmachines/play-dom` | Vanilla DOM | `createPlayUI`, `createRenderer`, `defineRegistry` |
|
|
371
|
+
| `@xmachines/play-react` | React | `PlayRenderer`, `defineRegistry` |
|
|
372
|
+
| `@xmachines/play-solid` | SolidJS | `PlayRenderer`, `defineRegistry` |
|
|
373
|
+
| `@xmachines/play-vue` | Vue 3 | `PlayRenderer`, `defineRegistry` |
|
|
374
|
+
| `@xmachines/play-svelte` | Svelte 5 | `PlayRenderer`, `defineRegistry` |
|
|
253
375
|
|
|
254
376
|
## Architectural Invariants
|
|
255
377
|
|
|
256
|
-
All
|
|
378
|
+
All adapters preserve the 5 architectural invariants:
|
|
257
379
|
|
|
258
|
-
1. **Actor Authority (INV-01):**
|
|
380
|
+
1. **Actor Authority (INV-01):** Machine guards validate all navigation
|
|
259
381
|
2. **Strict Separation (INV-02):** Business logic (machine) has zero framework imports
|
|
260
|
-
3. **
|
|
382
|
+
3. **State-Driven Reset (INV-03):** Browser back/forward sends `play.route` events to actor
|
|
261
383
|
4. **Passive Infrastructure (INV-04):** Router observes actor, never decides
|
|
262
|
-
5. **
|
|
384
|
+
5. **Signal-Only Reactivity (INV-05):** TC39 Signals work identically in all adapters
|
|
263
385
|
|
|
264
386
|
## Next Steps
|
|
265
387
|
|
|
266
|
-
- **[Routing Patterns](./routing-patterns.md)**
|
|
267
|
-
- **[
|
|
268
|
-
- **[React + TanStack Router Demo](../../packages/play-tanstack-react-router/examples/demo-app/)** - Production example using TanStack mode
|
|
269
|
-
- **[Vue Router Demo](../../packages/play-vue-router/examples/demo/)** - Vue Composition API integration
|
|
270
|
-
- **[SolidJS Router Demo](../../packages/play-solidjs-router/examples/demo/)** - Solid signals integration
|
|
388
|
+
- **[Routing Patterns](./routing-patterns.md)** — `meta.route`, `play.route`, `always` guards
|
|
389
|
+
- **[Examples Index](./README.md)** — Complete catalog of runnable demos
|
|
271
390
|
|
|
272
391
|
## Learn More
|
|
273
392
|
|
|
274
|
-
- [
|
|
275
|
-
- [play-
|
|
276
|
-
- [play-router
|
|
277
|
-
- [RFC Play v1](https://gitlab.com/xmachin-es/rfc/-/blob/main/src/play-v1.md) - Complete specification
|
|
393
|
+
- [Play RFC](../rfc/play.md) — Complete architectural specification
|
|
394
|
+
- [play-router](../api/@xmachines/play-router/README.md) — Route extraction and route maps
|
|
395
|
+
- [play-dom-router](../api/@xmachines/play-dom-router/README.md) — Vanilla DOM router adapter
|