@xmachines/docs 1.0.0-beta.51 → 1.0.0-beta.52
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 +13 -11
- package/api/@xmachines/play/README.md +6 -5
- 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 +2 -2
- 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 +125 -47
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +20 -10
- package/api/@xmachines/play-dom/functions/createPlayUI.md +9 -9
- package/api/@xmachines/play-dom/functions/createRenderer.md +3 -2
- package/api/@xmachines/play-dom/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-dom/functions/renderSpec.md +17 -13
- package/api/@xmachines/play-dom/interfaces/ComponentContext.md +7 -7
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +15 -12
- package/api/@xmachines/play-dom/interfaces/DefineRegistryResult.md +4 -4
- package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +17 -14
- package/api/@xmachines/play-dom/interfaces/EventHandle.md +4 -4
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +10 -6
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +20 -8
- package/api/@xmachines/play-dom/interfaces/UIProviderOptions.md +13 -10
- 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 +6 -4
- 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 +23 -25
- 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 +6 -6
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +68 -0
- 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-react/README.md +3 -3
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +5 -5
- package/api/@xmachines/play-react/functions/useActor.md +3 -3
- 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/AnyPlayActor.md +11 -0
- 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 +16 -1
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +85 -41
- package/api/@xmachines/play-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +4 -4
- 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/PlayActor.md +68 -0
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +8 -8
- 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 +21 -18
- package/api/@xmachines/play-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +83 -43
- 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/PlayActor.md +68 -0
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-router/interfaces/RoutableActor.md +64 -0
- 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 +4 -3
- 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 +18 -20
- package/api/@xmachines/play-solid/functions/useActor.md +3 -3
- 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/AnyPlayActor.md +11 -0
- package/api/@xmachines/play-solid/variables/ActorContext.md +2 -2
- 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 +77 -10
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +83 -35
- package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +4 -4
- 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/PlayActor.md +68 -0
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +8 -8
- 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 +6 -4
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
- package/api/@xmachines/play-svelte/README.md +23 -14
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-svelte/functions/getActorContext.md +3 -3
- package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +1 -1
- package/api/@xmachines/play-svelte/functions/setActorContext.md +4 -4
- 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/AnyPlayActor.md +11 -0
- package/api/@xmachines/play-svelte-spa-router/README.md +13 -13
- 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 +6 -6
- 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 +20 -20
- 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 +6 -6
- 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 +3 -6
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +80 -35
- package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +4 -4
- 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/PlayActor.md +68 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +8 -8
- 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 +23 -17
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/classes/{SolidRouterBridge.md → TanStackSolidRouterBridge.md} +86 -38
- package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +68 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +8 -8
- 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 +6 -4
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +3 -3
- package/api/@xmachines/play-vue/README.md +3 -3
- 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 +3 -3
- 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/AnyPlayActor.md +11 -0
- 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-router/README.md +27 -17
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +81 -33
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +68 -0
- 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 +6 -4
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +3 -3
- package/api/@xmachines/play-xstate/README.md +7 -3
- 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/interfaces/RouteObject.md +17 -0
- 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/RouteMetadata.md +9 -0
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +4 -4
- package/api/@xmachines/shared/README.md +25 -12
- package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
- package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
- package/contributing/architecture.md +599 -0
- package/contributing/configuration.md +262 -419
- package/contributing/development.md +300 -453
- package/contributing/testing.md +165 -172
- package/examples/@xmachines/play-dom-demo/README.md +30 -21
- 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 +23 -18
- package/examples/@xmachines/play-react-demo/README.md +38 -37
- 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 +37 -33
- package/examples/@xmachines/play-solid-demo/README.md +5 -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 +38 -25
- package/examples/@xmachines/play-svelte-demo/README.md +8 -5
- 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 +11 -9
- package/examples/@xmachines/play-sveltekit-router-demo/README.md +14 -9
- package/examples/@xmachines/play-tanstack-react-router-demo/README.md +39 -13
- package/examples/@xmachines/play-tanstack-solid-router-demo/README.md +27 -13
- package/examples/@xmachines/play-vue-demo/README.md +35 -24
- 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 +2 -0
- package/examples/README.md +7 -7
- package/examples/multi-router-integration.md +13 -16
- package/examples/routing-patterns.md +2 -2
- package/guides/README.md +1 -1
- package/guides/actor-model.md +2 -2
- package/guides/getting-started.md +325 -132
- package/guides/signals.md +1 -1
- package/guides/state-machines.md +1 -1
- package/package.json +2 -2
- package/api/@xmachines/play-dom/functions/connectRenderer.md +0 -70
- package/api/@xmachines/play-dom/interfaces/ConnectRendererOptions.md +0 -28
- package/api/@xmachines/play-dom-router/type-aliases/RoutableActor.md +0 -9
- package/api/@xmachines/play-react/type-aliases/PlayActor.md +0 -9
- package/api/@xmachines/play-solid/type-aliases/PlayActor.md +0 -9
- package/api/@xmachines/play-svelte/type-aliases/PlayActor.md +0 -9
- package/api/@xmachines/play-vue/type-aliases/PlayActor.md +0 -9
- package/guides/architecture.md +0 -500
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const Dashboard: ComponentFn<AuthCatalog, "Dashboard">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-dom/examples/demo/src/components/Dashboard.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [play-dom/examples/demo/src/components/Dashboard.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/examples/demo/src/components/Dashboard.ts#L9)
|
|
10
10
|
|
|
11
11
|
Dashboard — Protected authenticated home. Catalog-typed DOM component
|
|
12
12
|
(ComponentFn<AuthCatalog, 'Dashboard'>). Renders welcome message; logout
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const Home: ComponentFn<AuthCatalog, "Home">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-dom/examples/demo/src/components/Home.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [play-dom/examples/demo/src/components/Home.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/examples/demo/src/components/Home.ts#L9)
|
|
10
10
|
|
|
11
11
|
Home — Public landing page. Catalog-typed DOM component
|
|
12
12
|
(ComponentFn<AuthCatalog, 'Home'>). Renders static welcome content from
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const Login: ComponentFn<AuthCatalog, "Login">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-dom/examples/demo/src/components/Login.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [play-dom/examples/demo/src/components/Login.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/examples/demo/src/components/Login.ts#L9)
|
|
10
10
|
|
|
11
11
|
Login — Authentication form. Catalog-typed DOM component
|
|
12
12
|
(ComponentFn<AuthCatalog, 'Login'>). Binds username input to ctx.store via
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const NavBarView: ComponentFn<AuthCatalog, "NavBar">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-dom/examples/demo/src/components/NavBarView.ts:12](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [play-dom/examples/demo/src/components/NavBarView.ts:12](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/examples/demo/src/components/NavBarView.ts#L12)
|
|
10
10
|
|
|
11
11
|
NavBarView — Catalog-typed NavBar component for DOM renderer.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const Navigation: ComponentFn<AuthCatalog, "Navigation">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-dom/examples/demo/src/components/Navigation.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [play-dom/examples/demo/src/components/Navigation.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/examples/demo/src/components/Navigation.ts#L9)
|
|
10
10
|
|
|
11
11
|
Navigation — Navigation status display. Catalog-typed DOM component
|
|
12
12
|
(ComponentFn<AuthCatalog, 'Navigation'>). Renders current path and auth
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const Overview: ComponentFn<AuthCatalog, "Overview">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-dom/examples/demo/src/components/Overview.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [play-dom/examples/demo/src/components/Overview.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/examples/demo/src/components/Overview.ts#L9)
|
|
10
10
|
|
|
11
11
|
Overview — Dashboard overview child route. Catalog-typed DOM component
|
|
12
12
|
(ComponentFn<AuthCatalog, 'Overview'>). Relative route resolves to
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const Profile: ComponentFn<AuthCatalog, "Profile">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-dom/examples/demo/src/components/Profile.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [play-dom/examples/demo/src/components/Profile.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/examples/demo/src/components/Profile.ts#L9)
|
|
10
10
|
|
|
11
11
|
Profile — Protected user profile page. Catalog-typed DOM component
|
|
12
12
|
(ComponentFn<AuthCatalog, 'Profile'>). Renders username from route params
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const Settings: ComponentFn<AuthCatalog, "Settings">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-dom/examples/demo/src/components/Settings.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [play-dom/examples/demo/src/components/Settings.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/examples/demo/src/components/Settings.ts#L9)
|
|
10
10
|
|
|
11
11
|
Settings — Protected settings page. Catalog-typed DOM component
|
|
12
12
|
(ComponentFn<AuthCatalog, 'Settings'>). Renders active section and username
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const Stats: ComponentFn<AuthCatalog, "Stats">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-dom/examples/demo/src/components/Stats.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [play-dom/examples/demo/src/components/Stats.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/examples/demo/src/components/Stats.ts#L9)
|
|
10
10
|
|
|
11
11
|
Stats — Dashboard stats child route. Catalog-typed DOM component
|
|
12
12
|
(ComponentFn<AuthCatalog, 'Stats'>). Relative route resolves to
|
|
@@ -169,4 +169,4 @@ const authCatalog: Catalog<
|
|
|
169
169
|
>;
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
-
Defined in: [play-dom/examples/demo/src/catalog.ts:5](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
172
|
+
Defined in: [play-dom/examples/demo/src/catalog.ts:5](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/examples/demo/src/catalog.ts#L5)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
[Examples](../../README.md) / @xmachines/play-dom-router-demo
|
|
2
2
|
|
|
3
|
+
<!-- generated-by: gsd-doc-writer -->
|
|
4
|
+
|
|
3
5
|
# @xmachines/play-dom-router-demo
|
|
4
6
|
|
|
5
7
|
Pure TypeScript integration demo for [`@xmachines/play-dom-router`](../../../api/@xmachines/play-dom-router/README.md) — actor-authoritative routing with the Browser History API and no framework.
|
|
@@ -27,8 +29,8 @@ Then open `http://localhost:5174`.
|
|
|
27
29
|
|
|
28
30
|
Use this order to understand the implementation:
|
|
29
31
|
|
|
30
|
-
1. `src/main.ts` looks up the host element, calls `initApp(app)` from `src/runtime.ts`, and registers unload cleanup.
|
|
31
|
-
2. `src/runtime.ts` creates the actor from the shared machine
|
|
32
|
+
1. `src/main.ts` looks up the host element (throws if absent), calls `initApp(app)` from `src/runtime.ts`, and registers unload cleanup.
|
|
33
|
+
2. `src/runtime.ts` creates the actor from the shared machine via `definePlayer`, starts it, initializes router sync via `initRouter(actor)`, mounts the shared DOM shell via `initShell(actor, host)`, and returns one cleanup function.
|
|
32
34
|
3. `initRouter(actor)` from `src/router.ts` extracts route metadata, creates a browser history wrapper, instantiates a router, and calls `connectRouter` to wire bidirectional actor ↔ URL sync.
|
|
33
35
|
4. `initShell(actor, host)` is imported from `@xmachines/play-dom-demo`, so the router demo reuses the shared DOM shell instead of duplicating the scaffold and renderer wiring.
|
|
34
36
|
5. Navigation buttons and links dispatch `play.route`, `auth.login`, and `auth.logout` events directly to the actor — no URL mutations from the shell.
|
|
@@ -37,12 +39,13 @@ Use this order to understand the implementation:
|
|
|
37
39
|
```ts
|
|
38
40
|
// src/main.ts (shape)
|
|
39
41
|
const app = document.getElementById("app");
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
42
|
+
if (!app) throw new Error("Root element not found");
|
|
43
|
+
|
|
44
|
+
const cleanup = initApp(app);
|
|
44
45
|
|
|
45
|
-
window.addEventListener("beforeunload", () =>
|
|
46
|
+
window.addEventListener("beforeunload", () => {
|
|
47
|
+
cleanup();
|
|
48
|
+
});
|
|
46
49
|
```
|
|
47
50
|
|
|
48
51
|
```ts
|
|
@@ -63,17 +66,20 @@ export function initRouter(actor) {
|
|
|
63
66
|
|
|
64
67
|
```ts
|
|
65
68
|
// src/runtime.ts (shape)
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
export function initApp(host: HTMLElement): () => void {
|
|
70
|
+
const createPlayer = definePlayer({ machine: authMachine });
|
|
71
|
+
const actor = createPlayer();
|
|
72
|
+
actor.start();
|
|
68
73
|
|
|
69
|
-
const cleanupRouter = initRouter(actor);
|
|
70
|
-
const cleanupShell = initShell(actor, host);
|
|
74
|
+
const cleanupRouter = initRouter(actor);
|
|
75
|
+
const cleanupShell = initShell(actor, host);
|
|
71
76
|
|
|
72
|
-
return () => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
};
|
|
77
|
+
return () => {
|
|
78
|
+
cleanupShell();
|
|
79
|
+
cleanupRouter();
|
|
80
|
+
actor.stop();
|
|
81
|
+
};
|
|
82
|
+
}
|
|
77
83
|
```
|
|
78
84
|
|
|
79
85
|
## Key Files
|
|
@@ -83,8 +89,7 @@ return () => {
|
|
|
83
89
|
- `src/router.ts` - `createBrowserHistory`, `createRouter`, and `connectRouter` wiring
|
|
84
90
|
- `@xmachines/play-dom-demo` - shared DOM shell, NavBar, DebugPanel, and renderer wiring reused by this router demo
|
|
85
91
|
- `test/library-pattern.test.ts` - architecture boundary and invariant assertions
|
|
86
|
-
- `test/browser/
|
|
87
|
-
- `test/browser/auth-flow.browser.test.ts` - login → dashboard → profile → logout browser flow
|
|
92
|
+
- `test/browser/shared-demo.browser.test.ts` - startup rendering and full auth route browser flow
|
|
88
93
|
|
|
89
94
|
## State Machine & Architecture Details
|
|
90
95
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
[Examples](../../README.md) / @xmachines/play-react-demo
|
|
2
2
|
|
|
3
|
+
<!-- generated-by: gsd-doc-writer -->
|
|
4
|
+
|
|
3
5
|
# @xmachines/play-react-demo
|
|
4
6
|
|
|
5
7
|
React renderer demo for [`@xmachines/play-react`](../../../api/@xmachines/play-react/README.md) — actor + `PlayRenderer` without a router.
|
|
@@ -42,46 +44,44 @@ createRoot(document.getElementById("root")!).render(<App />);
|
|
|
42
44
|
|
|
43
45
|
```tsx
|
|
44
46
|
// src/App.tsx (shape)
|
|
47
|
+
// Both actor and registryResult are module-scope singletons — created once,
|
|
48
|
+
// never recreated, no useMemo needed inside the component.
|
|
45
49
|
const actor: AuthActor = definePlayer({ machine: authMachine })();
|
|
46
50
|
actor.start();
|
|
47
51
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
actor.send({
|
|
68
|
-
type: "auth.login",
|
|
69
|
-
username: assertNonNullable(args, "args").username,
|
|
70
|
-
}),
|
|
71
|
-
logout: async () => actor.send({ type: "auth.logout" }),
|
|
72
|
-
route: async (args) => {
|
|
73
|
-
const { to, params } = assertNonNullable(args, "args");
|
|
74
|
-
actor.send({
|
|
75
|
-
type: "play.route",
|
|
76
|
-
to,
|
|
77
|
-
...(params != null && { params }),
|
|
78
|
-
});
|
|
79
|
-
},
|
|
80
|
-
},
|
|
52
|
+
const registryResult = defineRegistry(authCatalog, {
|
|
53
|
+
components: {
|
|
54
|
+
Home,
|
|
55
|
+
About,
|
|
56
|
+
Contact,
|
|
57
|
+
Login,
|
|
58
|
+
Dashboard,
|
|
59
|
+
Overview,
|
|
60
|
+
Stats,
|
|
61
|
+
Profile,
|
|
62
|
+
Settings,
|
|
63
|
+
Navigation,
|
|
64
|
+
NavBar: NavBarView,
|
|
65
|
+
},
|
|
66
|
+
actions: {
|
|
67
|
+
login: async (args) =>
|
|
68
|
+
actor.send({
|
|
69
|
+
type: "auth.login",
|
|
70
|
+
username: assertNonNullable(args, "args").username,
|
|
81
71
|
}),
|
|
82
|
-
|
|
83
|
-
|
|
72
|
+
logout: async () => actor.send({ type: "auth.logout" }),
|
|
73
|
+
route: async (args) => {
|
|
74
|
+
const { to, params } = assertNonNullable(args, "args");
|
|
75
|
+
actor.send({
|
|
76
|
+
type: "play.route",
|
|
77
|
+
to,
|
|
78
|
+
...(params != null && { params }),
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
});
|
|
84
83
|
|
|
84
|
+
export function App() {
|
|
85
85
|
return (
|
|
86
86
|
<div className="demo-app" data-demo-shell>
|
|
87
87
|
<header className="demo-header">
|
|
@@ -103,6 +103,7 @@ export function App() {
|
|
|
103
103
|
|
|
104
104
|
- `src/main.tsx` - React entry point that mounts `<App />`
|
|
105
105
|
- `src/App.tsx` - actor lifecycle, registry construction, and `PlayUIProvider` + `PlayRenderer` composition
|
|
106
|
+
- `src/catalog.ts` - catalog definition using `defineCatalog` from `@json-render/core` with `@json-render/react/schema`
|
|
106
107
|
- `src/components/` - demo view components bound to catalog component keys (Home, Login, Dashboard, Profile, etc.)
|
|
107
108
|
- `test/library-pattern.test.ts` - architecture boundary and invariant assertions
|
|
108
109
|
- `test/browser/renderer-demo.browser.test.tsx` - browser-mode renderer coverage
|
|
@@ -156,8 +157,8 @@ Expected result: library-pattern invariant tests pass and the browser renderer s
|
|
|
156
157
|
|
|
157
158
|
## Learn More
|
|
158
159
|
|
|
159
|
-
- [
|
|
160
|
-
- [React Router](../play-react-router-demo/README.md)
|
|
160
|
+
- [play-react](../../../api/@xmachines/play-react/README.md)
|
|
161
|
+
- [React Router demo](../play-react-router-demo/README.md)
|
|
161
162
|
|
|
162
163
|
## Type Aliases
|
|
163
164
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function App(): Element;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/examples/demo/src/App.tsx:
|
|
9
|
+
Defined in: [packages/play-react/examples/demo/src/App.tsx:68](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-react/examples/demo/src/App.tsx#L68)
|
|
10
10
|
|
|
11
11
|
## Returns
|
|
12
12
|
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
type AuthCatalog = typeof authCatalog;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/examples/demo/src/catalog.ts:6](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-react/examples/demo/src/catalog.ts:6](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-react/examples/demo/src/catalog.ts#L6)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const About: ComponentFn<AuthCatalog, "About">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/examples/demo/src/components/About.tsx:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-react/examples/demo/src/components/About.tsx:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-react/examples/demo/src/components/About.tsx#L10)
|
|
10
10
|
|
|
11
11
|
About — Public information page
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const Contact: ComponentFn<AuthCatalog, "Contact">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/examples/demo/src/components/Contact.tsx:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-react/examples/demo/src/components/Contact.tsx:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-react/examples/demo/src/components/Contact.tsx#L10)
|
|
10
10
|
|
|
11
11
|
Contact — Public contact page
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const Dashboard: ComponentFn<AuthCatalog, "Dashboard">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/examples/demo/src/components/Dashboard.tsx:12](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-react/examples/demo/src/components/Dashboard.tsx:12](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-react/examples/demo/src/components/Dashboard.tsx#L12)
|
|
10
10
|
|
|
11
11
|
Dashboard — Protected authenticated home
|
|
12
12
|
|
|
@@ -8,7 +8,7 @@ const DebugPanel: FC<{
|
|
|
8
8
|
}>;
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/play-react/examples/demo/src/components/DebugPanel.tsx:11](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
11
|
+
Defined in: [packages/play-react/examples/demo/src/components/DebugPanel.tsx:11](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-react/examples/demo/src/components/DebugPanel.tsx#L11)
|
|
12
12
|
|
|
13
13
|
DebugPanel — Live debug footer. Observes actor.state and actor.currentRoute
|
|
14
14
|
via useSignalEffect and displays current state value, can-logout status,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const Home: ComponentFn<AuthCatalog, "Home">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/examples/demo/src/components/Home.tsx:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-react/examples/demo/src/components/Home.tsx:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-react/examples/demo/src/components/Home.tsx#L10)
|
|
10
10
|
|
|
11
11
|
Home - Public landing page component
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const Login: ComponentFn<AuthCatalog, "Login">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/examples/demo/src/components/Login.tsx:14](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-react/examples/demo/src/components/Login.tsx:14](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-react/examples/demo/src/components/Login.tsx#L14)
|
|
10
10
|
|
|
11
11
|
Login — Authentication form
|
|
12
12
|
|
|
@@ -8,7 +8,7 @@ const NavBar: FC<{
|
|
|
8
8
|
}>;
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/play-react/examples/demo/src/components/NavBar.tsx:12](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
11
|
+
Defined in: [packages/play-react/examples/demo/src/components/NavBar.tsx:12](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-react/examples/demo/src/components/NavBar.tsx#L12)
|
|
12
12
|
|
|
13
13
|
NavBar — App-shell navigation component.
|
|
14
14
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const NavBarView: ComponentFn<AuthCatalog, "NavBar">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/examples/demo/src/components/NavBarView.tsx:11](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-react/examples/demo/src/components/NavBarView.tsx:11](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-react/examples/demo/src/components/NavBarView.tsx#L11)
|
|
10
10
|
|
|
11
11
|
NavBarView — Catalog-typed NavBar for use in defineRegistry components map.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const Navigation: ComponentFn<AuthCatalog, "Navigation">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/examples/demo/src/components/Navigation.tsx:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-react/examples/demo/src/components/Navigation.tsx:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-react/examples/demo/src/components/Navigation.tsx#L10)
|
|
10
10
|
|
|
11
11
|
Navigation - Status display component
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const Overview: ComponentFn<AuthCatalog, "Overview">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/examples/demo/src/components/Overview.tsx:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-react/examples/demo/src/components/Overview.tsx:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-react/examples/demo/src/components/Overview.tsx#L10)
|
|
10
10
|
|
|
11
11
|
Overview - Dashboard overview child route component
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const Profile: ComponentFn<AuthCatalog, "Profile">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/examples/demo/src/components/Profile.tsx:11](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-react/examples/demo/src/components/Profile.tsx:11](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-react/examples/demo/src/components/Profile.tsx#L11)
|
|
10
10
|
|
|
11
11
|
Profile — Protected user profile page
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const Settings: ComponentFn<AuthCatalog, "Settings">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/examples/demo/src/components/Settings.tsx:11](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-react/examples/demo/src/components/Settings.tsx:11](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-react/examples/demo/src/components/Settings.tsx#L11)
|
|
10
10
|
|
|
11
11
|
Settings — Protected settings page
|
|
12
12
|
|
|
@@ -10,7 +10,7 @@ const Shell: FC<{
|
|
|
10
10
|
}>;
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
Defined in: [packages/play-react/examples/demo/src/components/Shell.tsx:14](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
13
|
+
Defined in: [packages/play-react/examples/demo/src/components/Shell.tsx:14](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-react/examples/demo/src/components/Shell.tsx#L14)
|
|
14
14
|
|
|
15
15
|
Demo Shell layout component.
|
|
16
16
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const Stats: ComponentFn<AuthCatalog, "Stats">;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/examples/demo/src/components/Stats.tsx:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-react/examples/demo/src/components/Stats.tsx:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-react/examples/demo/src/components/Stats.tsx#L10)
|
|
10
10
|
|
|
11
11
|
Stats - Dashboard stats child route component
|
|
12
12
|
|
|
@@ -169,4 +169,4 @@ const authCatalog: Catalog<
|
|
|
169
169
|
>;
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
-
Defined in: [packages/play-react/examples/demo/src/catalog.ts:5](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
172
|
+
Defined in: [packages/play-react/examples/demo/src/catalog.ts:5](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-react/examples/demo/src/catalog.ts#L5)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
[Examples](../../README.md) / @xmachines/play-react-router-demo
|
|
2
2
|
|
|
3
|
+
<!-- generated-by: gsd-doc-writer -->
|
|
4
|
+
|
|
3
5
|
# @xmachines/play-react-router-demo
|
|
4
6
|
|
|
5
7
|
React Router v7 integration demo for the XMachines Play architecture.
|
|
@@ -10,7 +12,7 @@ React Router v7 integration demo for the XMachines Play architecture.
|
|
|
10
12
|
- `PlayRouterProvider` renderer-based integration with React Router
|
|
11
13
|
- Shell-driven rendering via `PlayRenderer` with actor-authoritative navigation
|
|
12
14
|
- Canonical TC39 Signals lifecycle mapped to React's rendering loop
|
|
13
|
-
-
|
|
15
|
+
- Browser E2E coverage via a shared demo browser suite
|
|
14
16
|
|
|
15
17
|
## Running the Demo
|
|
16
18
|
|
|
@@ -28,71 +30,73 @@ Then open `http://localhost:5173`.
|
|
|
28
30
|
Use this order to understand the implementation:
|
|
29
31
|
|
|
30
32
|
1. `src/main.tsx` mounts `<App />`.
|
|
31
|
-
2. `src/App.tsx` calls `useMemo(createAppRuntime, [])` to create the actor
|
|
32
|
-
3. `
|
|
33
|
-
4. `createAppRuntime()`
|
|
34
|
-
5. `PlayRouterProvider` wires actor navigation and router changes in both directions
|
|
35
|
-
6. `Shell` (inside `App.tsx`) receives
|
|
36
|
-
7. `
|
|
37
|
-
8. Browser tests in `test/browser/` validate startup and auth navigation flow.
|
|
33
|
+
2. `src/App.tsx` calls `useMemo(createAppRuntime, [])` to create the actor and browser router, starting the actor once per mounted app.
|
|
34
|
+
3. `src/runtime.ts` pre-builds the `routeMap` (via `createRouteMap(authMachine)`) and exports `createPlayer`, `routeMap`, and `createRegistryResult` — keeping runtime setup separate from React lifecycle concerns.
|
|
35
|
+
4. `createAppRuntime()` creates the actor, builds a `registryResult` from the registry, and constructs a React Router data router with a `RoutedShell` wrapper.
|
|
36
|
+
5. `PlayRouterProvider` wires actor navigation and router changes in both directions, using the pre-built `routeMap`.
|
|
37
|
+
6. `Shell` (inside `App.tsx`) receives `actor`, `router`, and `registryResult`, matching the other router demos.
|
|
38
|
+
7. The `renderer` prop renders `<RouterProvider router={currentRouter} />` directly — no intermediate `ReactRouterApp` wrapper is needed.
|
|
39
|
+
8. Browser tests in `test/browser/` validate startup and auth navigation flow via a shared demo suite.
|
|
38
40
|
|
|
39
41
|
```tsx
|
|
40
42
|
// src/main.tsx (shape)
|
|
41
43
|
createRoot(document.getElementById("root")!).render(<App />);
|
|
42
44
|
```
|
|
43
45
|
|
|
46
|
+
```ts
|
|
47
|
+
// src/runtime.ts (shape)
|
|
48
|
+
export const createPlayer = definePlayer({ machine: authMachine });
|
|
49
|
+
export const routeMap = createRouteMap(authMachine);
|
|
50
|
+
|
|
51
|
+
export function createRegistryResult(actor: ReturnType<typeof createPlayer>) {
|
|
52
|
+
return defineRegistry(authCatalog, {
|
|
53
|
+
components: { Home, About, Contact, Login, Dashboard /* … */ },
|
|
54
|
+
actions: {
|
|
55
|
+
login: async (args) => actor.send({ type: "auth.login", username: args.username }),
|
|
56
|
+
logout: async () => actor.send({ type: "auth.logout" }),
|
|
57
|
+
route: async (args) => actor.send({ type: "play.route", to: args.to }),
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
44
63
|
```tsx
|
|
45
64
|
// src/App.tsx (shape)
|
|
46
65
|
function createAppRuntime() {
|
|
47
66
|
const actor = createPlayer();
|
|
48
67
|
actor.start();
|
|
49
68
|
|
|
50
|
-
const
|
|
51
|
-
const routeMap = createRouteMapFromTree(routeTree);
|
|
69
|
+
const registryResult = createRegistryResult(actor);
|
|
52
70
|
|
|
53
|
-
let router;
|
|
71
|
+
let router!: BrowserRouterInstance;
|
|
54
72
|
|
|
55
73
|
function RoutedShell() {
|
|
56
|
-
return <Shell actor={actor} router={router} />;
|
|
74
|
+
return <Shell actor={actor} router={router} registryResult={registryResult} />;
|
|
57
75
|
}
|
|
58
76
|
|
|
59
77
|
router = createBrowserRouter([{ path: "*", element: <RoutedShell /> }]);
|
|
60
78
|
|
|
61
|
-
return { actor,
|
|
79
|
+
return { actor, router };
|
|
62
80
|
}
|
|
63
81
|
|
|
64
|
-
const { actor,
|
|
82
|
+
const { actor, router } = useMemo(createAppRuntime, []);
|
|
65
83
|
|
|
66
84
|
return (
|
|
67
85
|
<PlayRouterProvider
|
|
68
86
|
actor={actor}
|
|
69
87
|
router={router}
|
|
70
88
|
routeMap={routeMap}
|
|
71
|
-
renderer={(
|
|
72
|
-
<ReactRouterApp actor={currentActor} router={currentRouter} />
|
|
73
|
-
)}
|
|
89
|
+
renderer={(_, currentRouter) => <RouterProvider router={currentRouter} />}
|
|
74
90
|
/>
|
|
75
91
|
);
|
|
76
92
|
```
|
|
77
93
|
|
|
78
|
-
```tsx
|
|
79
|
-
// src/components/Login.tsx (shape)
|
|
80
|
-
export function Login() {
|
|
81
|
-
return (
|
|
82
|
-
<button onClick={() => actor.send({ type: "auth.login", username, password })}>
|
|
83
|
-
Login
|
|
84
|
-
</button>
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
94
|
## Key Files
|
|
90
95
|
|
|
91
96
|
- `src/main.tsx` - React entry point that mounts `<App />`
|
|
92
|
-
- `src/
|
|
93
|
-
- `src/
|
|
94
|
-
- `test/browser/
|
|
95
|
-
- `test/browser/auth-flow.browser.test.tsx` - end-to-end login -> dashboard -> profile -> logout flow
|
|
97
|
+
- `src/runtime.ts` - actor factory (`createPlayer`), pre-built `routeMap`, and `createRegistryResult` registry wiring
|
|
98
|
+
- `src/App.tsx` - actor lifecycle, provider wiring, and `RoutedShell` composition
|
|
99
|
+
- `test/browser/shared-demo.browser.test.tsx` - browser E2E suite for startup and auth navigation flow
|
|
96
100
|
|
|
97
101
|
## State Machine & Architecture Details
|
|
98
102
|
|
|
@@ -116,7 +120,7 @@ Watcher notifications are one-shot. Cleanup is explicit: bridge/provider teardow
|
|
|
116
120
|
|
|
117
121
|
## Adapter Boundaries
|
|
118
122
|
|
|
119
|
-
`PlayRouterProvider` and the React Router bridge stay passive infrastructure. Business validity remains actor-owned, while `RouterBridgeBase` remains the shared policy layer and the concrete React adapter stays a thin port, delegating DOM synchronization to React Router. The demo keeps the same `Shell(actor, router)` shape as the other router demos, with `
|
|
123
|
+
`PlayRouterProvider` and the React Router bridge stay passive infrastructure. Business validity remains actor-owned, while `RouterBridgeBase` remains the shared policy layer and the concrete React adapter stays a thin port, delegating DOM synchronization to React Router. The demo keeps the same `Shell(actor, router, registryResult)` shape as the other router demos, with `RouterProvider` rendered directly inside the `renderer` callback — no additional wrapper component is required.
|
|
120
124
|
|
|
121
125
|
## Available Scripts
|
|
122
126
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
[Examples](../../README.md) / @xmachines/play-solid-demo
|
|
2
2
|
|
|
3
|
+
<!-- generated-by: gsd-doc-writer -->
|
|
4
|
+
|
|
3
5
|
# @xmachines/play-solid-demo
|
|
4
6
|
|
|
5
7
|
Solid renderer demo for [`@xmachines/play-solid`](../../../api/@xmachines/play-solid/README.md) — actor + `PlayRenderer` without a router.
|
|
@@ -28,7 +30,7 @@ Then open `http://localhost:5173`.
|
|
|
28
30
|
Use this order to understand the implementation:
|
|
29
31
|
|
|
30
32
|
1. `src/main.tsx` mounts `<App />` to the DOM root via Solid's `render`.
|
|
31
|
-
2. `src/App.tsx` creates the actor at module scope via `definePlayer({ machine: authMachine })
|
|
33
|
+
2. `src/App.tsx` creates the actor at module scope via `definePlayer({ machine: authMachine })` then calls the returned factory to produce the actor and starts it.
|
|
32
34
|
3. `defineRegistry(authCatalog, { components, actions })` builds the typed `registryResult` inside `createMemo` — real async action handlers dispatching to `actor.send()`.
|
|
33
35
|
4. `<PlayUIProvider actor={actor} registryResult={registryResult()}><PlayRenderer /></PlayUIProvider>` observes `actor.currentView` and renders the active spec.
|
|
34
36
|
5. A `NavBar` component observes `actor` signals directly for nav visibility.
|
|
@@ -42,7 +44,8 @@ render(() => <App />, document.getElementById("app")!);
|
|
|
42
44
|
|
|
43
45
|
```tsx
|
|
44
46
|
// src/App.tsx (shape)
|
|
45
|
-
const
|
|
47
|
+
const createPlayer = definePlayer({ machine: authMachine });
|
|
48
|
+
const actor = createPlayer() as AuthActor;
|
|
46
49
|
actor.start();
|
|
47
50
|
|
|
48
51
|
export function App() {
|