@xmachines/docs 3.0.0 → 4.0.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 +8 -16
- package/api/@xmachines/play/README.md +11 -100
- package/api/@xmachines/play/errors/README.md +8 -0
- package/api/@xmachines/play/{classes → errors/classes}/NonNullableError.md +6 -6
- package/api/@xmachines/play/{classes → errors/classes}/PlayError.md +35 -10
- package/api/@xmachines/play/index/README.md +75 -0
- package/api/@xmachines/play/{functions → index/functions}/asCleanup.md +2 -2
- package/api/@xmachines/play/{functions → index/functions}/assertNonNullable.md +2 -2
- package/api/@xmachines/{play-actor → play/index}/functions/shallowEqualExcept.md +3 -3
- package/api/@xmachines/play/{type-aliases → index/type-aliases}/Cleanup.md +3 -3
- package/api/@xmachines/play/{type-aliases → index/type-aliases}/DisposeKey.md +2 -2
- package/api/@xmachines/play/{type-aliases → index/type-aliases}/PlayEvent.md +4 -4
- package/api/@xmachines/play/{variables → index/variables}/DISPOSE.md +2 -2
- package/api/@xmachines/play-actor/README.md +78 -229
- package/api/@xmachines/play-actor/interfaces/ActorEvent.md +18 -0
- package/api/@xmachines/play-actor/interfaces/PlayActor.md +73 -0
- package/api/@xmachines/play-dom/README.md +28 -40
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +12 -11
- package/api/@xmachines/play-dom/functions/asCleanup.md +78 -0
- package/api/@xmachines/play-dom/functions/createPlayUI.md +4 -4
- package/api/@xmachines/play-dom/functions/createRenderer.md +1 -1
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +3 -3
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +3 -3
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +6 -6
- package/api/@xmachines/play-dom/type-aliases/Cleanup.md +2 -2
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +29 -12
- package/api/@xmachines/play-dom-router/README.md +70 -70
- package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +22 -21
- package/api/@xmachines/{play-vue-router → play-dom-router}/classes/RouteMap.md +12 -6
- package/api/@xmachines/play-dom-router/functions/asCleanup.md +78 -0
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +3 -8
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +9 -3
- package/api/@xmachines/play-dom-router/functions/createRouter.md +8 -14
- package/api/@xmachines/play-dom-router/interfaces/BasePathOptions.md +5 -5
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +70 -26
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +8 -8
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +24 -21
- package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +4 -4
- 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/RouterConnection.md +8 -8
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +36 -23
- package/api/@xmachines/play-dom-router/type-aliases/Cleanup.md +2 -2
- package/api/@xmachines/play-dom-router/variables/DISPOSE.md +2 -2
- package/api/@xmachines/play-react/README.md +17 -39
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +14 -10
- 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 +11 -11
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +6 -6
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +4 -4
- package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +13 -13
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +11 -3
- 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/variables/schema.md +52 -0
- package/api/@xmachines/play-react-router/README.md +22 -50
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +17 -16
- package/api/@xmachines/play-react-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +11 -8
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +16 -9
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +10 -10
- package/api/@xmachines/play-react-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +4 -4
- 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-react-router/type-aliases/PlayRouterBridgeConstructor.md +17 -7
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-router/README.md +104 -196
- package/api/@xmachines/play-router/errors/README.md +15 -0
- package/api/@xmachines/play-router/errors/classes/DuplicateBridgeError.md +191 -0
- package/api/@xmachines/play-router/errors/classes/DuplicateRoutePathError.md +175 -0
- package/api/@xmachines/play-router/errors/classes/EmptyRoutePathError.md +175 -0
- package/api/@xmachines/play-router/errors/classes/InvalidBasePathError.md +200 -0
- package/api/@xmachines/play-router/errors/classes/InvalidRoutePatternError.md +203 -0
- package/api/@xmachines/play-router/errors/classes/InvalidStateIdError.md +175 -0
- package/api/@xmachines/play-router/errors/classes/MissingBasePathParamError.md +199 -0
- package/api/@xmachines/play-router/errors/classes/RouterSyncError.md +192 -0
- package/api/@xmachines/play-router/errors/classes/UnknownStateTypeError.md +182 -0
- package/api/@xmachines/play-router/index/README.md +75 -0
- package/api/@xmachines/play-router/{classes → index/classes}/RouteMap.md +12 -6
- package/api/@xmachines/play-router/{classes → index/classes}/RouterBridgeBase.md +19 -17
- package/api/@xmachines/play-router/{functions → index/functions}/buildPlayRouteEvent.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/buildRouteTree.md +14 -4
- package/api/@xmachines/play-router/{functions → index/functions}/cleanFrameworkParams.md +3 -4
- package/api/@xmachines/play-router/{functions → index/functions}/createRouteMapFromTree.md +13 -6
- package/api/@xmachines/play-router/{functions → index/functions}/createRouterConnection.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/detectDuplicateRoutes.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/extractQuery.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/extractRouteParams.md +3 -3
- package/api/@xmachines/play-router/{functions → index/functions}/findRouteById.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/findRouteByPath.md +2 -2
- package/api/@xmachines/play-router/index/functions/getPatternParamNames.md +29 -0
- package/api/@xmachines/play-router/index/functions/getRequiredPatternParamNames.md +39 -0
- package/api/@xmachines/play-router/{functions → index/functions}/isMountableBridge.md +2 -2
- package/api/@xmachines/play-router/index/functions/joinBasePath.md +37 -0
- package/api/@xmachines/play-router/{functions → index/functions}/mountKey.md +2 -2
- package/api/@xmachines/play-router/index/functions/normalizeBasePath.md +43 -0
- package/api/@xmachines/play-router/{functions → index/functions}/openProviderBridge.md +14 -14
- package/api/@xmachines/play-router/index/functions/pickOwnParams.md +41 -0
- package/api/@xmachines/play-router/{functions → index/functions}/repointProviderBridge.md +2 -2
- package/api/@xmachines/play-router/index/functions/resolveBasePath.md +51 -0
- package/api/@xmachines/play-router/{functions → index/functions}/resolveFrameworkParams.md +11 -13
- package/api/@xmachines/play-router/{functions → index/functions}/sanitizePathname.md +2 -2
- package/api/@xmachines/play-router/index/functions/stripBasePath.md +44 -0
- package/api/@xmachines/play-router/{functions → index/functions}/validateRouteFormat.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/validateStateExists.md +2 -2
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/BasePathOptions.md +6 -6
- package/api/@xmachines/play-router/index/interfaces/BuildPlayRouteEventOptions.md +13 -0
- package/api/@xmachines/play-router/index/interfaces/FrameworkParamsSource.md +47 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/LocationLike.md +6 -6
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/MountableRouterBridge.md +9 -9
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/OpenProviderBridgeArgs.md +13 -13
- package/api/@xmachines/play-router/index/interfaces/PlayRouteEvent.md +130 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/PlayRouterProviderBaseProps.md +15 -15
- package/api/@xmachines/play-router/index/interfaces/ResolvedBasePath.md +14 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/ResolvedRoutePath.md +6 -6
- package/api/@xmachines/play-router/index/interfaces/Routable.md +26 -0
- package/api/@xmachines/play-router/index/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteInfo.md +11 -11
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteMapping.md +6 -6
- package/api/@xmachines/play-router/index/interfaces/RouteMatch.md +12 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteNode.md +13 -13
- package/api/@xmachines/play-router/index/interfaces/RouteObject.md +34 -0
- package/api/@xmachines/play-router/index/interfaces/RouteTree.md +27 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteWatcherHandle.md +7 -7
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouterBridge.md +5 -5
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouterConnection.md +10 -10
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/WindowLike.md +4 -4
- package/api/@xmachines/play-router/index/type-aliases/PlayRouterBridgeConstructor.md +46 -0
- package/api/@xmachines/play-router/index/type-aliases/RouteData.md +12 -0
- package/api/@xmachines/play-router/index/type-aliases/RouteDataResolver.md +31 -0
- package/api/@xmachines/play-router/index/type-aliases/RouteMetadata.md +11 -0
- package/api/@xmachines/{play-xstate → play-router/index}/variables/DISPOSE.md +3 -3
- package/api/@xmachines/play-router/index/variables/NO_BASE_PATH.md +18 -0
- package/api/@xmachines/play-router/index/variables/ROOT_NODE_ID.md +18 -0
- package/api/@xmachines/play-router/xstate/README.md +53 -0
- package/api/@xmachines/play-router/{functions → xstate/functions}/createRouteMap.md +8 -6
- package/api/@xmachines/play-router/{functions → xstate/functions}/extractMachineRoutes.md +4 -4
- package/api/@xmachines/play-router/xstate/functions/getNavigableRoutes.md +35 -0
- package/api/@xmachines/play-router/{functions → xstate/functions}/getRoutableRoutes.md +6 -6
- package/api/@xmachines/play-router/{functions → xstate/functions}/getRouteMappings.md +7 -7
- package/api/@xmachines/play-router/{functions → xstate/functions}/getTransitionReachableRoutes.md +2 -2
- package/api/@xmachines/play-router/{functions → xstate/functions}/isRouteReachable.md +2 -2
- package/api/@xmachines/play-router/{functions → xstate/functions}/machineToGraph.md +2 -2
- package/api/@xmachines/play-router/xstate/functions/routeExists.md +26 -0
- package/api/@xmachines/play-router/xstate/interfaces/MachineEdgeData.md +15 -0
- package/api/@xmachines/play-router/xstate/interfaces/MachineNodeData.md +17 -0
- package/api/@xmachines/play-router/{type-aliases → xstate/type-aliases}/MachineGraph.md +2 -2
- package/api/@xmachines/play-signals/README.md +2 -24
- 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/Cleanup.md +2 -2
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
- package/api/@xmachines/play-solid/README.md +14 -31
- 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 +11 -11
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +13 -13
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +11 -3
- 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/variables/schema.md +71 -0
- package/api/@xmachines/play-solid-router/README.md +31 -52
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +30 -53
- package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +9 -8
- package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +38 -35
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +12 -12
- package/api/@xmachines/play-solid-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +17 -7
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
- package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-svelte/README.md +11 -26
- 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 +12 -12
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +4 -4
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +14 -14
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +11 -3
- package/api/@xmachines/play-svelte/variables/schema.md +16 -0
- package/api/@xmachines/play-svelte-spa-router/README.md +22 -41
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +22 -21
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -2
- package/api/@xmachines/play-svelte-spa-router/interfaces/BasePathOptions.md +5 -5
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +8 -8
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-svelte-spa-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +4 -4
- 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/RouterConnection.md +8 -8
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +3 -3
- package/api/@xmachines/play-sveltekit-router/README.md +17 -35
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +22 -21
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -2
- package/api/@xmachines/play-sveltekit-router/interfaces/BasePathOptions.md +5 -5
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +8 -8
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-sveltekit-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +4 -4
- 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/interfaces/RouterConnection.md +8 -8
- package/api/@xmachines/play-tanstack-react-router/README.md +19 -43
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +18 -17
- package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +11 -8
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +16 -9
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +10 -10
- package/api/@xmachines/play-tanstack-react-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +17 -7
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-tanstack-router/README.md +6 -4
- package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +17 -20
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +3 -3
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/README.md +26 -52
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +49 -45
- package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +9 -8
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +10 -10
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +4 -4
- 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/PlayRouterBridgeConstructor.md +17 -7
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-url/README.md +69 -0
- package/api/@xmachines/play-url/errors/README.md +17 -0
- package/api/@xmachines/play-url/errors/classes/InvalidBasePathError.md +200 -0
- package/api/@xmachines/play-url/errors/classes/InvalidRoutePatternError.md +203 -0
- package/api/@xmachines/play-url/errors/classes/MissingBasePathParamError.md +199 -0
- package/api/@xmachines/play-url/index/README.md +65 -0
- package/api/@xmachines/play-url/index/functions/cleanFrameworkParams.md +39 -0
- package/api/@xmachines/play-url/index/functions/getCandidates.md +29 -0
- package/api/@xmachines/play-url/index/functions/getCompiledPattern.md +31 -0
- package/api/@xmachines/play-url/index/functions/getIndexKey.md +30 -0
- package/api/@xmachines/play-url/index/functions/getNormalizedParamNameMap.md +32 -0
- package/api/@xmachines/play-url/index/functions/getPatternParamNames.md +29 -0
- package/api/@xmachines/play-url/index/functions/getRequiredPatternParamNames.md +39 -0
- package/api/@xmachines/play-url/index/functions/holdsUnsubstitutedParam.md +36 -0
- package/api/@xmachines/play-url/index/functions/isParameterizedPattern.md +36 -0
- package/api/@xmachines/{play-router → play-url/index}/functions/joinBasePath.md +2 -2
- package/api/@xmachines/{play-router → play-url/index}/functions/normalizeBasePath.md +2 -2
- package/api/@xmachines/play-url/index/functions/normalizeParamNames.md +36 -0
- package/api/@xmachines/play-url/index/functions/parsePattern.md +27 -0
- package/api/@xmachines/{play-router → play-url/index}/functions/pickOwnParams.md +4 -4
- package/api/@xmachines/{play-router → play-url/index}/functions/resolveBasePath.md +2 -2
- package/api/@xmachines/play-url/index/functions/resolveFrameworkParams.md +49 -0
- package/api/@xmachines/{play-router → play-url/index}/functions/stripBasePath.md +2 -2
- package/api/@xmachines/play-url/index/interfaces/BasePathOptions.md +28 -0
- package/api/@xmachines/{play-router → play-url/index}/interfaces/FrameworkParamsSource.md +9 -9
- package/api/@xmachines/play-url/index/interfaces/GroupPart.md +15 -0
- package/api/@xmachines/play-url/index/interfaces/LiteralPart.md +14 -0
- package/api/@xmachines/play-url/index/interfaces/ParamPart.md +21 -0
- package/api/@xmachines/play-url/index/interfaces/ParsedPattern.md +23 -0
- package/api/@xmachines/play-url/index/interfaces/PatternParam.md +15 -0
- package/api/@xmachines/{play-router → play-url/index}/interfaces/ResolvedBasePath.md +6 -6
- package/api/@xmachines/play-url/index/type-aliases/PatternModifier.md +11 -0
- package/api/@xmachines/play-url/index/type-aliases/PatternPart.md +9 -0
- package/api/@xmachines/play-url/index/type-aliases/URLPatternCtor.md +22 -0
- package/api/@xmachines/play-url/index/type-aliases/URLPatternLike.md +68 -0
- package/api/@xmachines/{play-router → play-url/index}/variables/NO_BASE_PATH.md +2 -2
- package/api/@xmachines/play-url/index/variables/URLPattern.md +21 -0
- package/api/@xmachines/play-view/README.md +165 -0
- package/api/@xmachines/play-view/errors/README.md +17 -0
- package/api/@xmachines/play-view/errors/classes/ReadOnlyContextError.md +192 -0
- package/api/@xmachines/play-view/index/README.md +55 -0
- package/api/@xmachines/{play-actor → play-view/index}/functions/attachRenderErrorHandler.md +6 -6
- package/api/@xmachines/{play-actor → play-view/index}/functions/composePlayState.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/createFailureLatch.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/createReportGuard.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/createViewStoreLifecycle.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/guardContextWrites.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/refreshContextSubtree.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/reuseComposedState.md +3 -3
- package/api/@xmachines/{play-actor → play-view/index}/functions/sameViewInputs.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/toAtomState.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/typedSpec.md +2 -2
- package/api/@xmachines/play-view/index/interfaces/BaseActorProviderProps.md +49 -0
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/BaseViewContextValue.md +12 -12
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/FailureLatch.md +6 -5
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/PlaySpec.md +8 -8
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ReportGuard.md +6 -6
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ReportGuardMessages.md +6 -6
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ResolveViewStoreOptions.md +5 -5
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ViewInputs.md +7 -7
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ViewStoreLifecycle.md +6 -5
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ViewStoreResolution.md +7 -7
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/Viewable.md +5 -5
- package/api/@xmachines/play-view/index/type-aliases/ViewActor.md +26 -0
- package/api/@xmachines/{play-actor → play-view/index}/variables/CONTEXT_STATE_KEY.md +2 -2
- package/api/@xmachines/play-vue/README.md +15 -33
- package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +9 -9
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +11 -11
- package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +11 -3
- 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/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue/variables/schema.md +71 -0
- package/api/@xmachines/play-vue-router/README.md +34 -77
- package/api/@xmachines/play-vue-router/errors/README.md +8 -0
- package/api/@xmachines/play-vue-router/errors/classes/VueRouterNavigationError.md +193 -0
- package/api/@xmachines/play-vue-router/errors/classes/VueRouterSendError.md +177 -0
- package/api/@xmachines/play-vue-router/index/README.md +20 -0
- package/api/@xmachines/play-vue-router/index/classes/RouteMap.md +157 -0
- package/api/@xmachines/play-vue-router/{classes → index/classes}/VueRouterBridge.md +24 -43
- package/api/@xmachines/play-vue-router/index/interfaces/PlayRouteEvent.md +130 -0
- package/api/@xmachines/play-vue-router/index/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-vue-router/{interfaces → index/interfaces}/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-vue-router/{interfaces → index/interfaces}/RouteMapping.md +6 -6
- package/api/@xmachines/play-vue-router/{interfaces → index/interfaces}/RouterBridge.md +5 -5
- package/api/@xmachines/play-vue-router/{variables → index/variables}/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-xstate/README.md +153 -105
- package/api/@xmachines/play-xstate/errors/README.md +13 -0
- package/api/@xmachines/play-xstate/errors/classes/ActorThrewNonErrorError.md +199 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidEventError.md +198 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidMachineError.md +169 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidRouteHandlerError.md +197 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidRouteMetadataError.md +176 -0
- package/api/@xmachines/play-xstate/errors/classes/MissingRouteParamError.md +199 -0
- package/api/@xmachines/play-xstate/errors/classes/MissingStateIdError.md +203 -0
- package/api/@xmachines/play-xstate/index/README.md +38 -0
- package/api/@xmachines/play-xstate/index/classes/PlayerActor.md +584 -0
- package/api/@xmachines/play-xstate/index/functions/compose.md +224 -0
- package/api/@xmachines/play-xstate/index/functions/definePlayer.md +158 -0
- package/api/@xmachines/play-xstate/index/interfaces/PlayerConfig.md +22 -0
- package/api/@xmachines/play-xstate/{interfaces → index/interfaces}/PlayerFactoryResumeOptions.md +3 -3
- package/api/@xmachines/play-xstate/{interfaces → index/interfaces}/PlayerOptions.md +8 -8
- package/api/@xmachines/play-xstate/index/type-aliases/Capability.md +33 -0
- package/api/@xmachines/play-xstate/index/type-aliases/PlayerConstructor.md +39 -0
- package/api/@xmachines/play-xstate/index/type-aliases/PlayerFactory.md +27 -0
- package/api/@xmachines/{play-router → play-xstate/index}/variables/DISPOSE.md +3 -3
- package/api/@xmachines/play-xstate/with-routing/README.md +46 -0
- package/api/@xmachines/play-xstate/{functions → with-routing/functions}/buildRouteUrl.md +2 -2
- package/api/@xmachines/play-xstate/{functions → with-routing/functions}/deriveRoute.md +4 -4
- package/api/@xmachines/play-xstate/{functions → with-routing/functions}/formatPlayRouteTransitions.md +2 -2
- package/api/@xmachines/play-xstate/{functions → with-routing/functions}/isAbsoluteRoute.md +3 -3
- package/api/@xmachines/play-xstate/with-routing/functions/withRouting.md +36 -0
- package/api/@xmachines/play-xstate/{interfaces → with-routing/interfaces}/RouteContext.md +6 -6
- package/api/@xmachines/play-xstate/with-routing/interfaces/RouteObject.md +34 -0
- package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteData.md +12 -0
- package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteDataResolver.md +31 -0
- package/api/@xmachines/play-xstate/{type-aliases → with-routing/type-aliases}/RouteMachineConfig.md +5 -5
- package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteMetadata.md +11 -0
- package/api/@xmachines/play-xstate/{type-aliases → with-routing/type-aliases}/RouteStateNode.md +21 -7
- package/api/@xmachines/play-xstate/with-view/README.md +31 -0
- package/api/@xmachines/play-xstate/with-view/functions/withView.md +32 -0
- package/api/@xmachines/shared/README.md +10 -32
- 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/vite-aliases/functions/xmSvelteRunes.md +2 -2
- package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +1 -1
- package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +2 -1
- package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +4 -4
- package/api/README.md +2 -0
- package/api/llms.txt +15 -10
- package/contributing/architecture.md +94 -66
- package/contributing/configuration.md +85 -26
- package/contributing/deployment.md +30 -28
- package/contributing/development.md +51 -10
- package/contributing/testing.md +87 -28
- package/examples/README.md +9 -7
- package/examples/form-validation.md +3 -2
- package/examples/multi-router-integration.md +61 -39
- package/examples/routing-patterns.md +15 -14
- package/examples/traffic-light.md +11 -5
- package/guides/README.md +1 -0
- package/guides/actor-model.md +35 -26
- package/guides/getting-started.md +49 -46
- package/guides/inspector.md +4 -4
- package/guides/routing.md +245 -0
- package/guides/state-machines.md +16 -17
- package/package.json +10 -9
- package/rfc/play.md +35 -22
- package/api/@xmachines/play-actor/classes/AbstractActor.md +0 -505
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +0 -48
- package/api/@xmachines/play-actor/interfaces/Routable.md +0 -14
- package/api/@xmachines/play-dom/type-aliases/DisposablePlayUI.md +0 -36
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-dom-router/interfaces/DisposableBrowserHistory.md +0 -262
- package/api/@xmachines/play-dom-router/interfaces/DisposableVanillaRouter.md +0 -80
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +0 -122
- package/api/@xmachines/play-react/type-aliases/PlayRendererProps.md +0 -13
- package/api/@xmachines/play-react-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-react-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +0 -35
- package/api/@xmachines/play-router/functions/getPatternParamNames.md +0 -24
- package/api/@xmachines/play-router/functions/getRequiredPatternParamNames.md +0 -36
- package/api/@xmachines/play-router/functions/routeExists.md +0 -26
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +0 -13
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +0 -15
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +0 -17
- package/api/@xmachines/play-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +0 -135
- package/api/@xmachines/play-router/interfaces/RoutableActor.md +0 -65
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +0 -12
- package/api/@xmachines/play-router/interfaces/RouteObject.md +0 -21
- package/api/@xmachines/play-router/interfaces/RouteTree.md +0 -21
- package/api/@xmachines/play-router/type-aliases/BaseRouteMapping.md +0 -13
- package/api/@xmachines/play-router/type-aliases/PlayRouterBridgeConstructor.md +0 -36
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +0 -11
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +0 -471
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +0 -13
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +0 -9
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +0 -9
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +0 -29
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +0 -31
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +0 -13
- package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +0 -9
- package/api/@xmachines/play-vue/variables/getPlayViewContext.md +0 -39
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +0 -135
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +0 -13
- package/api/@xmachines/play-vue-router/type-aliases/VueRouteMap.md +0 -13
- package/api/@xmachines/play-vue-router/variables/VueRouteMap.md +0 -13
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +0 -568
- package/api/@xmachines/play-xstate/functions/composeGuards.md +0 -86
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +0 -72
- package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +0 -43
- package/api/@xmachines/play-xstate/functions/definePlayer.md +0 -78
- package/api/@xmachines/play-xstate/functions/eventMatches.md +0 -45
- package/api/@xmachines/play-xstate/functions/hasContext.md +0 -45
- package/api/@xmachines/play-xstate/functions/negateGuard.md +0 -67
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +0 -20
- package/api/@xmachines/play-xstate/interfaces/RouteObject.md +0 -17
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +0 -19
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +0 -36
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +0 -23
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +0 -26
- package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +0 -9
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function defineXmVitestConfig(importMetaUrl, overrides): UserConfig;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [vitest.ts:
|
|
9
|
+
Defined in: [vitest.ts:65](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/shared/config/vitest.ts#L65)
|
|
10
10
|
|
|
11
11
|
Create a Vitest config with XMachines workspace defaults.
|
|
12
12
|
|
|
@@ -16,6 +16,7 @@ What this applies automatically:
|
|
|
16
16
|
resolve to source in local/dev test runs.
|
|
17
17
|
- `config/vitest.setup.ts` when missing.
|
|
18
18
|
- `config/vitest.node.setup.ts` for non-browser projects when missing.
|
|
19
|
+
- `pool: "vmThreads"` for jsdom projects that declare no pool.
|
|
19
20
|
|
|
20
21
|
Setup injection is additive and preserves caller-provided ordering after
|
|
21
22
|
required shared setup files.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: XmBrowserConfigOptions
|
|
4
4
|
|
|
5
|
-
Defined in: [vitest.ts:
|
|
5
|
+
Defined in: [vitest.ts:159](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/shared/config/vitest.ts#L159)
|
|
6
6
|
|
|
7
7
|
Options for [defineXmBrowserConfig](../functions/defineXmBrowserConfig.md) that live outside the plain
|
|
8
8
|
Vitest config overrides.
|
|
@@ -11,6 +11,6 @@ Vitest config overrides.
|
|
|
11
11
|
|
|
12
12
|
| Property | Type | Description | Defined in |
|
|
13
13
|
| -------------------------------------------------- | ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
14
|
-
| <a id="property-base"></a> `base?` | `UserConfig` | Base Vite config to layer the browser test config on top of (typically a demo's `vite.config.ts`). When set, the base is expected to provide its own `resolve`/`plugins`, so the `cacheDir` and `resolve` defaults are not applied — mirroring the previous `mergeConfig(viteConfig, ...)` pattern in demo browser configs. | [vitest.ts:
|
|
15
|
-
| <a id="property-optimizedeps"></a> `optimizeDeps?` | `string`[] | Extra package specifiers to pre-bundle via `xmOptimizeDeps` (e.g. `["@xmachines/json-render-vue", "@xmachines/json-render-vue/schema"]`). Ignored when `overrides.optimizeDeps` is set, which then replaces the default `xmOptimizeDeps()` wholesale. | [vitest.ts:
|
|
16
|
-
| <a id="property-resolve"></a> `resolve?` | `Partial`\<`ResolveOptions` & `object`\> | Extra resolve options forwarded to `xmResolve` (e.g. `conditions` or additional `alias` entries). Not applied when `base` is set — the base config owns `resolve` in that layout. | [vitest.ts:
|
|
14
|
+
| <a id="property-base"></a> `base?` | `UserConfig` | Base Vite config to layer the browser test config on top of (typically a demo's `vite.config.ts`). When set, the base is expected to provide its own `resolve`/`plugins`, so the `cacheDir` and `resolve` defaults are not applied — mirroring the previous `mergeConfig(viteConfig, ...)` pattern in demo browser configs. | [vitest.ts:167](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/shared/config/vitest.ts#L167) |
|
|
15
|
+
| <a id="property-optimizedeps"></a> `optimizeDeps?` | `string`[] | Extra package specifiers to pre-bundle via `xmOptimizeDeps` (e.g. `["@xmachines/json-render-vue", "@xmachines/json-render-vue/schema"]`). Ignored when `overrides.optimizeDeps` is set, which then replaces the default `xmOptimizeDeps()` wholesale. | [vitest.ts:174](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/shared/config/vitest.ts#L174) |
|
|
16
|
+
| <a id="property-resolve"></a> `resolve?` | `Partial`\<`ResolveOptions` & `object`\> | Extra resolve options forwarded to `xmResolve` (e.g. `conditions` or additional `alias` entries). Not applied when `base` is set — the base config owns `resolve` in that layout. | [vitest.ts:180](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/shared/config/vitest.ts#L180) |
|
package/api/README.md
CHANGED
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
- [@xmachines/play-tanstack-react-router](@xmachines/play-tanstack-react-router/README.md)
|
|
19
19
|
- [@xmachines/play-tanstack-router](@xmachines/play-tanstack-router/README.md)
|
|
20
20
|
- [@xmachines/play-tanstack-solid-router](@xmachines/play-tanstack-solid-router/README.md)
|
|
21
|
+
- [@xmachines/play-url](@xmachines/play-url/README.md)
|
|
22
|
+
- [@xmachines/play-view](@xmachines/play-view/README.md)
|
|
21
23
|
- [@xmachines/play-vue](@xmachines/play-vue/README.md)
|
|
22
24
|
- [@xmachines/play-vue-router](@xmachines/play-vue-router/README.md)
|
|
23
25
|
- [@xmachines/play-xstate](@xmachines/play-xstate/README.md)
|
package/api/llms.txt
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
## Start Here
|
|
10
10
|
|
|
11
11
|
- Defining players from machines: start with [@xmachines/play-xstate](@xmachines/play-xstate/README.md).
|
|
12
|
-
- Understanding actor contracts: read [@xmachines/play-actor](@xmachines/play-actor/README.md) for [Viewable](@xmachines/play-
|
|
13
|
-
- [Viewable](@xmachines/play-
|
|
14
|
-
- [Routable](@xmachines/play-
|
|
12
|
+
- Understanding actor contracts: read [@xmachines/play-actor](@xmachines/play-actor/README.md) for [Viewable](@xmachines/play-view/index/interfaces/Viewable.md) and [Routable](@xmachines/play-router/index/interfaces/Routable.md).
|
|
13
|
+
- [Viewable](@xmachines/play-view/index/interfaces/Viewable.md) is the rendering contract: actors expose `currentView` plus a component catalog so rendering packages can resolve UI without owning application state.
|
|
14
|
+
- [Routable](@xmachines/play-router/index/interfaces/Routable.md) is the routing contract: actors expose `currentRoute` plus route-oriented event handling, while adapters translate browser or router changes into actor events.
|
|
15
15
|
- Rendering actor-driven UI: use [@xmachines/play-react](@xmachines/play-react/README.md), [@xmachines/play-solid](@xmachines/play-solid/README.md), [@xmachines/play-svelte](@xmachines/play-svelte/README.md), or [@xmachines/play-vue](@xmachines/play-vue/README.md).
|
|
16
16
|
- Synchronizing URLs with actor state: use [@xmachines/play-router](@xmachines/play-router/README.md) plus a framework-specific router adapter.
|
|
17
17
|
|
|
@@ -19,12 +19,14 @@
|
|
|
19
19
|
|
|
20
20
|
- `Core runtime`: [@xmachines/play](@xmachines/play/README.md), [@xmachines/play-actor](@xmachines/play-actor/README.md), [@xmachines/play-signals](@xmachines/play-signals/README.md), [@xmachines/play-router](@xmachines/play-router/README.md), and [@xmachines/play-xstate](@xmachines/play-xstate/README.md). Catalog and component registry are provided by `@xmachines/json-render-core` and the framework rendering packages.
|
|
21
21
|
- `Rendering`: [@xmachines/play-react](@xmachines/play-react/README.md), [@xmachines/play-solid](@xmachines/play-solid/README.md), [@xmachines/play-svelte](@xmachines/play-svelte/README.md), and [@xmachines/play-vue](@xmachines/play-vue/README.md).
|
|
22
|
-
- `Router adapters`: [@xmachines/play-react-router](@xmachines/play-react-router/README.md), [@xmachines/play-tanstack-react-router](@xmachines/play-tanstack-react-router/README.md), [@xmachines/play-solid-router](@xmachines/play-solid-router/README.md), [@xmachines/play-tanstack-solid-router](@xmachines/play-tanstack-solid-router/README.md), [@xmachines/play-vue-router](@xmachines/play-vue-router/README.md), [@xmachines/play-sveltekit-router](@xmachines/play-sveltekit-router/README.md), and [@xmachines/play-svelte-spa-router](@xmachines/play-svelte-spa-router/README.md), all built on top of [Routable](@xmachines/play-
|
|
22
|
+
- `Router adapters`: [@xmachines/play-react-router](@xmachines/play-react-router/README.md), [@xmachines/play-tanstack-react-router](@xmachines/play-tanstack-react-router/README.md), [@xmachines/play-solid-router](@xmachines/play-solid-router/README.md), [@xmachines/play-tanstack-solid-router](@xmachines/play-tanstack-solid-router/README.md), [@xmachines/play-vue-router](@xmachines/play-vue-router/README.md), [@xmachines/play-sveltekit-router](@xmachines/play-sveltekit-router/README.md), and [@xmachines/play-svelte-spa-router](@xmachines/play-svelte-spa-router/README.md), all built on top of [Routable](@xmachines/play-router/index/interfaces/Routable.md) actors and shared route metadata.
|
|
23
23
|
- `Shared tooling`: [@xmachines/shared](@xmachines/shared/README.md) for shared config and workspace-level support files.
|
|
24
24
|
|
|
25
25
|
## API
|
|
26
26
|
- [@xmachines/play](@xmachines/play/README.md): Core Play types and runtime contracts
|
|
27
|
-
- [@xmachines/play-actor](@xmachines/play-actor/README.md):
|
|
27
|
+
- [@xmachines/play-actor](@xmachines/play-actor/README.md): The actor contract: state and send. It names no state machine library, and each capability interface lives with its own package
|
|
28
|
+
- [@xmachines/play-url](@xmachines/play-url/README.md): The URL language: the URLPattern grammar, a base path, and the params of a framework router
|
|
29
|
+
- [@xmachines/play-view](@xmachines/play-view/README.md): The shared view half of every renderer: Viewable, PlaySpec, and the view store lifecycle
|
|
28
30
|
- [@xmachines/play-dom](@xmachines/play-dom/README.md): Vanilla DOM renderer for Viewable actors
|
|
29
31
|
- [@xmachines/play-dom-router](@xmachines/play-dom-router/README.md): Vanilla DOM browser history, router, and actor↔URL synchronization
|
|
30
32
|
- [@xmachines/play-signals](@xmachines/play-signals/README.md): Signal primitives used by Play actors and adapters
|
|
@@ -48,19 +50,22 @@
|
|
|
48
50
|
|
|
49
51
|
- Prefer the core packages before the demo apps; demos are intentionally excluded from this file.
|
|
50
52
|
- For implementation questions, usually read in this order: [@xmachines/play-actor](@xmachines/play-actor/README.md) -> [@xmachines/play-xstate](@xmachines/play-xstate/README.md) -> [@xmachines/play-router](@xmachines/play-router/README.md) -> framework renderer/adapter.
|
|
51
|
-
- [Routable](@xmachines/play-
|
|
53
|
+
- [Routable](@xmachines/play-router/index/interfaces/Routable.md) is the key abstraction for URL synchronization: router adapters observe and update actor route state but do not own navigation policy.
|
|
52
54
|
- Router adapter packages are passive infrastructure; business logic stays in the actor and machine layers.
|
|
53
|
-
- Rendering packages consume the [Viewable](@xmachines/play-
|
|
55
|
+
- Rendering packages consume the [Viewable](@xmachines/play-view/index/interfaces/Viewable.md) contract and component catalogs rather than owning application state.
|
|
54
56
|
|
|
55
57
|
## Quick Reference
|
|
56
58
|
|
|
57
59
|
```javascript
|
|
58
|
-
import { definePlayer } from '@xmachines/play-xstate';
|
|
59
|
-
import {
|
|
60
|
+
import { definePlayer, compose, PlayerActor } from '@xmachines/play-xstate';
|
|
61
|
+
import { withRouting } from '@xmachines/play-xstate/routing';
|
|
62
|
+
import { withView } from '@xmachines/play-xstate/view';
|
|
63
|
+
import { createRouteMapFromTree, extractRouteParams } from '@xmachines/play-router';
|
|
64
|
+
import { extractMachineRoutes } from '@xmachines/play-router/xstate';
|
|
60
65
|
import { defineRegistry } from '@xmachines/json-render-react';
|
|
61
66
|
import { PlayRenderer } from '@xmachines/play-react';
|
|
62
67
|
|
|
63
|
-
const createPlayer = definePlayer({ machine });
|
|
68
|
+
const createPlayer = definePlayer({ machine, actor: compose(PlayerActor, withRouting, withView) });
|
|
64
69
|
const actor = createPlayer();
|
|
65
70
|
actor.start();
|
|
66
71
|
|
|
@@ -27,12 +27,17 @@ graph TD
|
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
subgraph Layer1["Layer 1 — Abstract Actor Base"]
|
|
30
|
-
actor["@xmachines/play-actor\n(
|
|
30
|
+
actor["@xmachines/play-actor\n(PlayActor)"]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
subgraph Layer2v["Layer 2 — The View Half"]
|
|
34
|
+
view["@xmachines/play-view\n(Viewable, PlaySpec, the view store lifecycle)"]
|
|
31
35
|
end
|
|
32
36
|
|
|
33
37
|
subgraph Layer2["Layer 2 — Concrete Implementations"]
|
|
34
|
-
xstate["@xmachines/play-xstate\n(PlayerActor, definePlayer,
|
|
35
|
-
router["@xmachines/play-router\n(RouterBridgeBase, RouteMap,
|
|
38
|
+
xstate["@xmachines/play-xstate\n(PlayerActor, definePlayer, routing)"]
|
|
39
|
+
router["@xmachines/play-router\n(RouterBridgeBase, RouteMap, Routable)"]
|
|
40
|
+
routerxstate["@xmachines/play-router/xstate\n(extractMachineRoutes, createRouteMap)"]
|
|
36
41
|
|
|
37
42
|
subgraph Views["View Renderers"]
|
|
38
43
|
react["@xmachines/play-react"]
|
|
@@ -73,18 +78,22 @@ graph TD
|
|
|
73
78
|
| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
74
79
|
| [`@xmachines/play`](../api/@xmachines/play/README.md) | Core protocol types and error base class | `packages/play/src/index.ts` |
|
|
75
80
|
| [`@xmachines/play-signals`](../api/@xmachines/play-signals/README.md) | TC39 Signal polyfill isolation wrapper | `packages/play-signals/src/index.ts` |
|
|
76
|
-
| [`@xmachines/play-actor`](../api/@xmachines/play-actor/README.md) | `
|
|
81
|
+
| [`@xmachines/play-actor`](../api/@xmachines/play-actor/README.md) | `PlayActor`, and nothing else | `packages/play-actor/src/play-actor.ts` |
|
|
82
|
+
| [`@xmachines/play-view`](../api/@xmachines/play-view/README.md) | `Viewable`, `PlaySpec`, the shared view half | `packages/play-view/src/view-types.ts` |
|
|
77
83
|
| [`@xmachines/play-xstate`](../api/@xmachines/play-xstate/README.md) | XState v5 adapter: `definePlayer`, `PlayerActor` | `packages/play-xstate/src/player-actor.ts` |
|
|
78
|
-
| [`@xmachines/play-
|
|
84
|
+
| [`@xmachines/play-url`](../api/@xmachines/play-url/README.md) | The URLPattern grammar, a base path, framework params | `packages/play-url/src/pattern-grammar.ts` |
|
|
85
|
+
| [`@xmachines/play-router`](../api/@xmachines/play-router/README.md) | `RouteMap`, `RouterBridgeBase`, the provider lifecycle | `packages/play-router/src/router-bridge-base.ts` |
|
|
86
|
+
| [`@xmachines/play-router/xstate`](../api/@xmachines/play-router/README.md) | Route extraction from an XState machine | `packages/play-router/src/xstate/extract-routes.ts` |
|
|
79
87
|
| [`@xmachines/play-react`](../api/@xmachines/play-react/README.md) | React renderer: `ActorProvider`, `PlayRenderer` | `packages/play-react/src/ActorProvider.tsx` |
|
|
80
88
|
| [`@xmachines/play-vue`](../api/@xmachines/play-vue/README.md) | Vue 3 renderer: `ActorProvider.vue`, `PlayRenderer.vue` | `packages/play-vue/src/ActorProvider.vue` |
|
|
81
89
|
| [`@xmachines/play-solid`](../api/@xmachines/play-solid/README.md) | SolidJS renderer | `packages/play-solid/src/ActorProvider.tsx` |
|
|
82
90
|
| [`@xmachines/play-svelte`](../api/@xmachines/play-svelte/README.md) | Svelte 5 renderer | `packages/play-svelte/src/ActorProvider.svelte` |
|
|
83
91
|
| [`@xmachines/play-dom`](../api/@xmachines/play-dom/README.md) | Vanilla DOM renderer | `packages/play-dom/src/create-play-ui.ts` |
|
|
92
|
+
| [`@xmachines/play-tanstack-router`](../api/@xmachines/play-tanstack-router/README.md) | The framework-free TanStack bridge base | `packages/play-tanstack-router/src/tanstack-router-bridge-base.ts` |
|
|
84
93
|
| [`@xmachines/play-tanstack-react-router`](../api/@xmachines/play-tanstack-react-router/README.md) | TanStack React Router bridge | `packages/play-tanstack-react-router/src/tanstack-router-bridge.ts` |
|
|
85
94
|
| [`@xmachines/play-tanstack-solid-router`](../api/@xmachines/play-tanstack-solid-router/README.md) | TanStack SolidJS Router bridge | `packages/play-tanstack-solid-router/src/solid-router-bridge.ts` |
|
|
86
95
|
| [`@xmachines/play-vue-router`](../api/@xmachines/play-vue-router/README.md) | Vue Router 4/5 bridge | `packages/play-vue-router/src/vue-router-bridge.ts` |
|
|
87
|
-
| [`@xmachines/play-react-router`](../api/@xmachines/play-react-router/README.md) | React Router
|
|
96
|
+
| [`@xmachines/play-react-router`](../api/@xmachines/play-react-router/README.md) | React Router 7/8 bridge | `packages/play-react-router/src/react-router-bridge.ts` |
|
|
88
97
|
| [`@xmachines/play-solid-router`](../api/@xmachines/play-solid-router/README.md) | SolidJS Router bridge | `packages/play-solid-router/src/solid-router-bridge.ts` |
|
|
89
98
|
| [`@xmachines/play-dom-router`](../api/@xmachines/play-dom-router/README.md) | Vanilla DOM hash/history router bridge | `packages/play-dom-router/src/dom-router-bridge.ts` |
|
|
90
99
|
| [`@xmachines/play-sveltekit-router`](../api/@xmachines/play-sveltekit-router/README.md) | SvelteKit router bridge | `packages/play-sveltekit-router/src/sveltekit-router-bridge.ts` |
|
|
@@ -186,7 +195,7 @@ flowchart TD
|
|
|
186
195
|
|
|
187
196
|
## Key Abstractions
|
|
188
197
|
|
|
189
|
-
### [`PlayEvent<TPayload>`](../api/@xmachines/play/type-aliases/PlayEvent.md)
|
|
198
|
+
### [`PlayEvent<TPayload>`](../api/@xmachines/play/index/type-aliases/PlayEvent.md)
|
|
190
199
|
|
|
191
200
|
The minimal event contract for Actor communication: any object with a `readonly type: string` property. `TPayload` extends `Record<string, unknown>` for additional fields. Framework-agnostic; used directly by XState, router adapters, and domain logic. Part of [`@xmachines/play`](../api/@xmachines/play/README.md).
|
|
192
201
|
|
|
@@ -196,12 +205,12 @@ import type { PlayEvent } from "@xmachines/play";
|
|
|
196
205
|
type LoginEvent = PlayEvent<{ userId: string; timestamp: number }>;
|
|
197
206
|
```
|
|
198
207
|
|
|
199
|
-
### [`PlayError`](../api/@xmachines/play/classes/PlayError.md)
|
|
208
|
+
### [`PlayError`](../api/@xmachines/play/errors/classes/PlayError.md)
|
|
200
209
|
|
|
201
210
|
Base class for all `@xmachines/*` typed runtime errors. Carries `scope` (throwing class/module) and `code` (stable machine-readable identifier, e.g. `"PLAY_ROUTER_SYNC_FAILED"`). Subclassed per package, exported from each package's `./errors` subpath. Never match on `.message` — always match on `.code` or the subclass.
|
|
202
211
|
|
|
203
212
|
```typescript
|
|
204
|
-
import { PlayError } from "@xmachines/play";
|
|
213
|
+
import { PlayError } from "@xmachines/play/errors";
|
|
205
214
|
import { RouterSyncError } from "@xmachines/play-router/errors";
|
|
206
215
|
|
|
207
216
|
if (err instanceof RouterSyncError) {
|
|
@@ -209,27 +218,37 @@ if (err instanceof RouterSyncError) {
|
|
|
209
218
|
}
|
|
210
219
|
```
|
|
211
220
|
|
|
212
|
-
### [`
|
|
221
|
+
### [`PlayActor<TSnapshot, TEvent>`](../api/@xmachines/play-actor/interfaces/PlayActor.md)
|
|
213
222
|
|
|
214
|
-
|
|
223
|
+
The actor contract, as an INTERFACE. It asks for two members: a reactive `state: Signal.State<TSnapshot>`, and a typed `send(event: TEvent): void`. It names no state machine library, so a consumer of the contract installs `xstate` never. An implementation satisfies it (e.g. [`PlayerActor`](../api/@xmachines/play-xstate/index/classes/PlayerActor.md)).
|
|
215
224
|
|
|
216
|
-
### [`Routable`](../api/@xmachines/play-
|
|
225
|
+
### [`Routable`](../api/@xmachines/play-router/index/interfaces/Routable.md)
|
|
217
226
|
|
|
218
|
-
Optional capability interface. Exposes `currentRoute: Signal.Computed<string | null>` (derived URL path) and `readonly initialRoute: string | null` (machine's initial route, fixed at definition time). Router bridges consume this interface directly — they never depend on the concrete [`PlayerActor`](../api/@xmachines/play-xstate/classes/PlayerActor.md).
|
|
227
|
+
Optional capability interface. Exposes `currentRoute: Signal.Computed<string | null>` (derived URL path) and `readonly initialRoute: string | null` (machine's initial route, fixed at definition time). Router bridges consume this interface directly — they never depend on the concrete [`PlayerActor`](../api/@xmachines/play-xstate/index/classes/PlayerActor.md).
|
|
219
228
|
|
|
220
|
-
### [`Viewable`](../api/@xmachines/play-
|
|
229
|
+
### [`Viewable`](../api/@xmachines/play-view/index/interfaces/Viewable.md)
|
|
221
230
|
|
|
222
231
|
Optional capability interface. Exposes `currentView: Signal.State<PlaySpec | null>`. View renderers (`PlayRenderer`) consume this contract to resolve the current view description into UI without coupling to the framework or actor implementation.
|
|
223
232
|
|
|
224
|
-
### [`PlaySpec`](../api/@xmachines/play-
|
|
233
|
+
### [`PlaySpec`](../api/@xmachines/play-view/index/interfaces/PlaySpec.md)
|
|
225
234
|
|
|
226
235
|
Extends `@xmachines/json-render-core` `Spec`. `deriveCurrentView` projects the machine's whole context into the derived spec's `state` under the read-only `/context` subtree, and stamps a `viewKey` from the selected meta entry so providers can reseed vs refresh their store. Specs read context through the ordinary `{ $state: "/context/…" }` grammar; element props are never enriched. `typedSpec()` type-checks the spec literal at the definition site (XState's `meta` is untyped).
|
|
227
236
|
|
|
228
|
-
### [`PlayerActor<TMachine>`](../api/@xmachines/play-xstate/classes/PlayerActor.md)
|
|
237
|
+
### [`PlayerActor<TMachine>`](../api/@xmachines/play-xstate/index/classes/PlayerActor.md)
|
|
238
|
+
|
|
239
|
+
Concrete XState v5 actor. It extends XState's own `Actor` directly, and it implements [`PlayActor`](../api/@xmachines/play-actor/interfaces/PlayActor.md). It receives the machine in its constructor, so an instance IS the actor rather than a wrapper around one. Bridges its own subscription to TC39 Signals. Exposes: `state`, `send()`, `start()`, `stop()`, `can()`.
|
|
240
|
+
|
|
241
|
+
[`Routable`](../api/@xmachines/play-router/index/interfaces/Routable.md) and [`Viewable`](../api/@xmachines/play-view/index/interfaces/Viewable.md) are OPTIONAL capabilities, and the class implements neither. Each one is a mixin behind its own entry point — `@xmachines/play-xstate/routing` and `@xmachines/play-xstate/view` — and `compose` builds the class that an application needs:
|
|
242
|
+
|
|
243
|
+
```typescript
|
|
244
|
+
definePlayer({ machine, actor: compose(PlayerActor, withRouting, withView) });
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
The core imports neither capability, so an application that declares no route loads no routing code, and one that renders no view loads no view code and installs no json-render.
|
|
229
248
|
|
|
230
|
-
|
|
249
|
+
**The composition order is the derivation order.** `PlayerActor` owns ONE subscription and calls a protected `onSnapshot` hook after `state` holds the new snapshot. A capability overrides that hook and calls `super.onSnapshot()` first, so `compose(PlayerActor, withRouting, withView)` derives the route before the view. That order is load-bearing: a router bridge must see a guard redirect synchronously, and the view of a state reads the route that the same transition produced.
|
|
231
250
|
|
|
232
|
-
### [`definePlayer(config)`](../api/@xmachines/play-xstate/functions/definePlayer.md) → [`PlayerFactory`](../api/@xmachines/play-xstate/type-aliases/PlayerFactory.md)
|
|
251
|
+
### [`definePlayer(config)`](../api/@xmachines/play-xstate/index/functions/definePlayer.md) → [`PlayerFactory`](../api/@xmachines/play-xstate/index/type-aliases/PlayerFactory.md)
|
|
233
252
|
|
|
234
253
|
Factory creator. Each call constructs one `PlayerActor`, which is itself the XState actor and derives its own `initialRoute` from its pre-start snapshot. Restoring a snapshot is the exception: the default initial route can only come from XState's pure `initialTransition` helper, whose inert actor scope constructs a throwaway actor and evaluates the initial transition twice. Returns `(input?, restore?) => PlayerActor<TMachine>`.
|
|
235
254
|
|
|
@@ -241,7 +260,7 @@ const actor = createPlayer(); // or createPlayer(input) or createPlayer(undefine
|
|
|
241
260
|
actor.start();
|
|
242
261
|
```
|
|
243
262
|
|
|
244
|
-
### [`RouterBridgeBase`](../api/@xmachines/play-router/classes/RouterBridgeBase.md)
|
|
263
|
+
### [`RouterBridgeBase`](../api/@xmachines/play-router/index/classes/RouterBridgeBase.md)
|
|
245
264
|
|
|
246
265
|
Abstract base class capturing all common router bridge logic. Template Method pattern — subclasses implement exactly three abstract methods: `navigateRouter(path)`, `watchRouterChanges()`, `unwatchRouterChanges()`. Manages `isConnected`, `lastSyncedPath` (echo suppression), `isProcessingNavigation` (re-entrant guard redirect prevention), and `routeWatcher` lifecycle. Enforces one-bridge-per-actor via a module-level `WeakMap`.
|
|
247
266
|
|
|
@@ -259,11 +278,11 @@ class MyRouterBridge extends RouterBridgeBase {
|
|
|
259
278
|
}
|
|
260
279
|
```
|
|
261
280
|
|
|
262
|
-
### [`RouteMap`](../api/@xmachines/play-router/classes/RouteMap.md) / [`createRouteMap`](../api/@xmachines/play-router/functions/createRouteMap.md)
|
|
281
|
+
### [`RouteMap`](../api/@xmachines/play-router/index/classes/RouteMap.md) / [`createRouteMap`](../api/@xmachines/play-router/xstate/functions/createRouteMap.md)
|
|
263
282
|
|
|
264
|
-
Bidirectional `stateId ↔ URL path` lookup. [`createRouteMap(machine)`](../api/@xmachines/play-router/functions/createRouteMap.md) → [`RouteMap`](../api/@xmachines/play-router/classes/RouteMap.md). [`createRouteMapFromTree(routeTree)`](../api/@xmachines/play-router/functions/createRouteMapFromTree.md) takes the output of [`extractMachineRoutes(machine)`](../api/@xmachines/play-router/functions/extractMachineRoutes.md) directly.
|
|
283
|
+
Bidirectional `stateId ↔ URL path` lookup. [`createRouteMap(machine)`](../api/@xmachines/play-router/xstate/functions/createRouteMap.md) of `@xmachines/play-router/xstate` → [`RouteMap`](../api/@xmachines/play-router/index/classes/RouteMap.md). [`createRouteMapFromTree(routeTree)`](../api/@xmachines/play-router/index/functions/createRouteMapFromTree.md) of `@xmachines/play-router` takes the output of [`extractMachineRoutes(machine)`](../api/@xmachines/play-router/xstate/functions/extractMachineRoutes.md) directly. Both drop the synthetic root node of the tree, so neither map answers a state ID that the machine does not hold. The match of a parameterized route, for example `/profile/:userId`, uses `URLPattern` of [`@xmachines/play-url`](../api/@xmachines/play-url/README.md).
|
|
265
284
|
|
|
266
|
-
### [`PlayRouteEvent`](../api/@xmachines/play-router/interfaces/PlayRouteEvent.md)
|
|
285
|
+
### [`PlayRouteEvent`](../api/@xmachines/play-router/index/interfaces/PlayRouteEvent.md)
|
|
267
286
|
|
|
268
287
|
Unified routing event sent by router adapters to the Actor.
|
|
269
288
|
|
|
@@ -281,7 +300,7 @@ interface PlayRouteEvent {
|
|
|
281
300
|
|
|
282
301
|
Subscribe to a single TC39 signal with microtask batching and memory-safe cleanup. Uses a one-shot `Signal.subtle.Watcher` lifecycle — re-arms after each notification. `disposed` flag guards post-cleanup callbacks; `needsEnqueue` deduplicates rapid synchronous signal changes. Returns a `() => void` cleanup function.
|
|
283
302
|
|
|
284
|
-
### [`formatPlayRouteTransitions(machineConfig)`](../api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md)
|
|
303
|
+
### [`formatPlayRouteTransitions(machineConfig)`](../api/@xmachines/play-xstate/with-routing/functions/formatPlayRouteTransitions.md)
|
|
285
304
|
|
|
286
305
|
Crawls machine state configs looking for states with `meta.route` and auto-generates `play.route` transition handlers at the root machine level. Each generated transition targets the matching state, guards on `event.to === "#stateId"`, and assigns `event.params` and `event.query` to context. Returns the same config type `T` — directly usable by `setup().createMachine()`.
|
|
287
306
|
|
|
@@ -306,11 +325,11 @@ All five view renderer packages follow an identical structural pattern:
|
|
|
306
325
|
| [`@xmachines/play-svelte`](../api/@xmachines/play-svelte/README.md) | Svelte 5 runes (`$effect`) via `actor-context.svelte.ts` |
|
|
307
326
|
| [`@xmachines/play-dom`](../api/@xmachines/play-dom/README.md) | Manual DOM updates via [`createPlayUI`](../api/@xmachines/play-dom/functions/createPlayUI.md) / [`createRenderer`](../api/@xmachines/play-dom/functions/createRenderer.md) / [`PlayRenderer`](../api/@xmachines/play-dom/classes/PlayRenderer.md) |
|
|
308
327
|
|
|
309
|
-
Per-view component state is managed by `@xstate/store`: a fresh store atom is created per [`PlaySpec`](../api/@xmachines/play-
|
|
328
|
+
Per-view component state is managed by `@xstate/store`: a fresh store atom is created per [`PlaySpec`](../api/@xmachines/play-view/index/interfaces/PlaySpec.md) transition (uncontrolled mode), or an external `store` prop is passed via `ActorProvider`/`PlayUIProvider` (controlled mode).
|
|
310
329
|
|
|
311
330
|
## Router Adapter Pattern
|
|
312
331
|
|
|
313
|
-
All eight router adapter packages follow the Template Method pattern via [`RouterBridgeBase`](../api/@xmachines/play-router/classes/RouterBridgeBase.md). Each adapter implements exactly three abstract methods:
|
|
332
|
+
All eight router adapter packages follow the Template Method pattern via [`RouterBridgeBase`](../api/@xmachines/play-router/index/classes/RouterBridgeBase.md). Each adapter implements exactly three abstract methods:
|
|
314
333
|
|
|
315
334
|
```typescript
|
|
316
335
|
// How to tell the framework router to change URL
|
|
@@ -344,22 +363,22 @@ packages/
|
|
|
344
363
|
├── play/ # Layer 0: Core protocol: PlayEvent, PlayError, assertNonNullable
|
|
345
364
|
├── play-signals/ # Layer 0: TC39 Signal polyfill wrapper — all signal imports go here
|
|
346
365
|
│ └── src/ # Re-exports signal-polyfill; watchSignal utility
|
|
347
|
-
├── play-actor/ # Layer 1:
|
|
366
|
+
├── play-actor/ # Layer 1: the PlayActor contract — state and send, and nothing else
|
|
367
|
+
├── play-url/ # Layer 1: the URL language — the URLPattern grammar, a base path, framework params
|
|
368
|
+
├── play-view/ # Layer 2: Viewable, PlaySpec, the view store lifecycle, the context projection
|
|
348
369
|
│
|
|
349
370
|
├── play-xstate/ # Layer 2: Concrete XState v5 actor: definePlayer, PlayerActor
|
|
350
371
|
│ └── src/
|
|
351
372
|
│ ├── player-actor.ts # PlayerActor — concrete actor
|
|
352
373
|
│ ├── define-player.ts # definePlayer factory
|
|
353
|
-
│ ├── guards/ # composeGuards, composeGuardsOr, negateGuard, hasContext...
|
|
354
374
|
│ ├── routing/ # deriveRoute, buildRouteUrl, formatPlayRouteTransitions
|
|
355
375
|
│ └── view/ # deriveCurrentView (meta.view → PlaySpec)
|
|
356
376
|
│
|
|
357
377
|
├── play-router/ # Layer 2: Route extraction, bidirectional mapping, bridge base
|
|
358
378
|
│ └── src/
|
|
359
379
|
│ ├── router-bridge-base.ts # RouterBridgeBase (Template Method for all adapters)
|
|
360
|
-
│ ├── extract-routes.ts # extractMachineRoutes → RouteTree
|
|
361
380
|
│ ├── base-route-map.ts # RouteMap (bidirectional stateId ↔ path)
|
|
362
|
-
│ ├──
|
|
381
|
+
│ ├── xstate/ # the machine half — extractMachineRoutes, createRouteMap
|
|
363
382
|
│ ├── router-sync.ts # buildPlayRouteEvent, extractRouteParams, sanitizePathname
|
|
364
383
|
│ └── types.ts # PlayRouteEvent, RouterBridge, RouteTree, WindowLike...
|
|
365
384
|
│
|
|
@@ -371,7 +390,7 @@ packages/
|
|
|
371
390
|
│
|
|
372
391
|
├── play-tanstack-react-router/ # Router adapter: TanStack Router (React)
|
|
373
392
|
├── play-tanstack-solid-router/ # Router adapter: TanStack Router (SolidJS)
|
|
374
|
-
├── play-react-router/ # Router adapter: React Router
|
|
393
|
+
├── play-react-router/ # Router adapter: React Router 7/8
|
|
375
394
|
├── play-vue-router/ # Router adapter: Vue Router 4/5
|
|
376
395
|
├── play-solid-router/ # Router adapter: SolidJS Router
|
|
377
396
|
├── play-svelte-spa-router/ # Router adapter: Svelte SPA Router
|
|
@@ -409,28 +428,39 @@ flowchart LR
|
|
|
409
428
|
end
|
|
410
429
|
subgraph L1["Layer 1 — depends on L0"]
|
|
411
430
|
pa[play-actor]
|
|
431
|
+
pu[play-url]
|
|
412
432
|
end
|
|
413
|
-
subgraph L2["Layer 2 —
|
|
433
|
+
subgraph L2["Layer 2 — the view half"]
|
|
434
|
+
pvw[play-view]
|
|
435
|
+
end
|
|
436
|
+
subgraph L3r["Layer 3 — the routers, which read NO view package"]
|
|
414
437
|
pr[play-router]
|
|
415
438
|
pdr[play-dom-router]
|
|
416
439
|
psk[play-sveltekit-router]
|
|
417
|
-
px[play-xstate]
|
|
418
|
-
prea[play-react]
|
|
419
|
-
pv[play-vue]
|
|
420
|
-
pso[play-solid]
|
|
421
|
-
psv[play-svelte]
|
|
422
|
-
pdo[play-dom]
|
|
423
440
|
ptsr[play-tanstack-react-router]
|
|
424
441
|
pvr[play-vue-router]
|
|
425
442
|
psor[play-solid-router]
|
|
426
443
|
pssr[play-svelte-spa-router]
|
|
427
444
|
ptss[play-tanstack-solid-router]
|
|
428
445
|
end
|
|
429
|
-
subgraph
|
|
446
|
+
subgraph L3v["Layer 3 — the renderers and the xstate adapter, which read L2"]
|
|
447
|
+
px[play-xstate]
|
|
448
|
+
prea[play-react]
|
|
449
|
+
pvue[play-vue]
|
|
450
|
+
pso[play-solid]
|
|
451
|
+
psv[play-svelte]
|
|
452
|
+
pdo[play-dom]
|
|
453
|
+
end
|
|
454
|
+
subgraph L4["Layer 4 — examples / play-react-router"]
|
|
430
455
|
ex["play-react-router\nplay-*/examples/demo"]
|
|
431
456
|
end
|
|
432
457
|
|
|
433
|
-
L0 --> L1
|
|
458
|
+
L0 --> L1
|
|
459
|
+
L1 --> L2
|
|
460
|
+
L1 --> L3r
|
|
461
|
+
L2 --> L3v
|
|
462
|
+
L3r --> L4
|
|
463
|
+
L3v --> L4
|
|
434
464
|
```
|
|
435
465
|
|
|
436
466
|
With `declarationMap: true` in the base tsconfig (from `@xmachines/shared/tsconfig`), IDE "Go to Definition" jumps to TypeScript source files rather than compiled `.d.ts` files, and refactoring works correctly across package boundaries without requiring a build step.
|
|
@@ -440,14 +470,16 @@ With `declarationMap: true` in the base tsconfig (from `@xmachines/shared/tsconf
|
|
|
440
470
|
| Layer | May import from | Must not import from |
|
|
441
471
|
| ----------------------------------------------- | --------------------------------------------------- | -------------------------------- |
|
|
442
472
|
| Protocol (`play`, `play-signals`, `play-actor`) | External libs only | Any other `@xmachines/*` package |
|
|
473
|
+
| View half (`play-view`) | Protocol layer, `@xmachines/json-render-core` | Router adapters, framework code |
|
|
443
474
|
| Actor logic (`play-xstate`) | Protocol layer | View renderers, router adapters |
|
|
444
|
-
|
|
|
475
|
+
| URL language (`play-url`) | Protocol layer, `urlpattern-polyfill` | Any other `@xmachines/*` package |
|
|
476
|
+
| Router infrastructure (`play-router`) | Protocol layer, `play-url`, `@statelyai/graph` | View renderers |
|
|
445
477
|
| Router adapters (`play-*-router`) | `play-router`, protocol layer, framework router lib | Other view renderers |
|
|
446
478
|
| View renderers (`play-*`) | Protocol layer, `@xmachines/json-render-*` | Router adapters |
|
|
447
479
|
|
|
448
480
|
## Error Handling
|
|
449
481
|
|
|
450
|
-
All `@xmachines/*` errors extend [`PlayError`](../api/@xmachines/play/classes/PlayError.md) and carry two stable fields:
|
|
482
|
+
All `@xmachines/*` errors extend [`PlayError`](../api/@xmachines/play/errors/classes/PlayError.md) and carry two stable fields:
|
|
451
483
|
|
|
452
484
|
- `scope` — the class or module that threw (e.g. `"RouterBridgeBase"`)
|
|
453
485
|
- `code` — a stable machine-readable identifier (e.g. `"PLAY_ROUTER_SYNC_FAILED"`)
|
|
@@ -456,48 +488,44 @@ All `@xmachines/*` errors extend [`PlayError`](../api/@xmachines/play/classes/Pl
|
|
|
456
488
|
|
|
457
489
|
```mermaid
|
|
458
490
|
flowchart TD
|
|
459
|
-
PE["PlayError\n@xmachines/play"]
|
|
491
|
+
PE["PlayError\n@xmachines/play/errors"]
|
|
460
492
|
PE --> NNE["NonNullableError\nPLAY_NON_NULLABLE"]
|
|
461
493
|
PE --> RSE["RouterSyncError\nPLAY_ROUTER_SYNC_FAILED"]
|
|
462
|
-
PE --> UPE["URLPatternUnavailableError\nPLAY_ROUTE_MAP_URLPATTERN_UNAVAILABLE"]
|
|
463
494
|
PE --> DBE["DuplicateBridgeError\nPLAY_ROUTER_DUPLICATE_BRIDGE"]
|
|
464
495
|
PE --> IEE["InvalidEventError\nPLAY_XSTATE_INVALID_EVENT"]
|
|
465
496
|
PE --> IME["InvalidMachineError\nPLAY_XSTATE_INVALID_MACHINE"]
|
|
466
497
|
PE --> MRP["MissingRouteParamError\nPLAY_XSTATE_ROUTE_PARAM_MISSING"]
|
|
467
498
|
PE --> MSI["MissingStateIdError\nPLAY_XSTATE_MISSING_STATE_ID"]
|
|
468
|
-
PE --> MQC["MissingQueryContextError\nPLAY_XSTATE_MISSING_QUERY_CONTEXT\n(deprecated — never thrown)"]
|
|
469
499
|
PE --> IRE["InvalidRouteMetadataError\nPLAY_XSTATE_INVALID_ROUTE_METADATA"]
|
|
470
500
|
PE --> ATN["ActorThrewNonErrorError\nPLAY_XSTATE_NON_ERROR_THROWN"]
|
|
471
|
-
PE --> EGA["EmptyGuardArrayError\nPLAY_XSTATE_EMPTY_GUARD_ARRAY"]
|
|
472
501
|
```
|
|
473
502
|
|
|
474
503
|
Package-specific errors are exported from `./errors` subpath imports:
|
|
475
504
|
|
|
476
505
|
```typescript
|
|
477
|
-
import { PlayError } from "@xmachines/play";
|
|
506
|
+
import { PlayError } from "@xmachines/play/errors";
|
|
478
507
|
import { RouterSyncError } from "@xmachines/play-router/errors";
|
|
479
508
|
import { InvalidEventError } from "@xmachines/play-xstate/errors";
|
|
480
509
|
```
|
|
481
510
|
|
|
482
511
|
**Error behavior by case:**
|
|
483
512
|
|
|
484
|
-
| Error
|
|
485
|
-
|
|
|
486
|
-
| `MissingRouteParamError`
|
|
487
|
-
| `
|
|
488
|
-
| `
|
|
489
|
-
| `
|
|
490
|
-
|
|
|
491
|
-
| `DuplicateBridgeError` | `play-router` | Two bridges registered for the same actor |
|
|
492
|
-
| `URLPatternUnavailableError` | `play-router` | URLPattern API missing — load `urlpattern-polyfill` |
|
|
493
|
-
| View errors | `play-xstate` | Caught in `validateAndCacheView()`; forwarded to `onError` hook; last valid view retained |
|
|
513
|
+
| Error | Package | Behavior |
|
|
514
|
+
| ------------------------- | ------------- | ------------------------------------------------------------------------------------------ |
|
|
515
|
+
| `MissingRouteParamError` | `play-xstate` | Transient — `currentRoute` returns `null`; does not throw |
|
|
516
|
+
| `ActorThrewNonErrorError` | `play-xstate` | Constructed for `onError` when the machine throws a non-`Error`; original value on `cause` |
|
|
517
|
+
| `RouterSyncError` | `play-router` | Wraps router sync failures |
|
|
518
|
+
| `DuplicateBridgeError` | `play-router` | Two bridges registered for the same actor |
|
|
519
|
+
| View errors | `play-xstate` | Caught in `validateAndCacheView()`; forwarded to `onError` hook; last valid view retained |
|
|
494
520
|
|
|
495
521
|
## Application Bootstrap (React example)
|
|
496
522
|
|
|
497
523
|
```typescript
|
|
498
524
|
import { setup } from "xstate";
|
|
499
|
-
import { definePlayer,
|
|
500
|
-
import {
|
|
525
|
+
import { definePlayer, compose, PlayerActor } from "@xmachines/play-xstate";
|
|
526
|
+
import { formatPlayRouteTransitions, withRouting } from "@xmachines/play-xstate/routing";
|
|
527
|
+
import { withView } from "@xmachines/play-xstate/view";
|
|
528
|
+
import { extractMachineRoutes } from "@xmachines/play-router/xstate";
|
|
501
529
|
import { createRouteMapFromTree, PlayRouterProvider } from "@xmachines/play-tanstack-react-router";
|
|
502
530
|
import { PlayUIProvider, PlayRenderer, defineRegistry } from "@xmachines/play-react";
|
|
503
531
|
|
|
@@ -530,8 +558,8 @@ const machine = setup({}).createMachine(machineConfig);
|
|
|
530
558
|
const routeTree = extractMachineRoutes(machine);
|
|
531
559
|
const routeMap = createRouteMapFromTree(routeTree);
|
|
532
560
|
|
|
533
|
-
// 3. Create player factory and start actor
|
|
534
|
-
const createPlayer = definePlayer({ machine });
|
|
561
|
+
// 3. Create player factory and start actor — the providers need BOTH capabilities
|
|
562
|
+
const createPlayer = definePlayer({ machine, actor: compose(PlayerActor, withRouting, withView) });
|
|
535
563
|
const actor = createPlayer();
|
|
536
564
|
actor.start();
|
|
537
565
|
|
|
@@ -574,23 +602,23 @@ const currentUser = useActorSelector(actor, (s) => s.context.currentUser);
|
|
|
574
602
|
|
|
575
603
|
### Calling `navigateRouter` inside `watchRouterChanges`
|
|
576
604
|
|
|
577
|
-
Calling `navigateRouter()` before updating `lastSyncedPath` inside the `watchRouterChanges` callback causes an echo loop. The router navigation fires the watcher again, which sends a duplicate `play.route` event. Always update `lastSyncedPath` before calling `navigateRouter()` — see [`RouterBridgeBase`](../api/@xmachines/play-router/classes/RouterBridgeBase.md) source at `packages/play-router/src/router-bridge-base.ts`.
|
|
605
|
+
Calling `navigateRouter()` before updating `lastSyncedPath` inside the `watchRouterChanges` callback causes an echo loop. The router navigation fires the watcher again, which sends a duplicate `play.route` event. Always update `lastSyncedPath` before calling `navigateRouter()` — see [`RouterBridgeBase`](../api/@xmachines/play-router/index/classes/RouterBridgeBase.md) source at `packages/play-router/src/router-bridge-base.ts`.
|
|
578
606
|
|
|
579
607
|
### Skipping `sanitizePathname` in custom bridge implementations
|
|
580
608
|
|
|
581
|
-
Custom `watchRouterChanges()` implementations that bypass `syncActorFromRouter()` and process pathnames directly skip the length/content guards that protect the route-map lookup from malformed or oversized paths. Always call [`sanitizePathname(path)`](../api/@xmachines/play-router/functions/sanitizePathname.md) before processing.
|
|
609
|
+
Custom `watchRouterChanges()` implementations that bypass `syncActorFromRouter()` and process pathnames directly skip the length/content guards that protect the route-map lookup from malformed or oversized paths. Always call [`sanitizePathname(path)`](../api/@xmachines/play-router/index/functions/sanitizePathname.md) before processing.
|
|
582
610
|
|
|
583
611
|
## Cross-Cutting Concerns
|
|
584
612
|
|
|
585
|
-
**Circular update prevention:** `lastSyncedPath` in [`RouterBridgeBase`](../api/@xmachines/play-router/classes/RouterBridgeBase.md) provides echo suppression for the actor→router direction; `isProcessingNavigation` flag guards against re-entrant guard-redirect loops in `syncActorFromRouter`. `needsEnqueue` in [`watchSignal`](../api/@xmachines/play-signals/functions/watchSignal.md) deduplicates rapid synchronous signal changes via microtask batching.
|
|
613
|
+
**Circular update prevention:** `lastSyncedPath` in [`RouterBridgeBase`](../api/@xmachines/play-router/index/classes/RouterBridgeBase.md) provides echo suppression for the actor→router direction; `isProcessingNavigation` flag guards against re-entrant guard-redirect loops in `syncActorFromRouter`. `needsEnqueue` in [`watchSignal`](../api/@xmachines/play-signals/functions/watchSignal.md) deduplicates rapid synchronous signal changes via microtask batching.
|
|
586
614
|
|
|
587
|
-
**SSR / test injection:** [`WindowLike`](../api/@xmachines/play-router/interfaces/WindowLike.md) and [`LocationLike`](../api/@xmachines/play-router/interfaces/LocationLike.md) structural interfaces in [`@xmachines/play-router`](../api/@xmachines/play-router/README.md) allow injecting mock objects in router adapters, enabling testing without a real browser environment.
|
|
615
|
+
**SSR / test injection:** [`WindowLike`](../api/@xmachines/play-router/index/interfaces/WindowLike.md) and [`LocationLike`](../api/@xmachines/play-router/index/interfaces/LocationLike.md) structural interfaces in [`@xmachines/play-router`](../api/@xmachines/play-router/README.md) allow injecting mock objects in router adapters, enabling testing without a real browser environment.
|
|
588
616
|
|
|
589
|
-
**Logging:** No structured logging framework. [`PlayerOptions`](../api/@xmachines/play-xstate/interfaces/PlayerOptions.md) exposes lifecycle hooks — `onStart`, `onStop`, `onTransition`, `onStateChange`, `onError` — as observability extension points. A renderer writes to `console.error` in ONE case: it contained a failure, and no handler of the host receives that failure. Such a failure is the one result that nobody can debug. Give `onError` to send the failure of a view to your own observability tool instead.
|
|
617
|
+
**Logging:** No structured logging framework. [`PlayerOptions`](../api/@xmachines/play-xstate/index/interfaces/PlayerOptions.md) exposes lifecycle hooks — `onStart`, `onStop`, `onTransition`, `onStateChange`, `onError` — as observability extension points. A renderer writes to `console.error` in ONE case: it contained a failure, and no handler of the host receives that failure. Such a failure is the one result that nobody can debug. Give `onError` to send the failure of a view to your own observability tool instead.
|
|
590
618
|
|
|
591
619
|
Five paths reach that case. The host gives no `onError` prop. The handler of the host throws, or the producer of the `fallback` throws, or a release of the caller throws — each of those reports the failure of the HOST, which no handler of the host receives. `ActorProvider` of play-vue stops a second report of one error, and `onError` stays silent there on purpose, because the four other renderers see such an error never.
|
|
592
620
|
|
|
593
|
-
Three other places write to `console.warn`, and each one reports a configuration that the library cannot refuse: `warnOnce` of `@xmachines/play-
|
|
621
|
+
Three other places write to `console.warn`, and each one reports a configuration that the library cannot refuse: `warnOnce` of `@xmachines/play-view` names a `/context` projection that it cannot derive, one time for each spec; `@xmachines/play-xstate` names the `meta.view.contextProps` field that 1.x removed, one time for each spec; and `@xmachines/play-router` names a `basePath` that a bridge with no mount ignores. A warning is the answer where a throw would stop an application for a fault that it can still run with. No other library source calls `console.*`.
|
|
594
622
|
|
|
595
623
|
**Authentication:** Not in scope. Enforced via XState guards on `play.route` transitions. The guard evaluates machine `context` (e.g., `isLoggedIn`) before permitting navigation. No library-level auth primitives — the machine defines all access control.
|
|
596
624
|
|