@xmachines/docs 1.0.0-beta.27 → 1.0.0-beta.29
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/api/@xmachines/play/README.md +4 -4
- package/api/@xmachines/play/classes/PlayError.md +4 -4
- package/api/@xmachines/play/type-aliases/PlayEvent.md +3 -3
- package/api/@xmachines/play-actor/README.md +6 -6
- 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/PlaySpec.md +2 -2
- package/api/@xmachines/play-actor/interfaces/Routable.md +3 -3
- package/api/@xmachines/play-actor/interfaces/ViewMetadata.md +3 -3
- package/api/@xmachines/play-actor/interfaces/Viewable.md +2 -2
- package/api/@xmachines/play-dom/README.md +50 -0
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +4 -4
- package/api/@xmachines/play-dom/functions/connectRenderer.md +1 -1
- package/api/@xmachines/play-dom/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-dom/functions/renderSpec.md +1 -1
- package/api/@xmachines/play-dom/interfaces/ComponentContext.md +7 -7
- package/api/@xmachines/play-dom/interfaces/ConnectRendererOptions.md +7 -7
- package/api/@xmachines/play-dom/interfaces/DefineRegistryOptions.md +3 -3
- package/api/@xmachines/play-dom/interfaces/DefineRegistryResult.md +3 -3
- package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +7 -7
- package/api/@xmachines/play-dom/interfaces/EventHandle.md +4 -4
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +3 -3
- 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/DomComponentRenderer.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +1 -1
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createRouter.md +1 -1
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +4 -4
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +7 -7
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMapLike.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +4 -4
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +4 -4
- package/api/@xmachines/play-dom-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-react/README.md +1 -1
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +5 -5
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
- 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/PlayRendererProps.md +7 -7
- package/api/@xmachines/play-react/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-react-router/README.md +3 -3
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +23 -23
- package/api/@xmachines/play-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +7 -7
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +4 -4
- package/api/@xmachines/play-router/README.md +6 -6
- package/api/@xmachines/play-router/classes/BaseRouteMap.md +4 -4
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +23 -23
- package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +1 -1
- package/api/@xmachines/play-router/functions/buildRouteTree.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMapFromMachine.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/extractQuery.md +1 -1
- package/api/@xmachines/play-router/functions/extractRouteParams.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteById.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteByPath.md +1 -1
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/isRouteReachable.md +1 -1
- package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
- package/api/@xmachines/play-router/functions/routeExists.md +1 -1
- package/api/@xmachines/play-router/functions/sanitizePathname.md +1 -1
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +1 -1
- package/api/@xmachines/play-router/functions/validateStateExists.md +1 -1
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +4 -4
- package/api/@xmachines/play-router/interfaces/LocationLike.md +3 -3
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +3 -3
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +5 -5
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +7 -7
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +8 -8
- package/api/@xmachines/play-router/interfaces/RouteMap.md +4 -4
- 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/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 +4 -4
- 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 +2 -2
- 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 +3 -3
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/interfaces/PlayRendererProps.md +7 -7
- package/api/@xmachines/play-solid/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-solid-router/README.md +1 -1
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +24 -24
- package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +3 -3
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +7 -7
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +4 -4
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
- package/api/@xmachines/play-svelte/interfaces/PlayRendererProps.md +7 -7
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +4 -4
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +7 -7
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +4 -4
- 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/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +4 -4
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +7 -7
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +4 -4
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/README.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +23 -23
- package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +7 -7
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +5 -5
- 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 +4 -4
- 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 +5 -5
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +24 -24
- package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +7 -7
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +3 -3
- package/api/@xmachines/play-vue/README.md +1 -1
- 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/interfaces/PlayRendererProps.md +5 -5
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
- package/api/@xmachines/play-vue/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue-router/README.md +1 -1
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-vue-router/classes/VueBaseRouteMap.md +4 -4
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +24 -24
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +7 -7
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +4 -4
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-xstate/README.md +10 -10
- 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 +2 -2
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +2 -2
- package/api/@xmachines/play-xstate/functions/eventMatches.md +1 -1
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +1 -1
- package/api/@xmachines/play-xstate/functions/hasContext.md +1 -1
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +1 -1
- package/api/@xmachines/play-xstate/functions/negateGuard.md +1 -1
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +3 -3
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +2 -2
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +6 -6
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +5 -5
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +4 -4
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +4 -4
- package/api/@xmachines/shared/functions/defineXmVitestConfig.md +1 -1
- package/api/@xmachines/shared/functions/xmAliases.md +1 -1
- package/api/README.md +1 -37
- package/api/llms.txt +4 -11
- package/examples/@xmachines/play-actor-shared/README.md +155 -0
- package/examples/@xmachines/play-actor-shared/interfaces/AuthContext.md +14 -0
- package/examples/@xmachines/play-actor-shared/type-aliases/AuthActor.md +27 -0
- package/examples/@xmachines/play-actor-shared/type-aliases/AuthCatalog.md +16 -0
- package/examples/@xmachines/play-actor-shared/type-aliases/AuthEvents.md +17 -0
- package/examples/@xmachines/play-actor-shared/type-aliases/AuthInput.md +9 -0
- package/examples/@xmachines/play-actor-shared/type-aliases/AuthSnapshot.md +11 -0
- package/examples/@xmachines/play-actor-shared/type-aliases/CatalogProps.md +187 -0
- package/examples/@xmachines/play-actor-shared/type-aliases/InferProps.md +17 -0
- package/examples/@xmachines/play-actor-shared/variables/authCatalog.md +173 -0
- package/examples/@xmachines/play-actor-shared/variables/authMachine.md +189 -0
- package/examples/@xmachines/play-actor-shared/variables/authSetup.md +22 -0
- package/examples/@xmachines/play-dom-demo/README.md +145 -0
- package/examples/@xmachines/play-dom-demo/functions/initShell.md +20 -0
- package/examples/@xmachines/play-dom-demo/variables/About.md +9 -0
- package/examples/@xmachines/play-dom-demo/variables/Contact.md +9 -0
- package/examples/@xmachines/play-dom-demo/variables/Dashboard.md +9 -0
- package/examples/@xmachines/play-dom-demo/variables/Home.md +9 -0
- package/examples/@xmachines/play-dom-demo/variables/Login.md +9 -0
- package/examples/@xmachines/play-dom-demo/variables/Navigation.md +9 -0
- package/examples/@xmachines/play-dom-demo/variables/Overview.md +9 -0
- package/examples/@xmachines/play-dom-demo/variables/Profile.md +9 -0
- package/examples/@xmachines/play-dom-demo/variables/Settings.md +9 -0
- package/examples/@xmachines/play-dom-demo/variables/Stats.md +9 -0
- package/{api → examples}/@xmachines/play-dom-router-demo/README.md +13 -13
- package/examples/@xmachines/play-react-demo/README.md +173 -0
- package/examples/@xmachines/play-react-demo/functions/App.md +13 -0
- package/examples/@xmachines/play-react-demo/functions/DebugPanel.md +20 -0
- package/examples/@xmachines/play-react-demo/functions/HeaderNav.md +20 -0
- package/examples/@xmachines/play-react-demo/functions/Shell.md +22 -0
- package/examples/@xmachines/play-react-demo/variables/About.md +9 -0
- package/examples/@xmachines/play-react-demo/variables/Contact.md +9 -0
- package/examples/@xmachines/play-react-demo/variables/Dashboard.md +9 -0
- package/examples/@xmachines/play-react-demo/variables/Home.md +9 -0
- package/examples/@xmachines/play-react-demo/variables/Login.md +9 -0
- package/examples/@xmachines/play-react-demo/variables/Navigation.md +9 -0
- package/examples/@xmachines/play-react-demo/variables/Overview.md +9 -0
- package/examples/@xmachines/play-react-demo/variables/Profile.md +9 -0
- package/examples/@xmachines/play-react-demo/variables/Settings.md +9 -0
- package/examples/@xmachines/play-react-demo/variables/Stats.md +9 -0
- package/{api → examples}/@xmachines/play-react-router-demo/README.md +12 -12
- package/examples/@xmachines/play-router-shared/README.md +111 -0
- package/examples/@xmachines/play-router-shared/test/auth-machine-routing.test.ts/README.md +3 -0
- package/examples/@xmachines/play-router-shared/test/demo-browser-suite.ts/README.md +11 -0
- package/examples/@xmachines/play-router-shared/test/demo-browser-suite.ts/functions/defineSharedDemoBrowserSuite.md +19 -0
- package/examples/@xmachines/play-router-shared/test/demo-browser-suite.ts/variables/defineRouterDemoBrowserSuite.md +19 -0
- package/examples/@xmachines/play-router-shared/test/env.d.ts/README.md +8 -0
- package/examples/@xmachines/play-router-shared/test/env.d.ts/interfaces/ImportMeta.md +63 -0
- package/examples/@xmachines/play-router-shared/test/env.d.ts/interfaces/ImportMetaEnv.md +32 -0
- package/examples/@xmachines/play-solid-demo/README.md +159 -0
- package/examples/@xmachines/play-solid-demo/functions/App.md +13 -0
- package/examples/@xmachines/play-solid-demo/functions/DebugPanel.md +20 -0
- package/examples/@xmachines/play-solid-demo/functions/HeaderNav.md +20 -0
- package/examples/@xmachines/play-solid-demo/functions/Shell.md +22 -0
- package/examples/@xmachines/play-solid-demo/variables/About.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Contact.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Dashboard.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Home.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Login.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Navigation.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Overview.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Profile.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Settings.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Stats.md +9 -0
- package/{api → examples}/@xmachines/play-solid-router-demo/README.md +13 -13
- package/examples/@xmachines/play-svelte-demo/README.md +127 -0
- package/{api → examples}/@xmachines/play-svelte-spa-router-demo/README.md +12 -13
- package/{api → examples}/@xmachines/play-sveltekit-router-demo/README.md +12 -13
- package/{api → examples}/@xmachines/play-tanstack-react-router-demo/README.md +13 -13
- package/{api → examples}/@xmachines/play-tanstack-solid-router-demo/README.md +14 -14
- package/examples/@xmachines/play-vue-demo/README.md +145 -0
- package/{api → examples}/@xmachines/play-vue-router-demo/README.md +12 -12
- package/examples/README.md +51 -27
- package/package.json +6 -4
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[Documentation](../../../../../README.md) / [@xmachines/play-router-shared](../../../README.md) / [test/env.d.ts](../README.md) / ImportMetaEnv
|
|
2
|
+
|
|
3
|
+
# Interface: ImportMetaEnv
|
|
4
|
+
|
|
5
|
+
Defined in: `vite`
|
|
6
|
+
|
|
7
|
+
Custom environment variables for the shared demo browser suite.
|
|
8
|
+
|
|
9
|
+
## See
|
|
10
|
+
|
|
11
|
+
packages/play-router/examples/shared/test/demo-browser-suite.ts
|
|
12
|
+
|
|
13
|
+
## Extends
|
|
14
|
+
|
|
15
|
+
- `Record`\<`ImportMetaEnvFallbackKey`, `any`\>
|
|
16
|
+
|
|
17
|
+
## Indexable
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
[key: string]: any
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Properties
|
|
24
|
+
|
|
25
|
+
| Property | Modifier | Type | Description | Defined in |
|
|
26
|
+
| ------------------------------------------------------------------------ | ---------- | --------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
27
|
+
| <a id="property-base_url"></a> `BASE_URL` | `public` | `string` | - | - |
|
|
28
|
+
| <a id="property-dev"></a> `DEV` | `public` | `boolean` | - | - |
|
|
29
|
+
| <a id="property-mode"></a> `MODE` | `public` | `string` | - | - |
|
|
30
|
+
| <a id="property-prod"></a> `PROD` | `public` | `boolean` | - | - |
|
|
31
|
+
| <a id="property-ssr"></a> `SSR` | `public` | `boolean` | - | - |
|
|
32
|
+
| <a id="property-vite_enable_screenshots"></a> `VITE_ENABLE_SCREENSHOTS?` | `readonly` | `string` | Set to any truthy string to enable screenshot capture during browser tests. | [packages/play-router/examples/shared/test/env.d.ts:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.29/packages/play-router/examples/shared/test/env.d.ts#L10) |
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
[Documentation](../../README.md) / @xmachines/play-solid-demo
|
|
2
|
+
|
|
3
|
+
# SolidJS Demo
|
|
4
|
+
|
|
5
|
+
Solid renderer demo for `@xmachines/play-solid` — actor + `PlayRenderer` without a router.
|
|
6
|
+
|
|
7
|
+
## What This Demonstrates
|
|
8
|
+
|
|
9
|
+
- Shared auth machine reused without framework-specific business logic
|
|
10
|
+
- `PlayRenderer` rendering actor-projected views with a typed `defineRegistry` catalog
|
|
11
|
+
- Auth machine states drive view switching via `auth.login` / `auth.logout` events only — no URL routing
|
|
12
|
+
- Canonical TC39 Signals lifecycle integrated with Solid's fine-grained reactivity
|
|
13
|
+
- Non-browser invariant tests plus browser renderer coverage
|
|
14
|
+
|
|
15
|
+
## Running the Demo
|
|
16
|
+
|
|
17
|
+
From the repository root:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install
|
|
21
|
+
npm run dev -w @xmachines/play-solid-demo
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Then open `http://localhost:5173`.
|
|
25
|
+
|
|
26
|
+
## Step-by-Step Code Flow
|
|
27
|
+
|
|
28
|
+
Use this order to understand the implementation:
|
|
29
|
+
|
|
30
|
+
1. `src/main.tsx` mounts `<App />` to the DOM root via Solid's `render`.
|
|
31
|
+
2. `src/App.tsx` calls `definePlayer({ machine: authMachine })` and starts the actor at module scope.
|
|
32
|
+
3. `defineRegistry(authCatalog, { components, actions })` builds the typed component registry.
|
|
33
|
+
4. `<PlayRenderer actor={actor} registry={registry} actions={...} />` observes actor view signals and renders the current component.
|
|
34
|
+
5. `onCleanup` calls `actor.stop()` when the `App` component is disposed.
|
|
35
|
+
6. Browser tests in `test/browser/` validate startup and interaction behavior.
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
// src/main.tsx (shape)
|
|
39
|
+
render(() => <App />, document.getElementById("app")!);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
// src/App.tsx (shape)
|
|
44
|
+
const createPlayer = definePlayer({ machine: authMachine });
|
|
45
|
+
const actor = createPlayer() as AuthActor;
|
|
46
|
+
actor.start();
|
|
47
|
+
|
|
48
|
+
const { registry } = defineRegistry(authCatalog, {
|
|
49
|
+
components: {
|
|
50
|
+
Home,
|
|
51
|
+
About,
|
|
52
|
+
Contact,
|
|
53
|
+
Login,
|
|
54
|
+
Dashboard,
|
|
55
|
+
Overview,
|
|
56
|
+
Stats,
|
|
57
|
+
Profile,
|
|
58
|
+
Settings,
|
|
59
|
+
Navigation,
|
|
60
|
+
},
|
|
61
|
+
actions: { login: async () => {}, logout: async () => {} },
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export function App() {
|
|
65
|
+
onCleanup(() => {
|
|
66
|
+
actor.stop();
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<main class="demo-content" data-demo-content>
|
|
71
|
+
<PlayRenderer
|
|
72
|
+
actor={actor}
|
|
73
|
+
registry={registry}
|
|
74
|
+
actions={{ login: "auth.login", logout: "auth.logout" }}
|
|
75
|
+
/>
|
|
76
|
+
</main>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Key Files
|
|
82
|
+
|
|
83
|
+
- `src/main.tsx` - Vite bootstrap that mounts `<App />` via Solid's `render`
|
|
84
|
+
- `src/App.tsx` - actor lifecycle, registry construction, and `PlayRenderer` composition
|
|
85
|
+
- `src/components/` - demo view components bound to catalog component keys (Home, Login, Dashboard, Profile, etc.)
|
|
86
|
+
- `test/library-pattern.test.ts` - architecture boundary and invariant assertions
|
|
87
|
+
- `test/browser/renderer-demo.browser.test.tsx` - browser-mode renderer coverage
|
|
88
|
+
|
|
89
|
+
## State Machine & Architecture Details
|
|
90
|
+
|
|
91
|
+
The demo utilizes XMachines architectural invariants:
|
|
92
|
+
|
|
93
|
+
1. **Actor Authority:** View components dispatch `auth.login` and `auth.logout` events to the actor. The actor evaluates guards and transitions — Solid never decides which view to render.
|
|
94
|
+
2. **Passive Infrastructure:** `PlayRenderer` observes `actor.currentView` signals only. It holds no business state and makes no routing decisions.
|
|
95
|
+
3. **Signal-Only Reactivity:** Instead of React-like re-renders, Solid uses fine-grained `createEffect` internally within the renderer to react precisely when actor signals update.
|
|
96
|
+
|
|
97
|
+
## Watcher Lifecycle and Cleanup Contract
|
|
98
|
+
|
|
99
|
+
This demo follows the canonical watcher lifecycle used across all `@xmachines` framework adapters:
|
|
100
|
+
|
|
101
|
+
1. `notify`
|
|
102
|
+
2. `queueMicrotask`
|
|
103
|
+
3. `getPending()`
|
|
104
|
+
4. Read actor signals and project Solid-local render state
|
|
105
|
+
5. Re-arm with `watch()`/`watch(...signals)`
|
|
106
|
+
|
|
107
|
+
Watcher notifications are one-shot. Cleanup is explicit and lifecycle-bound: Solid teardown uses `onCleanup`, and `PlayRenderer` handles internal watcher teardown natively on disposal.
|
|
108
|
+
|
|
109
|
+
## Adapter Boundaries
|
|
110
|
+
|
|
111
|
+
`PlayRenderer` and `defineRegistry` stay passive infrastructure. Business validity remains actor-owned. The registry maps catalog component keys to Solid component implementations — the actor owns which key is active. The demo intentionally omits URL routing to isolate the renderer contract.
|
|
112
|
+
|
|
113
|
+
## Available Scripts
|
|
114
|
+
|
|
115
|
+
These commands are defined in `package.json`:
|
|
116
|
+
|
|
117
|
+
| Command | Description |
|
|
118
|
+
| ---------------------------------------------------- | -------------------------------- |
|
|
119
|
+
| `npm run dev -w @xmachines/play-solid-demo` | Start Vite dev server |
|
|
120
|
+
| `npm run build -w @xmachines/play-solid-demo` | Build production bundle |
|
|
121
|
+
| `npm run preview -w @xmachines/play-solid-demo` | Preview built bundle |
|
|
122
|
+
| `npm run test -w @xmachines/play-solid-demo` | Run Vitest test suite |
|
|
123
|
+
| `npm run test:browser -w @xmachines/play-solid-demo` | Run browser-focused Vitest suite |
|
|
124
|
+
|
|
125
|
+
## Verification
|
|
126
|
+
|
|
127
|
+
Use these checks to validate README claims against the current demo implementation:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
npm run test -w @xmachines/play-solid-demo
|
|
131
|
+
npm run test:browser -w @xmachines/play-solid-demo
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Expected result: library-pattern invariant tests pass and the browser renderer suite completes.
|
|
135
|
+
|
|
136
|
+
## Learn More
|
|
137
|
+
|
|
138
|
+
- [SolidJS package README](../../README.md)
|
|
139
|
+
- [Solid Router demo README](../../../play-solid-router/examples/demo/README.md)
|
|
140
|
+
|
|
141
|
+
## Variables
|
|
142
|
+
|
|
143
|
+
- [About](variables/About.md)
|
|
144
|
+
- [Contact](variables/Contact.md)
|
|
145
|
+
- [Dashboard](variables/Dashboard.md)
|
|
146
|
+
- [Home](variables/Home.md)
|
|
147
|
+
- [Login](variables/Login.md)
|
|
148
|
+
- [Navigation](variables/Navigation.md)
|
|
149
|
+
- [Overview](variables/Overview.md)
|
|
150
|
+
- [Profile](variables/Profile.md)
|
|
151
|
+
- [Settings](variables/Settings.md)
|
|
152
|
+
- [Stats](variables/Stats.md)
|
|
153
|
+
|
|
154
|
+
## Functions
|
|
155
|
+
|
|
156
|
+
- [App](functions/App.md)
|
|
157
|
+
- [DebugPanel](functions/DebugPanel.md)
|
|
158
|
+
- [HeaderNav](functions/HeaderNav.md)
|
|
159
|
+
- [Shell](functions/Shell.md)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-solid-demo](../README.md) / App
|
|
2
|
+
|
|
3
|
+
# Function: App()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function App(): Element;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [App.tsx:55](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.29/packages/play-solid/examples/demo/src/App.tsx#L55)
|
|
10
|
+
|
|
11
|
+
## Returns
|
|
12
|
+
|
|
13
|
+
`Element`
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-solid-demo](../README.md) / DebugPanel
|
|
2
|
+
|
|
3
|
+
# Function: DebugPanel()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function DebugPanel(props): Element;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [components/DebugPanel.tsx:5](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.29/packages/play-solid/examples/demo/src/components/DebugPanel.tsx#L5)
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
| Parameter | Type |
|
|
14
|
+
| ------------- | -------------------------------------------------------------------------------- |
|
|
15
|
+
| `props` | \{ `actor`: [`AuthActor`](../../play-actor-shared/type-aliases/AuthActor.md); \} |
|
|
16
|
+
| `props.actor` | [`AuthActor`](../../play-actor-shared/type-aliases/AuthActor.md) |
|
|
17
|
+
|
|
18
|
+
## Returns
|
|
19
|
+
|
|
20
|
+
`Element`
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-solid-demo](../README.md) / HeaderNav
|
|
2
|
+
|
|
3
|
+
# Function: HeaderNav()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function HeaderNav(props): Element;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [components/HeaderNav.tsx:5](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.29/packages/play-solid/examples/demo/src/components/HeaderNav.tsx#L5)
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
| Parameter | Type |
|
|
14
|
+
| ------------- | -------------------------------------------------------------------------------- |
|
|
15
|
+
| `props` | \{ `actor`: [`AuthActor`](../../play-actor-shared/type-aliases/AuthActor.md); \} |
|
|
16
|
+
| `props.actor` | [`AuthActor`](../../play-actor-shared/type-aliases/AuthActor.md) |
|
|
17
|
+
|
|
18
|
+
## Returns
|
|
19
|
+
|
|
20
|
+
`Element`
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-solid-demo](../README.md) / Shell
|
|
2
|
+
|
|
3
|
+
# Function: Shell()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function Shell(props): Element;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Shell.tsx:7](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.29/packages/play-solid/examples/demo/src/components/Shell.tsx#L7)
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
| Parameter | Type | Description |
|
|
14
|
+
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
15
|
+
| `props` | \{ `actor`: [`AuthActor`](../../play-actor-shared/type-aliases/AuthActor.md); `registry`: `ComponentRegistry`; `router?`: `unknown`; \} | - |
|
|
16
|
+
| `props.actor` | [`AuthActor`](../../play-actor-shared/type-aliases/AuthActor.md) | - |
|
|
17
|
+
| `props.registry` | `ComponentRegistry` | - |
|
|
18
|
+
| `props.router?` | `unknown` | Bridged router instance — accepted for prop parity with router demos but unused. |
|
|
19
|
+
|
|
20
|
+
## Returns
|
|
21
|
+
|
|
22
|
+
`Element`
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-solid-demo](../README.md) / About
|
|
2
|
+
|
|
3
|
+
# Variable: About
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const About: ComponentFn<AuthCatalog, "About">;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [components/About.tsx:4](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.29/packages/play-solid/examples/demo/src/components/About.tsx#L4)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-solid-demo](../README.md) / Contact
|
|
2
|
+
|
|
3
|
+
# Variable: Contact
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const Contact: ComponentFn<AuthCatalog, "Contact">;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Contact.tsx:4](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.29/packages/play-solid/examples/demo/src/components/Contact.tsx#L4)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-solid-demo](../README.md) / Dashboard
|
|
2
|
+
|
|
3
|
+
# Variable: Dashboard
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const Dashboard: ComponentFn<AuthCatalog, "Dashboard">;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Dashboard.tsx:4](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.29/packages/play-solid/examples/demo/src/components/Dashboard.tsx#L4)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-solid-demo](../README.md) / Home
|
|
2
|
+
|
|
3
|
+
# Variable: Home
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const Home: ComponentFn<AuthCatalog, "Home">;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Home.tsx:4](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.29/packages/play-solid/examples/demo/src/components/Home.tsx#L4)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-solid-demo](../README.md) / Login
|
|
2
|
+
|
|
3
|
+
# Variable: Login
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const Login: ComponentFn<AuthCatalog, "Login">;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Login.tsx:7](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.29/packages/play-solid/examples/demo/src/components/Login.tsx#L7)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-solid-demo](../README.md) / Navigation
|
|
2
|
+
|
|
3
|
+
# Variable: Navigation
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const Navigation: ComponentFn<AuthCatalog, "Navigation">;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Navigation.tsx:4](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.29/packages/play-solid/examples/demo/src/components/Navigation.tsx#L4)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-solid-demo](../README.md) / Overview
|
|
2
|
+
|
|
3
|
+
# Variable: Overview
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const Overview: ComponentFn<AuthCatalog, "Overview">;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Overview.tsx:4](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.29/packages/play-solid/examples/demo/src/components/Overview.tsx#L4)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-solid-demo](../README.md) / Profile
|
|
2
|
+
|
|
3
|
+
# Variable: Profile
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const Profile: ComponentFn<AuthCatalog, "Profile">;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Profile.tsx:4](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.29/packages/play-solid/examples/demo/src/components/Profile.tsx#L4)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-solid-demo](../README.md) / Settings
|
|
2
|
+
|
|
3
|
+
# Variable: Settings
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const Settings: ComponentFn<AuthCatalog, "Settings">;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Settings.tsx:4](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.29/packages/play-solid/examples/demo/src/components/Settings.tsx#L4)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-solid-demo](../README.md) / Stats
|
|
2
|
+
|
|
3
|
+
# Variable: Stats
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const Stats: ComponentFn<AuthCatalog, "Stats">;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Stats.tsx:4](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.29/packages/play-solid/examples/demo/src/components/Stats.tsx#L4)
|
|
@@ -18,7 +18,7 @@ From the repository root:
|
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
20
|
npm install
|
|
21
|
-
npm run dev -w
|
|
21
|
+
npm run dev -w @xmachines/play-solid-router-demo
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
Then open `http://localhost:3002`.
|
|
@@ -98,27 +98,27 @@ Solid Router integration remains passive infrastructure. `RouterBridgeBase` stay
|
|
|
98
98
|
|
|
99
99
|
These commands are defined in `package.json`:
|
|
100
100
|
|
|
101
|
-
| Command
|
|
102
|
-
|
|
|
103
|
-
| `npm run dev -w
|
|
104
|
-
| `npm run build -w
|
|
105
|
-
| `npm run preview -w
|
|
106
|
-
| `npm run test -w
|
|
107
|
-
| `npm run test:browser -w
|
|
101
|
+
| Command | Description |
|
|
102
|
+
| ----------------------------------------------------------- | -------------------------------- |
|
|
103
|
+
| `npm run dev -w @xmachines/play-solid-router-demo` | Start Vite dev server |
|
|
104
|
+
| `npm run build -w @xmachines/play-solid-router-demo` | Build production bundle |
|
|
105
|
+
| `npm run preview -w @xmachines/play-solid-router-demo` | Preview built bundle |
|
|
106
|
+
| `npm run test -w @xmachines/play-solid-router-demo` | Run Vitest test suite |
|
|
107
|
+
| `npm run test:browser -w @xmachines/play-solid-router-demo` | Run browser-focused Vitest suite |
|
|
108
108
|
|
|
109
109
|
## Verification
|
|
110
110
|
|
|
111
111
|
Use these checks to validate README claims against the current demo implementation:
|
|
112
112
|
|
|
113
113
|
```bash
|
|
114
|
-
npm run test -w
|
|
115
|
-
npm run test:browser -w
|
|
114
|
+
npm run test -w @xmachines/play-solid-router-demo
|
|
115
|
+
npm run test:browser -w @xmachines/play-solid-router-demo
|
|
116
116
|
```
|
|
117
117
|
|
|
118
118
|
Expected result: library-pattern invariant tests and the browser shared-demo suite both pass, confirming login/logout transitions update both view and URL correctly.
|
|
119
119
|
|
|
120
120
|
## Learn More
|
|
121
121
|
|
|
122
|
-
- [Solid Router package README](
|
|
123
|
-
- [SolidJS package README](
|
|
124
|
-
- [TanStack Solid Router demo README](
|
|
122
|
+
- [Solid Router package README](../../README.md)
|
|
123
|
+
- [SolidJS package README](../../../play-solid/README.md)
|
|
124
|
+
- [TanStack Solid Router demo README](../../../play-tanstack-solid-router/examples/demo/README.md)
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
[Documentation](../../README.md) / @xmachines/play-svelte-demo
|
|
2
|
+
|
|
3
|
+
# Svelte Demo
|
|
4
|
+
|
|
5
|
+
Svelte 5 renderer demo for `@xmachines/play-svelte` — actor + `PlayRenderer` without a router.
|
|
6
|
+
|
|
7
|
+
## What This Demonstrates
|
|
8
|
+
|
|
9
|
+
- Shared auth machine reused without framework-specific business logic
|
|
10
|
+
- `PlayRenderer` rendering actor-projected views with a typed `defineRegistry` catalog
|
|
11
|
+
- Auth machine states drive view switching via `auth.login` / `auth.logout` events only — no URL routing
|
|
12
|
+
- Svelte 5 runes and `mount` API mapped to TC39 Signals lifecycle
|
|
13
|
+
- Non-browser invariant tests plus browser renderer coverage
|
|
14
|
+
|
|
15
|
+
## Running the Demo
|
|
16
|
+
|
|
17
|
+
From the repository root:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install
|
|
21
|
+
npm run dev -w @xmachines/play-svelte-demo
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Then open `http://localhost:5173`.
|
|
25
|
+
|
|
26
|
+
## Step-by-Step Code Flow
|
|
27
|
+
|
|
28
|
+
Use this order to understand the implementation:
|
|
29
|
+
|
|
30
|
+
1. `src/main.ts` calls `definePlayer({ machine: authMachine })`, starts the actor, and mounts `App.svelte` via Svelte's `mount`.
|
|
31
|
+
2. The actor is passed to `App` as a prop.
|
|
32
|
+
3. `src/App.svelte` calls `defineRegistry(authCatalog, { components, actions })` to build the typed component registry.
|
|
33
|
+
4. `App.svelte` delegates to `Shell.svelte`, which renders `<PlayRenderer>` with the actor and registry.
|
|
34
|
+
5. `Shell.svelte` also renders `<HeaderNav>` and `<DebugPanel>` — both observe actor signals directly.
|
|
35
|
+
6. HMR cleanup calls `actor.stop()` via `import.meta.hot.dispose`.
|
|
36
|
+
7. Browser tests in `test/browser/` validate startup and interaction behavior.
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
// src/main.ts (shape)
|
|
40
|
+
const createPlayer = definePlayer({ machine: authMachine });
|
|
41
|
+
const actor = createPlayer();
|
|
42
|
+
actor.start();
|
|
43
|
+
|
|
44
|
+
mount(App, { target: document.getElementById("app")!, props: { actor } });
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```svelte
|
|
48
|
+
<!-- src/App.svelte (shape) -->
|
|
49
|
+
<script lang="ts">
|
|
50
|
+
let { actor } = $props();
|
|
51
|
+
const { registry } = defineRegistry(authCatalog, {
|
|
52
|
+
components: { Home, About, Contact, Login, Dashboard, Overview, Stats, Profile, Settings, Navigation },
|
|
53
|
+
actions: { login: async () => {}, logout: async () => {} },
|
|
54
|
+
});
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<Shell {actor} {registry} />
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```svelte
|
|
61
|
+
<!-- src/components/Shell.svelte (shape) -->
|
|
62
|
+
<PlayRenderer
|
|
63
|
+
actor={props.actor}
|
|
64
|
+
registry={props.registry}
|
|
65
|
+
actions={{ login: "auth.login", logout: "auth.logout" }}
|
|
66
|
+
/>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Key Files
|
|
70
|
+
|
|
71
|
+
- `src/main.ts` - actor creation/start and Svelte app mount with actor as prop
|
|
72
|
+
- `src/App.svelte` - registry construction, delegates rendering to `Shell.svelte`
|
|
73
|
+
- `src/components/Shell.svelte` - shared shell with `PlayRenderer`, `HeaderNav`, and `DebugPanel`
|
|
74
|
+
- `src/components/` - demo view Svelte components bound to catalog component keys
|
|
75
|
+
- `test/library-pattern.test.ts` - architecture boundary and invariant assertions
|
|
76
|
+
- `test/browser/renderer-demo.browser.test.ts` - browser-mode renderer coverage
|
|
77
|
+
|
|
78
|
+
## State Machine & Architecture Details
|
|
79
|
+
|
|
80
|
+
The demo utilizes XMachines architectural invariants:
|
|
81
|
+
|
|
82
|
+
1. **Actor Authority:** View components dispatch `auth.login` and `auth.logout` events to the actor. The actor evaluates guards and transitions — Svelte never decides which view to render.
|
|
83
|
+
2. **Passive Infrastructure:** `PlayRenderer` observes `actor.currentView` signals only. It holds no business state and makes no routing decisions.
|
|
84
|
+
3. **Signal-Only Reactivity:** The bridge leverages Svelte 5 rune reactivity internally to react precisely when actor signals update, without ad-hoc `$state` stores for business logic.
|
|
85
|
+
|
|
86
|
+
## Watcher Lifecycle and Cleanup Contract
|
|
87
|
+
|
|
88
|
+
This demo follows the canonical watcher lifecycle used across all `@xmachines` framework adapters:
|
|
89
|
+
|
|
90
|
+
1. `notify`
|
|
91
|
+
2. `queueMicrotask`
|
|
92
|
+
3. `getPending()`
|
|
93
|
+
4. Read actor signals and project Svelte-local render state
|
|
94
|
+
5. Re-arm with `watch()`/`watch(...signals)`
|
|
95
|
+
|
|
96
|
+
Watcher notifications are one-shot. Cleanup is explicit: `actor.stop()` is called during HMR disposal, and `PlayRenderer` handles internal watcher teardown natively on component destruction.
|
|
97
|
+
|
|
98
|
+
## Adapter Boundaries
|
|
99
|
+
|
|
100
|
+
`PlayRenderer` and `defineRegistry` stay passive infrastructure. Business validity remains actor-owned. The registry maps catalog component keys to Svelte 5 component implementations — the actor owns which key is active. The `Shell.svelte` component is shared with all Svelte router demos, accepting an optional `router` prop for prop-shape parity.
|
|
101
|
+
|
|
102
|
+
## Available Scripts
|
|
103
|
+
|
|
104
|
+
These commands are defined in `package.json`:
|
|
105
|
+
|
|
106
|
+
| Command | Description |
|
|
107
|
+
| ----------------------------------------------------- | -------------------------------- |
|
|
108
|
+
| `npm run dev -w @xmachines/play-svelte-demo` | Start Vite dev server |
|
|
109
|
+
| `npm run build -w @xmachines/play-svelte-demo` | Build production bundle |
|
|
110
|
+
| `npm run preview -w @xmachines/play-svelte-demo` | Preview built bundle |
|
|
111
|
+
| `npm run test -w @xmachines/play-svelte-demo` | Run Vitest test suite |
|
|
112
|
+
| `npm run test:browser -w @xmachines/play-svelte-demo` | Run browser-focused Vitest suite |
|
|
113
|
+
|
|
114
|
+
## Verification
|
|
115
|
+
|
|
116
|
+
Use these checks to validate README claims against the current demo implementation:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
npm run test -w @xmachines/play-svelte-demo
|
|
120
|
+
npm run test:browser -w @xmachines/play-svelte-demo
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Expected result: library-pattern invariant tests pass and the browser renderer suite completes.
|
|
124
|
+
|
|
125
|
+
## Learn More
|
|
126
|
+
|
|
127
|
+
- [Svelte package README](../../README.md)
|
|
@@ -18,7 +18,7 @@ From the repository root:
|
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
20
|
npm install
|
|
21
|
-
npm run dev -w
|
|
21
|
+
npm run dev -w @xmachines/play-svelte-spa-router-demo
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
Then open `http://localhost:5173`.
|
|
@@ -104,27 +104,26 @@ Watcher notifications are one-shot. Cleanup is explicit: `cleanupDemo()` calls `
|
|
|
104
104
|
|
|
105
105
|
These commands are defined in `package.json`:
|
|
106
106
|
|
|
107
|
-
| Command
|
|
108
|
-
|
|
|
109
|
-
| `npm run dev -w
|
|
110
|
-
| `npm run build -w
|
|
111
|
-
| `npm run preview -w
|
|
112
|
-
| `npm run test -w
|
|
113
|
-
| `npm run test:browser -w
|
|
107
|
+
| Command | Description |
|
|
108
|
+
| ---------------------------------------------------------------- | -------------------------------- |
|
|
109
|
+
| `npm run dev -w @xmachines/play-svelte-spa-router-demo` | Start Vite dev server |
|
|
110
|
+
| `npm run build -w @xmachines/play-svelte-spa-router-demo` | Build production bundle |
|
|
111
|
+
| `npm run preview -w @xmachines/play-svelte-spa-router-demo` | Preview built bundle |
|
|
112
|
+
| `npm run test -w @xmachines/play-svelte-spa-router-demo` | Run Vitest test suite |
|
|
113
|
+
| `npm run test:browser -w @xmachines/play-svelte-spa-router-demo` | Run browser-focused Vitest suite |
|
|
114
114
|
|
|
115
115
|
## Verification
|
|
116
116
|
|
|
117
117
|
Use these checks to validate README claims against the current demo implementation:
|
|
118
118
|
|
|
119
119
|
```bash
|
|
120
|
-
npm run test -w
|
|
121
|
-
npm run test:browser -w
|
|
120
|
+
npm run test -w @xmachines/play-svelte-spa-router-demo
|
|
121
|
+
npm run test:browser -w @xmachines/play-svelte-spa-router-demo
|
|
122
122
|
```
|
|
123
123
|
|
|
124
124
|
Expected result: library-pattern invariant tests pass and the browser demo suite validates startup rendering and auth navigation.
|
|
125
125
|
|
|
126
126
|
## Learn More
|
|
127
127
|
|
|
128
|
-
- [Svelte SPA Router package README](
|
|
129
|
-
- [Svelte package README](
|
|
130
|
-
- [SvelteKit Router demo README](../play-sveltekit-router-demo/README.md)
|
|
128
|
+
- [Svelte SPA Router package README](../../README.md)
|
|
129
|
+
- [Svelte package README](../../../play-svelte/README.md)
|