@xmachines/docs 1.0.0-beta.45 → 1.0.0-beta.48
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 +1 -1
- 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/examples/@xmachines/play-dom-demo/README.md +4 -4
- 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 +3 -3
- package/examples/@xmachines/play-react-demo/README.md +2 -2
- 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 +2 -2
- package/examples/@xmachines/play-solid-demo/README.md +2 -2
- 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-solid-router-demo/README.md +1 -1
- package/examples/@xmachines/play-svelte-demo/README.md +2 -2
- 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 +3 -3
- package/examples/@xmachines/play-sveltekit-router-demo/README.md +3 -3
- package/examples/@xmachines/play-tanstack-react-router-demo/README.md +1 -1
- package/examples/@xmachines/play-tanstack-solid-router-demo/README.md +1 -1
- package/examples/@xmachines/play-vue-demo/README.md +2 -2
- 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/@xmachines/play-vue-router-demo/README.md +1 -1
- package/examples/README.md +24 -25
- package/examples/form-validation.md +2 -2
- package/guides/README.md +7 -7
- package/guides/actor-model.md +18 -18
- package/guides/architecture.md +500 -0
- package/guides/configuration.md +556 -0
- package/guides/deployment.md +336 -0
- package/guides/development.md +617 -0
- package/guides/getting-started.md +351 -142
- package/guides/signals.md +19 -19
- package/guides/state-machines.md +16 -16
- package/guides/testing.md +460 -0
- package/package.json +5 -5
- package/guides/installation.md +0 -257
|
@@ -1,258 +1,283 @@
|
|
|
1
1
|
[API](../../README.md) / @xmachines/play-tanstack-solid-router
|
|
2
2
|
|
|
3
|
+
<!-- generated-by: gsd-doc-writer -->
|
|
4
|
+
|
|
3
5
|
# @xmachines/play-tanstack-solid-router
|
|
4
6
|
|
|
5
7
|
**TanStack Solid Router adapter for XMachines Universal Player Architecture**
|
|
6
8
|
|
|
7
9
|
Signals-native integration with TanStack Solid Router enabling logic-driven navigation through Solid.js reactivity.
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
`@xmachines/play-tanstack-solid-router` provides seamless integration between TanStack Solid Router and XMachines state machines. Built on Solid's reactive primitives, it implements the `RouterBridgeBase` pattern for bidirectional synchronization while remaining framework-swappable.
|
|
12
|
-
|
|
13
|
-
Per [Play RFC](../../../rfc/play.md), this package implements:
|
|
11
|
+
Part of the [xmachines-js](../../README.md) monorepo.
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
- **Passive Infrastructure (INV-04):** Router observes `actor.currentRoute` signal
|
|
17
|
-
- **Signal-Only Reactivity (INV-05):** `createEffect` synchronizes URL with actor state
|
|
18
|
-
|
|
19
|
-
**Key Benefits:**
|
|
13
|
+
## Overview
|
|
20
14
|
|
|
21
|
-
-
|
|
22
|
-
- **Bridge-first:** Extends shared `RouterBridgeBase` policy used by other adapters
|
|
23
|
-
- **Automatic tracking:** `createEffect` handles dependency tracking (no manual Watcher setup needed for the bridge)
|
|
24
|
-
- **Logic-driven navigation:** Business logic in state machines, not components
|
|
25
|
-
- **Type-safe parameters:** Route params flow through state machine context
|
|
15
|
+
[`@xmachines/play-tanstack-solid-router`](README.md) connects a Play actor to TanStack Solid Router through `SolidRouterBridge`.
|
|
26
16
|
|
|
27
|
-
|
|
17
|
+
The bridge extends `RouterBridgeBase` from [`@xmachines/play-router`](../play-router/README.md), keeping adapter behavior consistent across frameworks:
|
|
28
18
|
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
19
|
+
- Actor route signal (`actor.currentRoute`) drives router navigation.
|
|
20
|
+
- Router history events send `play.route` intents back to the actor.
|
|
21
|
+
- Guarded state transitions remain actor-owned (Actor Authority).
|
|
22
|
+
- Circular update prevention built into `RouterBridgeBase`.
|
|
32
23
|
|
|
33
24
|
## Installation
|
|
34
25
|
|
|
35
26
|
```bash
|
|
36
|
-
npm install @tanstack/solid-router
|
|
27
|
+
npm install @tanstack/solid-router solid-js
|
|
28
|
+
npm install @xmachines/play-tanstack-solid-router @xmachines/play-router
|
|
37
29
|
```
|
|
38
30
|
|
|
39
31
|
**Peer dependencies:**
|
|
40
32
|
|
|
41
|
-
- `@tanstack/solid-router`
|
|
42
|
-
- `solid-js`
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
33
|
+
- `@tanstack/solid-router` `^1.168.7`
|
|
34
|
+
- `solid-js` `^1.8.0`
|
|
35
|
+
- `xstate` `^5.30.0`
|
|
36
|
+
|
|
37
|
+
## Current Exports
|
|
38
|
+
|
|
39
|
+
- `SolidRouterBridge` — primary adapter class
|
|
40
|
+
- `PlayRouterProvider` — Solid component wrapper for bridge lifecycle
|
|
41
|
+
- `PlayRouterProviderProps`, `RoutableActor`, `TanStackRouterInstance` (types)
|
|
42
|
+
- `RouteMap`, `createRouteMap`, `RouteMapping`, `RouteMapOptions` (re-exported from `@xmachines/play-router`)
|
|
43
|
+
- `TanStackRouterLike` (type)
|
|
44
|
+
- `RouterBridge`, `PlayRouteEvent` (types)
|
|
45
|
+
|
|
46
|
+
## URLPattern Support
|
|
47
|
+
|
|
48
|
+
This package uses the [URLPattern API](https://developer.mozilla.org/en-US/docs/Web/API/URLPattern) for route pattern matching via [`@xmachines/play-router`](../play-router/README.md).
|
|
49
|
+
|
|
50
|
+
URLPattern is available natively on Node.js 24+ and modern browsers (Chrome 95+, Firefox 117+, Safari 16.4+). On older environments, load a polyfill **before** importing this package — see [`@xmachines/play-router`](../play-router/README.md) for details.
|
|
47
51
|
|
|
48
52
|
## Quick Start
|
|
49
53
|
|
|
50
54
|
```tsx
|
|
51
|
-
import {
|
|
52
|
-
import { PlayTanStackRouterProvider, createRouteMap } from "@xmachines/play-tanstack-solid-router";
|
|
53
|
-
import { PlayRenderer } from "@xmachines/play-solid";
|
|
55
|
+
import { createRouter } from "@tanstack/solid-router";
|
|
54
56
|
import { definePlayer } from "@xmachines/play-xstate";
|
|
55
|
-
import {
|
|
56
|
-
|
|
57
|
-
function App() {
|
|
58
|
-
// 1. Create player with state machine
|
|
59
|
-
const createPlayer = definePlayer({
|
|
60
|
-
machine: authMachine,
|
|
61
|
-
catalog: componentCatalog,
|
|
62
|
-
});
|
|
63
|
-
const actor = createPlayer();
|
|
64
|
-
actor.start();
|
|
65
|
-
|
|
66
|
-
// 2. Create TanStack router instance
|
|
67
|
-
const router = createRouter({ routeTree: routerRouteTree });
|
|
68
|
-
|
|
69
|
-
// 3. Create route mapping from machine routes
|
|
70
|
-
const routeMap = createRouteMap(authMachine);
|
|
71
|
-
|
|
72
|
-
return (
|
|
73
|
-
// 4. Wrap with provider to sync actor and router
|
|
74
|
-
<PlayTanStackRouterProvider
|
|
75
|
-
actor={actor}
|
|
76
|
-
router={router}
|
|
77
|
-
routeMap={routeMap}
|
|
78
|
-
renderer={(currentActor, currentRouter) => (
|
|
79
|
-
<Router router={currentRouter}>
|
|
80
|
-
<PlayRenderer actor={currentActor} components={components} />
|
|
81
|
-
</Router>
|
|
82
|
-
)}
|
|
83
|
-
/>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
```
|
|
57
|
+
import { extractMachineRoutes } from "@xmachines/play-router";
|
|
58
|
+
import { SolidRouterBridge, createRouteMap } from "@xmachines/play-tanstack-solid-router";
|
|
87
59
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
### `SolidRouterBridge`
|
|
60
|
+
const routeMap = createRouteMap(machine);
|
|
61
|
+
const router = createRouter({ routeTree: tanstackRouteTree });
|
|
91
62
|
|
|
92
|
-
|
|
63
|
+
const actor = definePlayer({ machine })();
|
|
64
|
+
actor.start();
|
|
93
65
|
|
|
94
|
-
|
|
66
|
+
const bridge = new SolidRouterBridge(router, actor, routeMap);
|
|
67
|
+
bridge.connect();
|
|
95
68
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
constructor(router: Router, actor: AbstractActor<any>, routeMap: RouteMap);
|
|
99
|
-
dispose(): void;
|
|
100
|
-
}
|
|
69
|
+
// later
|
|
70
|
+
bridge.disconnect();
|
|
101
71
|
```
|
|
102
72
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
- `router` - TanStack Solid Router instance
|
|
106
|
-
- `actor` - XMachines actor instance
|
|
107
|
-
- `routeMap` - Bidirectional state ID ↔ path mapping
|
|
73
|
+
### Solid convenience wrapper
|
|
108
74
|
|
|
109
|
-
|
|
75
|
+
Use `PlayRouterProvider` when you want bridge lifecycle wiring managed by a component:
|
|
110
76
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
77
|
+
```tsx
|
|
78
|
+
import { PlayRouterProvider } from "@xmachines/play-tanstack-solid-router";
|
|
79
|
+
import { RouterProvider } from "@tanstack/solid-router";
|
|
80
|
+
|
|
81
|
+
<PlayRouterProvider
|
|
82
|
+
actor={actor}
|
|
83
|
+
router={router}
|
|
84
|
+
routeMap={routeMap}
|
|
85
|
+
renderer={(currentActor, currentRouter) => (
|
|
86
|
+
<RouterProvider router={currentRouter}>{/* your app here */}</RouterProvider>
|
|
87
|
+
)}
|
|
88
|
+
/>;
|
|
89
|
+
```
|
|
116
90
|
|
|
117
|
-
|
|
118
|
-
- Updates TanStack Router via `router.navigate({ to: path })` when actor state changes
|
|
119
|
-
- Uses `router.history.subscribe` to watch history navigation events (covers PUSH, POP, BACK, FORWARD — works without `<RouterProvider>` mounted)
|
|
120
|
-
- Sends `play.route` events to actor when user navigates
|
|
91
|
+
## API
|
|
121
92
|
|
|
122
|
-
### `
|
|
93
|
+
### `SolidRouterBridge`
|
|
123
94
|
|
|
124
|
-
|
|
95
|
+
Primary adapter class extending `RouterBridgeBase`.
|
|
125
96
|
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
97
|
+
```ts
|
|
98
|
+
class SolidRouterBridge {
|
|
99
|
+
constructor(
|
|
100
|
+
router: TanStackRouterLike,
|
|
101
|
+
actor: AbstractActor<AnyActorLogic> & Routable,
|
|
102
|
+
routeMap: RouteMap,
|
|
103
|
+
);
|
|
104
|
+
connect(): void;
|
|
105
|
+
disconnect(): void;
|
|
106
|
+
dispose(): void; // alias for disconnect()
|
|
132
107
|
}
|
|
133
108
|
```
|
|
134
109
|
|
|
135
|
-
**
|
|
110
|
+
**Behavior:**
|
|
136
111
|
|
|
137
|
-
- `
|
|
138
|
-
- `
|
|
139
|
-
-
|
|
140
|
-
- `
|
|
112
|
+
- `connect()` — subscribes to `router.history`, performs initial deep-link sync from `router.history.location`, and starts watching `actor.currentRoute` for state-driven navigation.
|
|
113
|
+
- `disconnect()` — unsubscribes from history and stops all sync.
|
|
114
|
+
- Navigates via `router.navigate({ to: path })`.
|
|
115
|
+
- Subscribes via `router.history.subscribe` — covers PUSH, POP, BACK, FORWARD, REPLACE, and GO, and works without `<RouterProvider>` mounted.
|
|
141
116
|
|
|
142
|
-
|
|
117
|
+
### `PlayRouterProvider`
|
|
143
118
|
|
|
144
|
-
|
|
145
|
-
2. Calls `bridge.connect()`
|
|
146
|
-
3. Renders the content returned by the `renderer` function
|
|
147
|
-
4. Calls `bridge.disconnect()` when the component unmounts via `onCleanup`
|
|
119
|
+
Solid component that instantiates, connects, and cleans up a `SolidRouterBridge` automatically.
|
|
148
120
|
|
|
149
|
-
|
|
121
|
+
```ts
|
|
122
|
+
interface PlayRouterProviderProps<TActor extends RoutableActor = RoutableActor> {
|
|
123
|
+
/** The actor to sync with TanStack Solid Router. */
|
|
124
|
+
actor: TActor;
|
|
125
|
+
/** The TanStack Router instance returned by `createRouter`. */
|
|
126
|
+
router: TanStackRouterInstance;
|
|
127
|
+
/** Bidirectional route map for state ID ↔ URL path lookups. */
|
|
128
|
+
routeMap: RouteMap;
|
|
129
|
+
/** Renderer callback receives the same concrete actor type that was passed in. */
|
|
130
|
+
renderer: (actor: TActor, router: TanStackRouterInstance) => JSX.Element;
|
|
131
|
+
}
|
|
132
|
+
```
|
|
150
133
|
|
|
151
|
-
|
|
134
|
+
The bridge is created synchronously at component evaluation time (Solid's execution model) and torn down via `onCleanup` when the component is disposed.
|
|
152
135
|
|
|
153
|
-
|
|
136
|
+
### `RouteMap` and `createRouteMap`
|
|
154
137
|
|
|
155
|
-
|
|
156
|
-
function createRouteMap(machine: AnyStateMachine): RouteMap;
|
|
157
|
-
```
|
|
138
|
+
Map state IDs to URL paths and resolve URLs back to state IDs.
|
|
158
139
|
|
|
159
|
-
|
|
140
|
+
```ts
|
|
141
|
+
const routeMap = new RouteMap([
|
|
142
|
+
{ stateId: "home", path: "/" },
|
|
143
|
+
{ stateId: "profile", path: "/profile/:userId" },
|
|
144
|
+
{ stateId: "settings", path: "/settings/:section?" },
|
|
145
|
+
]);
|
|
160
146
|
|
|
161
|
-
|
|
162
|
-
|
|
147
|
+
routeMap.getStateIdByPath("/profile/123"); // "profile"
|
|
148
|
+
routeMap.getPathByStateId("home"); // "/"
|
|
149
|
+
routeMap.getStateIdByPath("/unknown"); // null
|
|
163
150
|
|
|
151
|
+
// Or build from a machine directly:
|
|
152
|
+
import { createRouteMap } from "@xmachines/play-tanstack-solid-router";
|
|
164
153
|
const routeMap = createRouteMap(machine);
|
|
165
154
|
```
|
|
166
155
|
|
|
156
|
+
`getStateIdByPath` returns `null` (not `undefined`) for unmatched paths.
|
|
157
|
+
|
|
167
158
|
## Usage Patterns
|
|
168
159
|
|
|
169
160
|
### Dynamic Routes with Parameters
|
|
170
161
|
|
|
171
|
-
|
|
162
|
+
```ts
|
|
163
|
+
const routeMap = new RouteMap([
|
|
164
|
+
{ stateId: "post", path: "/users/:userId/posts/:postId" },
|
|
165
|
+
{ stateId: "settings", path: "/settings/:section?" },
|
|
166
|
+
]);
|
|
167
|
+
|
|
168
|
+
// Params are extracted and forwarded in the play.route event:
|
|
169
|
+
// { type: "play.route", to: "#post", params: { userId: "123", postId: "456" }, query: {} }
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Protected Routes and Guards
|
|
173
|
+
|
|
174
|
+
Auth guards live entirely inside the state machine, preventing flashes of unauthorized content:
|
|
172
175
|
|
|
173
|
-
```
|
|
174
|
-
// Machine configuration
|
|
176
|
+
```ts
|
|
175
177
|
const machineConfig = {
|
|
176
178
|
states: {
|
|
177
|
-
|
|
178
|
-
meta: {
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
dashboard: {
|
|
180
|
+
meta: { route: "/dashboard" },
|
|
181
|
+
always: {
|
|
182
|
+
guard: ({ context }) => !context.isAuthenticated,
|
|
183
|
+
target: "login",
|
|
181
184
|
},
|
|
182
185
|
},
|
|
183
186
|
},
|
|
184
187
|
};
|
|
185
|
-
|
|
186
|
-
// Route mapping will natively support URLPattern parameters
|
|
187
|
-
routeMap.getStateIdByPath("/profile/123"); // → '#profile'
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### Protected Routes and Guards
|
|
191
|
-
|
|
192
|
-
With XMachines, auth guards are handled entirely inside the state machine, preventing flashes of unauthorized content.
|
|
193
|
-
|
|
194
|
-
```typescript
|
|
195
|
-
// Machine side
|
|
196
|
-
dashboard: {
|
|
197
|
-
meta: { route: "/dashboard", view: { component: "Dashboard" } },
|
|
198
|
-
always: {
|
|
199
|
-
guard: ({ context }) => !context.isAuthenticated,
|
|
200
|
-
target: "login"
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
188
|
```
|
|
204
189
|
|
|
205
|
-
When a user navigates to `/dashboard
|
|
190
|
+
When a user navigates to `/dashboard` while unauthenticated:
|
|
206
191
|
|
|
207
|
-
1. TanStack Router updates location
|
|
208
|
-
2. Bridge intercepts and sends `play.route`
|
|
209
|
-
3. Actor evaluates guard
|
|
210
|
-
4. Bridge observes new actor
|
|
211
|
-
5. Bridge
|
|
192
|
+
1. TanStack Router updates location.
|
|
193
|
+
2. Bridge intercepts and sends `play.route` to the actor.
|
|
194
|
+
3. Actor evaluates the guard — denies transition, moves to `login` instead.
|
|
195
|
+
4. Bridge observes new actor route (`/login`).
|
|
196
|
+
5. Bridge calls `router.navigate({ to: "/login" })`.
|
|
212
197
|
|
|
213
|
-
|
|
198
|
+
### Full App Example
|
|
214
199
|
|
|
215
|
-
|
|
200
|
+
```tsx
|
|
201
|
+
import { createRouter, RouterProvider, createRootRoute, createRoute } from "@tanstack/solid-router";
|
|
202
|
+
import { onCleanup } from "solid-js";
|
|
203
|
+
import { PlayRouterProvider, createRouteMap } from "@xmachines/play-tanstack-solid-router";
|
|
204
|
+
import { definePlayer } from "@xmachines/play-xstate";
|
|
205
|
+
import { extractMachineRoutes, getRoutableRoutes } from "@xmachines/play-router";
|
|
206
|
+
|
|
207
|
+
const createPlayer = definePlayer({ machine: authMachine });
|
|
208
|
+
const actor = createPlayer();
|
|
209
|
+
actor.start();
|
|
210
|
+
|
|
211
|
+
const routeMap = createRouteMap(authMachine);
|
|
212
|
+
const routeTree = extractMachineRoutes(authMachine);
|
|
213
|
+
const routes = getRoutableRoutes(routeTree);
|
|
214
|
+
|
|
215
|
+
const rootRoute = createRootRoute({
|
|
216
|
+
component: () => {
|
|
217
|
+
onCleanup(() => actor.stop());
|
|
218
|
+
return (
|
|
219
|
+
<PlayRouterProvider
|
|
220
|
+
actor={actor}
|
|
221
|
+
router={router}
|
|
222
|
+
routeMap={routeMap}
|
|
223
|
+
renderer={(currentActor, currentRouter) => (
|
|
224
|
+
/* your shell/renderer here */
|
|
225
|
+
<div />
|
|
226
|
+
)}
|
|
227
|
+
/>
|
|
228
|
+
);
|
|
229
|
+
},
|
|
230
|
+
});
|
|
216
231
|
|
|
217
|
-
|
|
218
|
-
|
|
232
|
+
const tanstackRoutes = routes.map((route) =>
|
|
233
|
+
createRoute({
|
|
234
|
+
getParentRoute: () => rootRoute,
|
|
235
|
+
path: route.fullPath.replace(/:(\w+)/g, "$$$1"),
|
|
236
|
+
component: () => null,
|
|
237
|
+
}),
|
|
238
|
+
);
|
|
219
239
|
|
|
220
|
-
|
|
240
|
+
export const router = createRouter({ routeTree: rootRoute.addChildren(tanstackRoutes) });
|
|
221
241
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
| **State Source** | Uses Solid hooks (`useLocation`) | Subscribes to `router` directly |
|
|
227
|
-
| **Reacting** | `createEffect` on location | `router.history.subscribe` callback |
|
|
242
|
+
export default function App() {
|
|
243
|
+
return <RouterProvider router={router} />;
|
|
244
|
+
}
|
|
245
|
+
```
|
|
228
246
|
|
|
229
247
|
## Architecture
|
|
230
248
|
|
|
231
|
-
|
|
249
|
+
Bridge-first data flow:
|
|
232
250
|
|
|
233
|
-
|
|
251
|
+
1. `RouterBridgeBase.connect()` performs initial actor/router synchronization — both pathname and query string from `router.history.location` are forwarded to the actor on first connect.
|
|
252
|
+
2. Actor route updates (`actor.currentRoute` signal) call TanStack navigation (`router.navigate({ to })`).
|
|
253
|
+
3. TanStack history updates are subscribed and translated to `play.route` events sent to the actor.
|
|
254
|
+
4. Actor guards accept or reject transitions; infrastructure reflects resulting state.
|
|
234
255
|
|
|
235
|
-
|
|
256
|
+
This keeps routing infrastructure passive while preserving business-logic control in the state machine.
|
|
236
257
|
|
|
237
|
-
|
|
258
|
+
## Testing
|
|
238
259
|
|
|
239
|
-
|
|
260
|
+
Run tests for this package in isolation:
|
|
240
261
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
262
|
+
```bash
|
|
263
|
+
npm test -w packages/play-tanstack-solid-router
|
|
264
|
+
```
|
|
244
265
|
|
|
245
|
-
|
|
266
|
+
Or from the package directory:
|
|
246
267
|
|
|
247
|
-
|
|
268
|
+
```bash
|
|
269
|
+
npm test
|
|
270
|
+
```
|
|
248
271
|
|
|
249
|
-
|
|
272
|
+
Coverage thresholds: lines 80%, functions 80%, branches 70%, statements 80%.
|
|
250
273
|
|
|
251
274
|
## Related Packages
|
|
252
275
|
|
|
253
|
-
-
|
|
254
|
-
-
|
|
255
|
-
-
|
|
276
|
+
- [@xmachines/play-router](../play-router/README.md) — core router primitives and `RouterBridgeBase`
|
|
277
|
+
- [@xmachines/play-tanstack-react-router](../play-tanstack-react-router/README.md) — TanStack Router (React) equivalent
|
|
278
|
+
- [@xmachines/play-solid](../play-solid/README.md) — SolidJS renderer
|
|
279
|
+
- [@xmachines/play-solid-router](../play-solid-router/README.md) — native `@solidjs/router` adapter
|
|
280
|
+
- [@xmachines/play-xstate](../play-xstate/README.md) — XState v5 player factory
|
|
256
281
|
|
|
257
282
|
## Learn More
|
|
258
283
|
|
|
@@ -261,10 +286,7 @@ URLPattern is available natively on Node.js 24+ and modern browsers (Chrome 95+,
|
|
|
261
286
|
|
|
262
287
|
## License
|
|
263
288
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
This work is licensed under the terms of the MIT license.
|
|
267
|
-
For a copy, see <https://opensource.org/licenses/MIT>.
|
|
289
|
+
MIT — see [LICENSE](LICENSE).
|
|
268
290
|
|
|
269
291
|
## Classes
|
|
270
292
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: RouteMap
|
|
4
4
|
|
|
5
|
-
Defined in: [play-router/src/base-route-map.ts:100](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [play-router/src/base-route-map.ts:100](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-router/src/base-route-map.ts#L100)
|
|
6
6
|
|
|
7
7
|
Shared bidirectional route map base class.
|
|
8
8
|
|
|
@@ -50,7 +50,7 @@ map.getPathByStateId("missing"); // null
|
|
|
50
50
|
new RouteMap(mappings, options?): RouteMap;
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
Defined in: [play-router/src/base-route-map.ts:125](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
53
|
+
Defined in: [play-router/src/base-route-map.ts:125](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-router/src/base-route-map.ts#L125)
|
|
54
54
|
|
|
55
55
|
Build a route map from an array of state ID ↔ path mappings.
|
|
56
56
|
|
|
@@ -78,7 +78,7 @@ buckets for efficient candidate selection.
|
|
|
78
78
|
getPathByStateId(stateId): string | null;
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
Defined in: [play-router/src/base-route-map.ts:209](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
81
|
+
Defined in: [play-router/src/base-route-map.ts:209](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-router/src/base-route-map.ts#L209)
|
|
82
82
|
|
|
83
83
|
Look up the path pattern registered for a state ID.
|
|
84
84
|
|
|
@@ -109,7 +109,7 @@ map.getPathByStateId("missing"); // null
|
|
|
109
109
|
getStateIdByPath(path): string | null;
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
Defined in: [play-router/src/base-route-map.ts:174](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
112
|
+
Defined in: [play-router/src/base-route-map.ts:174](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-router/src/base-route-map.ts#L174)
|
|
113
113
|
|
|
114
114
|
Resolve a URL path to its mapped state ID.
|
|
115
115
|
|