@xmachines/docs 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -13
- package/api/@xmachines/play/README.md +58 -63
- package/api/@xmachines/play/classes/NonNullableError.md +7 -7
- package/api/@xmachines/play/classes/PlayError.md +25 -27
- package/api/@xmachines/play/functions/assertNonNullable.md +17 -17
- package/api/@xmachines/play/type-aliases/PlayEvent.md +26 -25
- package/api/@xmachines/play-actor/README.md +72 -63
- package/api/@xmachines/play-actor/classes/AbstractActor.md +39 -39
- package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +19 -18
- package/api/@xmachines/play-actor/functions/composePlayState.md +9 -8
- package/api/@xmachines/play-actor/functions/createViewStoreLifecycle.md +5 -5
- package/api/@xmachines/play-actor/functions/guardContextWrites.md +27 -25
- package/api/@xmachines/play-actor/functions/refreshContextSubtree.md +12 -11
- package/api/@xmachines/play-actor/functions/reuseComposedState.md +23 -22
- package/api/@xmachines/play-actor/functions/shallowEqualExcept.md +6 -5
- package/api/@xmachines/play-actor/functions/toAtomState.md +16 -14
- package/api/@xmachines/play-actor/functions/typedSpec.md +12 -11
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +17 -15
- package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +15 -14
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +13 -13
- package/api/@xmachines/play-actor/interfaces/ResolveViewStoreOptions.md +4 -4
- package/api/@xmachines/play-actor/interfaces/Routable.md +4 -4
- package/api/@xmachines/play-actor/interfaces/ViewStoreLifecycle.md +11 -11
- package/api/@xmachines/play-actor/interfaces/ViewStoreResolution.md +7 -7
- package/api/@xmachines/play-actor/interfaces/Viewable.md +9 -9
- package/api/@xmachines/play-actor/variables/CONTEXT_STATE_KEY.md +5 -5
- package/api/@xmachines/play-dom/README.md +119 -85
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +34 -32
- package/api/@xmachines/play-dom/functions/createPlayUI.md +10 -10
- package/api/@xmachines/play-dom/functions/createRenderer.md +21 -17
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +8 -8
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +9 -9
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +9 -9
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +5 -5
- package/api/@xmachines/play-dom-router/README.md +66 -49
- package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +116 -0
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +4 -3
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +16 -14
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-dom-router/functions/createRouter.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +25 -26
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +19 -18
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +7 -7
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +18 -17
- package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +9 -9
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +39 -38
- package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +7 -7
- package/api/@xmachines/play-react/README.md +63 -54
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +14 -13
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/usePlayView.md +4 -4
- package/api/@xmachines/play-react/functions/useSignalEffect.md +39 -39
- package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +11 -11
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +7 -7
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +4 -4
- package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +14 -14
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-react/type-aliases/PlayRendererProps.md +13 -0
- package/api/@xmachines/play-react/variables/ActorProvider.md +9 -8
- package/api/@xmachines/play-react/variables/PlayRenderer.md +5 -4
- package/api/@xmachines/play-react/variables/PlayUIProvider.md +6 -6
- package/api/@xmachines/play-react-router/README.md +37 -28
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +22 -19
- package/api/@xmachines/play-react-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +16 -14
- package/api/@xmachines/play-react-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +18 -18
- package/api/@xmachines/play-react-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +11 -11
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
- package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +7 -6
- package/api/@xmachines/play-router/README.md +94 -82
- package/api/@xmachines/play-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +29 -23
- package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +6 -5
- package/api/@xmachines/play-router/functions/buildRouteTree.md +16 -15
- package/api/@xmachines/play-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +18 -18
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +18 -17
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +11 -10
- package/api/@xmachines/play-router/functions/extractQuery.md +3 -3
- package/api/@xmachines/play-router/functions/extractRouteParams.md +22 -19
- package/api/@xmachines/play-router/functions/findRouteById.md +10 -9
- package/api/@xmachines/play-router/functions/findRouteByPath.md +14 -12
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +9 -9
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +9 -9
- package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +16 -15
- package/api/@xmachines/play-router/functions/isRouteReachable.md +12 -11
- package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
- package/api/@xmachines/play-router/functions/routeExists.md +8 -8
- package/api/@xmachines/play-router/functions/sanitizePathname.md +15 -13
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +10 -10
- package/api/@xmachines/play-router/functions/validateStateExists.md +9 -9
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +4 -4
- package/api/@xmachines/play-router/interfaces/LocationLike.md +9 -9
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +7 -7
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +9 -9
- package/api/@xmachines/play-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +7 -7
- package/api/@xmachines/play-router/interfaces/RoutableActor.md +18 -17
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +11 -11
- package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouteNode.md +13 -13
- package/api/@xmachines/play-router/interfaces/RouteObject.md +6 -6
- package/api/@xmachines/play-router/interfaces/RouteTree.md +11 -11
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +13 -13
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-router/interfaces/WindowLike.md +10 -10
- package/api/@xmachines/play-router/type-aliases/BaseRouteMapping.md +13 -0
- package/api/@xmachines/play-router/type-aliases/MachineGraph.md +4 -3
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +2 -2
- package/api/@xmachines/play-signals/README.md +38 -36
- package/api/@xmachines/play-signals/functions/watchSignal.md +15 -15
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +6 -6
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +10 -10
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +6 -6
- package/api/@xmachines/play-signals/interfaces/SignalState.md +13 -13
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +18 -18
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +6 -5
- package/api/@xmachines/play-solid/README.md +46 -42
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/usePlayView.md +3 -3
- package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +13 -13
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +14 -14
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +9 -9
- package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-solid/variables/ActorContext.md +5 -4
- package/api/@xmachines/play-solid/variables/ActorProvider.md +8 -7
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +6 -4
- package/api/@xmachines/play-solid/variables/PlayUIProvider.md +7 -7
- package/api/@xmachines/play-solid-router/README.md +34 -29
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +43 -34
- package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +15 -13
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +39 -39
- package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +10 -10
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +11 -11
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +5 -5
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +2 -2
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +11 -11
- package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +9 -8
- package/api/@xmachines/play-svelte/README.md +40 -31
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +9 -8
- package/api/@xmachines/play-svelte/functions/getActorContext.md +5 -4
- package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +3 -3
- package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
- package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +17 -15
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +9 -9
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +20 -18
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +12 -11
- package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-svelte-spa-router/README.md +25 -25
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +133 -0
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +7 -7
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +10 -10
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-sveltekit-router/README.md +38 -34
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +132 -0
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -3
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +6 -6
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +9 -9
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/README.md +66 -48
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +43 -38
- package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +16 -14
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +18 -18
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +11 -10
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +11 -11
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +16 -11
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +15 -13
- package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +9 -8
- package/api/@xmachines/play-tanstack-router/README.md +37 -17
- package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +43 -38
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +9 -9
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +15 -13
- package/api/@xmachines/play-tanstack-solid-router/README.md +71 -45
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +38 -30
- package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +15 -13
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +11 -11
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +9 -9
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +15 -13
- package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +7 -7
- package/api/@xmachines/play-vue/README.md +37 -35
- package/api/@xmachines/play-vue/functions/defineRegistry.md +10 -9
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/functions/usePlayView.md +28 -0
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +10 -9
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +13 -12
- package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +10 -9
- package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +6 -2
- package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue/variables/getPlayViewContext.md +34 -0
- package/api/@xmachines/play-vue-router/README.md +65 -56
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +26 -19
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +2 -2
- package/api/@xmachines/play-vue-router/type-aliases/VueRouteMap.md +13 -0
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +5 -5
- package/api/@xmachines/play-vue-router/variables/VueRouteMap.md +13 -0
- package/api/@xmachines/play-xstate/README.md +72 -70
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +123 -112
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +19 -16
- package/api/@xmachines/play-xstate/functions/composeGuards.md +25 -23
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +20 -20
- package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +15 -15
- package/api/@xmachines/play-xstate/functions/definePlayer.md +19 -19
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +26 -25
- package/api/@xmachines/play-xstate/functions/eventMatches.md +8 -8
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +16 -13
- package/api/@xmachines/play-xstate/functions/hasContext.md +8 -8
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +10 -10
- package/api/@xmachines/play-xstate/functions/negateGuard.md +19 -18
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +6 -6
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +7 -7
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +10 -10
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +15 -14
- package/api/@xmachines/play-xstate/interfaces/RouteObject.md +2 -2
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +5 -5
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +9 -9
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +4 -3
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +7 -7
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +12 -12
- package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +15 -14
- package/api/@xmachines/shared/README.md +11 -13
- package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +2 -2
- package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +1 -1
- package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
- package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +4 -4
- package/contributing/development.md +28 -0
- package/guides/inspector.md +1 -1
- package/package.json +1 -1
- package/api/@xmachines/play-vue/functions/getPlayViewContext.md +0 -28
|
@@ -2,57 +2,62 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayRouteEvent
|
|
4
4
|
|
|
5
|
-
Defined in: [play-router/src/types.ts:
|
|
5
|
+
Defined in: [play-router/src/types.ts:237](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L237)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The routing event, with its parameters and its query
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
navigation
|
|
9
|
+
This is the one routing event of the complete Play architecture. It supports a
|
|
10
|
+
navigation that knows the parameters, for example `/profile/:userId`, for a dynamic
|
|
11
|
+
route segment.
|
|
11
12
|
|
|
12
|
-
**Architectural
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
**Architectural context:** the event implements **Passive Infrastructure
|
|
14
|
+
(INV-04)**, because it holds the navigation intent of the user, and the Actor then
|
|
15
|
+
evaluates that intent with its guards. The infrastructure makes a request with a
|
|
16
|
+
`play.route` event, and the Actor decides with a transition of its state machine.
|
|
15
17
|
|
|
16
|
-
**
|
|
18
|
+
**The flow of a browser navigation:**
|
|
17
19
|
|
|
18
|
-
1.
|
|
19
|
-
2.
|
|
20
|
-
3.
|
|
21
|
-
4. Actor
|
|
20
|
+
1. The browser fires `popstate`
|
|
21
|
+
2. The router adapter resolves the URL to a route target
|
|
22
|
+
3. The adapter sends a `PlayRouteEvent` to the Actor
|
|
23
|
+
4. The Actor checks the transition with the guards of its state machine
|
|
22
24
|
|
|
23
25
|
## Param
|
|
24
26
|
|
|
25
27
|
**type**
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
The discriminator of the event. It is always "play.route"
|
|
28
30
|
|
|
29
31
|
## Param
|
|
30
32
|
|
|
31
33
|
**to**
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
The target state ID, with a # prefix, for example '#home' or '#profile'
|
|
34
36
|
|
|
35
37
|
## Param
|
|
36
38
|
|
|
37
39
|
**params**
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
The route parameters of the path only, from the URL path, for
|
|
42
|
+
example `{ userId: '123' }` of `/profile/123`. The `query` field holds the query
|
|
43
|
+
parameters separately.
|
|
40
44
|
|
|
41
45
|
## Param
|
|
42
46
|
|
|
43
47
|
**query**
|
|
44
48
|
|
|
45
|
-
|
|
49
|
+
The query parameters only. They stay separate from the params of the path
|
|
46
50
|
|
|
47
51
|
## Param
|
|
48
52
|
|
|
49
53
|
**match**
|
|
50
54
|
|
|
51
|
-
|
|
55
|
+
The complete match result of URLPattern, for the debug work and for
|
|
56
|
+
the observability. It is optional
|
|
52
57
|
|
|
53
58
|
## Examples
|
|
54
59
|
|
|
55
|
-
|
|
60
|
+
The base event and the routing event together
|
|
56
61
|
|
|
57
62
|
```typescript
|
|
58
63
|
import type { PlayEvent } from "@xmachines/play";
|
|
@@ -61,7 +66,7 @@ import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
|
61
66
|
type AppEvent = PlayEvent | PlayRouteEvent;
|
|
62
67
|
```
|
|
63
68
|
|
|
64
|
-
|
|
69
|
+
A basic navigation to a route
|
|
65
70
|
|
|
66
71
|
```typescript
|
|
67
72
|
import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
@@ -73,7 +78,7 @@ const event: PlayRouteEvent = {
|
|
|
73
78
|
actor.send(event);
|
|
74
79
|
```
|
|
75
80
|
|
|
76
|
-
|
|
81
|
+
A navigation with route parameters
|
|
77
82
|
|
|
78
83
|
```typescript
|
|
79
84
|
import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
@@ -84,10 +89,10 @@ const event: PlayRouteEvent = {
|
|
|
84
89
|
params: { userId: "123" },
|
|
85
90
|
};
|
|
86
91
|
actor.send(event);
|
|
87
|
-
//
|
|
92
|
+
// It resolves to the route /profile/123
|
|
88
93
|
```
|
|
89
94
|
|
|
90
|
-
|
|
95
|
+
A navigation with query parameters
|
|
91
96
|
|
|
92
97
|
```typescript
|
|
93
98
|
import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
@@ -95,11 +100,11 @@ import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
|
95
100
|
const event: PlayRouteEvent = {
|
|
96
101
|
type: "play.route",
|
|
97
102
|
to: "#settings",
|
|
98
|
-
params: { section: "profile" }, //
|
|
99
|
-
query: { tab: "security" }, //
|
|
103
|
+
params: { section: "profile" }, // a route parameter of the path only
|
|
104
|
+
query: { tab: "security" }, // the query only
|
|
100
105
|
};
|
|
101
106
|
actor.send(event);
|
|
102
|
-
//
|
|
107
|
+
// It resolves to the route /settings/profile?tab=security
|
|
103
108
|
```
|
|
104
109
|
|
|
105
110
|
## See
|
|
@@ -108,9 +113,10 @@ actor.send(event);
|
|
|
108
113
|
|
|
109
114
|
## Remarks
|
|
110
115
|
|
|
111
|
-
Use `play.route` when you need
|
|
112
|
-
config pattern on your state machine
|
|
113
|
-
URLPatternResult for advanced use
|
|
116
|
+
Use `play.route` when you need a navigation that knows the parameters, with the
|
|
117
|
+
`route: {}` config pattern on the nodes of your state machine. The `match` field
|
|
118
|
+
gives you the complete URLPatternResult, for an advanced use such as a debug or an
|
|
119
|
+
analysis of the pattern.
|
|
114
120
|
|
|
115
121
|
## Indexable
|
|
116
122
|
|
|
@@ -122,8 +128,8 @@ URLPatternResult for advanced use cases (debugging, pattern analysis).
|
|
|
122
128
|
|
|
123
129
|
| Property | Modifier | Type | Defined in |
|
|
124
130
|
| -------------------------------------- | ---------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
125
|
-
| <a id="property-match"></a> `match?` | `readonly` | `unknown` | [play-router/src/types.ts:
|
|
126
|
-
| <a id="property-params"></a> `params?` | `readonly` | `Record`\<`string`, `string`\> | [play-router/src/types.ts:
|
|
127
|
-
| <a id="property-query"></a> `query?` | `readonly` | `Record`\<`string`, `string`\> | [play-router/src/types.ts:
|
|
128
|
-
| <a id="property-to"></a> `to` | `readonly` | `string` | [play-router/src/types.ts:
|
|
129
|
-
| <a id="property-type"></a> `type` | `readonly` | `"play.route"` | [play-router/src/types.ts:
|
|
131
|
+
| <a id="property-match"></a> `match?` | `readonly` | `unknown` | [play-router/src/types.ts:242](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L242) |
|
|
132
|
+
| <a id="property-params"></a> `params?` | `readonly` | `Record`\<`string`, `string`\> | [play-router/src/types.ts:240](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L240) |
|
|
133
|
+
| <a id="property-query"></a> `query?` | `readonly` | `Record`\<`string`, `string`\> | [play-router/src/types.ts:241](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L241) |
|
|
134
|
+
| <a id="property-to"></a> `to` | `readonly` | `string` | [play-router/src/types.ts:239](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L239) |
|
|
135
|
+
| <a id="property-type"></a> `type` | `readonly` | `"play.route"` | [play-router/src/types.ts:238](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L238) |
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayRouterProviderBaseProps\<TRouter, TActor\>
|
|
4
4
|
|
|
5
|
-
Defined in: [play-tanstack-solid-router/src/create-play-router-provider.tsx:45](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
5
|
+
Defined in: [play-tanstack-solid-router/src/create-play-router-provider.tsx:45](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-solid-router/src/create-play-router-provider.tsx#L45)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The props that every Solid `PlayRouterProvider` of the factory shares.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
router
|
|
11
|
-
`@xmachines/play-tanstack-solid-router
|
|
9
|
+
An adapter package re-exports a concrete alias, with `TRouter` bound to the type of
|
|
10
|
+
its router. For example, `TanStackRouterInstance` in
|
|
11
|
+
`@xmachines/play-tanstack-solid-router`.
|
|
12
12
|
|
|
13
13
|
## Extended by
|
|
14
14
|
|
|
@@ -23,9 +23,9 @@ router type (e.g. `TanStackRouterInstance` in
|
|
|
23
23
|
|
|
24
24
|
## Properties
|
|
25
25
|
|
|
26
|
-
| Property | Type | Description
|
|
27
|
-
| ----------------------------------------- | ------------------------------------ |
|
|
28
|
-
| <a id="property-actor"></a> `actor` | `TActor` | The actor to
|
|
29
|
-
| <a id="property-renderer"></a> `renderer` | (`actor`, `router`) => `any` |
|
|
30
|
-
| <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md) |
|
|
31
|
-
| <a id="property-router"></a> `router` | `TRouter` | The router the bridge
|
|
26
|
+
| Property | Type | Description | Defined in |
|
|
27
|
+
| ----------------------------------------- | ------------------------------------ | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
28
|
+
| <a id="property-actor"></a> `actor` | `TActor` | The actor to keep in step with the router. | [play-tanstack-solid-router/src/create-play-router-provider.tsx:47](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-solid-router/src/create-play-router-provider.tsx#L47) |
|
|
29
|
+
| <a id="property-renderer"></a> `renderer` | (`actor`, `router`) => `any` | The renderer callback receives the same concrete actor type as the prop. | [play-tanstack-solid-router/src/create-play-router-provider.tsx:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-solid-router/src/create-play-router-provider.tsx#L53) |
|
|
30
|
+
| <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md) | The route map of both directions, for the lookup between a state ID and a URL path. | [play-tanstack-solid-router/src/create-play-router-provider.tsx:51](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-solid-router/src/create-play-router-provider.tsx#L51) |
|
|
31
|
+
| <a id="property-router"></a> `router` | `TRouter` | The router that the bridge keeps in step with the actor. | [play-tanstack-solid-router/src/create-play-router-provider.tsx:49](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-solid-router/src/create-play-router-provider.tsx#L49) |
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayRouterProviderProps\<TActor\>
|
|
4
4
|
|
|
5
|
-
Defined in: [play-tanstack-solid-router/src/play-router-provider.tsx:
|
|
5
|
+
Defined in: [play-tanstack-solid-router/src/play-router-provider.tsx:30](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-solid-router/src/play-router-provider.tsx#L30)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The props of the `PlayRouterProvider` of TanStack Solid Router.
|
|
8
8
|
|
|
9
|
-
`router` is the TanStack Router instance
|
|
9
|
+
`router` is the TanStack Router instance that `createRouter` returns.
|
|
10
10
|
|
|
11
11
|
## Extends
|
|
12
12
|
|
|
@@ -20,9 +20,9 @@ Props for the TanStack Solid Router `PlayRouterProvider`.
|
|
|
20
20
|
|
|
21
21
|
## Properties
|
|
22
22
|
|
|
23
|
-
| Property | Type | Description
|
|
24
|
-
| ----------------------------------------- | ------------------------------------------------------------- |
|
|
25
|
-
| <a id="property-actor"></a> `actor` | `TActor` | The actor to
|
|
26
|
-
| <a id="property-renderer"></a> `renderer` | (`actor`, `router`) => `any` |
|
|
27
|
-
| <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md) |
|
|
28
|
-
| <a id="property-router"></a> `router` | [`TanStackRouterLike`](../type-aliases/TanStackRouterLike.md) | The router the bridge
|
|
23
|
+
| Property | Type | Description | Inherited from | Defined in |
|
|
24
|
+
| ----------------------------------------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
25
|
+
| <a id="property-actor"></a> `actor` | `TActor` | The actor to keep in step with the router. | [`PlayRouterProviderBaseProps`](PlayRouterProviderBaseProps.md).[`actor`](PlayRouterProviderBaseProps.md#property-actor) | [play-tanstack-solid-router/src/create-play-router-provider.tsx:47](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-solid-router/src/create-play-router-provider.tsx#L47) |
|
|
26
|
+
| <a id="property-renderer"></a> `renderer` | (`actor`, `router`) => `any` | The renderer callback receives the same concrete actor type as the prop. | [`PlayRouterProviderBaseProps`](PlayRouterProviderBaseProps.md).[`renderer`](PlayRouterProviderBaseProps.md#property-renderer) | [play-tanstack-solid-router/src/create-play-router-provider.tsx:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-solid-router/src/create-play-router-provider.tsx#L53) |
|
|
27
|
+
| <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md) | The route map of both directions, for the lookup between a state ID and a URL path. | [`PlayRouterProviderBaseProps`](PlayRouterProviderBaseProps.md).[`routeMap`](PlayRouterProviderBaseProps.md#property-routemap) | [play-tanstack-solid-router/src/create-play-router-provider.tsx:51](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-solid-router/src/create-play-router-provider.tsx#L51) |
|
|
28
|
+
| <a id="property-router"></a> `router` | [`TanStackRouterLike`](../type-aliases/TanStackRouterLike.md) | The router that the bridge keeps in step with the actor. | [`PlayRouterProviderBaseProps`](PlayRouterProviderBaseProps.md).[`router`](PlayRouterProviderBaseProps.md#property-router) | [play-tanstack-solid-router/src/create-play-router-provider.tsx:49](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-solid-router/src/create-play-router-provider.tsx#L49) |
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: RouteMapOptions
|
|
4
4
|
|
|
5
|
-
Defined in: [play-router/src/create-route-map.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
5
|
+
Defined in: [play-router/src/create-route-map.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/create-route-map.ts#L9)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The options of `createRouteMap` and of `createRouteMapFromTree`.
|
|
8
8
|
|
|
9
9
|
## Properties
|
|
10
10
|
|
|
11
|
-
| Property | Type | Description
|
|
12
|
-
| -------------------------------------------- | -------- |
|
|
13
|
-
| <a id="property-cachesize"></a> `cacheSize?` | `number` |
|
|
11
|
+
| Property | Type | Description | Defined in |
|
|
12
|
+
| -------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
+
| <a id="property-cachesize"></a> `cacheSize?` | `number` | The maximum number of the resolved parameterized path lookups in the cache. `RouteMap.getStateIdByPath()` resolves a parameterized pattern, for example `/profile/:userId`, with URLPattern on each call. The map keeps each path of a frequent visit in an LRU cache, and a later lookup of that path is therefore O(1). Raise this value for an application with a large set of parameterized routes, or with a high frequency of the navigation. The default is `500`. | [play-router/src/create-route-map.ts:21](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/create-route-map.ts#L21) |
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: RouteMapping
|
|
4
4
|
|
|
5
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
5
|
+
Defined in: [play-router/src/base-route-map.ts:54](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/base-route-map.ts#L54)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
One entry of the map between a state ID and a path.
|
|
8
8
|
|
|
9
|
-
Both fields are `readonly
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
`RouteMapping
|
|
9
|
+
Both fields are `readonly`, because a mapping is immutable after the caller gives
|
|
10
|
+
it to `RouteMap`. An adapter package re-exports a structurally compatible
|
|
11
|
+
`RouteMapping` type under its own name. `@xmachines/play-router` publishes this
|
|
12
|
+
type as `RouteMapping`, and its name therefore does not collide with such a local
|
|
13
|
+
type of an adapter.
|
|
13
14
|
|
|
14
15
|
## Example
|
|
15
16
|
|
|
@@ -21,7 +22,7 @@ const optionalMapping: RouteMapping = { stateId: "settings", path: "/settings/:s
|
|
|
21
22
|
|
|
22
23
|
## Properties
|
|
23
24
|
|
|
24
|
-
| Property | Modifier | Type | Description
|
|
25
|
-
| --------------------------------------- | ---------- | -------- |
|
|
26
|
-
| <a id="property-path"></a> `path` | `readonly` | `string` | URL path
|
|
27
|
-
| <a id="property-stateid"></a> `stateId` | `readonly` | `string` |
|
|
25
|
+
| Property | Modifier | Type | Description | Defined in |
|
|
26
|
+
| --------------------------------------- | ---------- | -------- | ------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
27
|
+
| <a id="property-path"></a> `path` | `readonly` | `string` | The pattern of the URL path, for example `"/"`, `"/profile/:userId"`, or `"/settings/:section?"` | [play-router/src/base-route-map.ts:58](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/base-route-map.ts#L58) |
|
|
28
|
+
| <a id="property-stateid"></a> `stateId` | `readonly` | `string` | The state ID of the state machine, for example `"home"` or `"#profile"` | [play-router/src/base-route-map.ts:56](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/base-route-map.ts#L56) |
|
|
@@ -2,21 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: RouterBridge
|
|
4
4
|
|
|
5
|
-
Defined in: [play-router/src/types.ts:
|
|
5
|
+
Defined in: [play-router/src/types.ts:358](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L358)
|
|
6
6
|
|
|
7
|
-
RouterBridge interface
|
|
7
|
+
The RouterBridge interface of a runtime infrastructure adapter
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
The interface defines the connection of the lifecycle between the infrastructure,
|
|
10
|
+
for example a framework router, and the Actor. The infrastructure builds a "bridge"
|
|
11
|
+
to the Actor: it observes the signals of the Actor, and it manages its own
|
|
12
|
+
lifecycle accordingly.
|
|
12
13
|
|
|
13
|
-
**Architectural
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
**Architectural context:** the interface implements **Passive Infrastructure
|
|
15
|
+
(INV-04)**, because it gives an observation in one direction. The infrastructure
|
|
16
|
+
connects to observe the signals of the Actor (currentRoute, currentView, and
|
|
17
|
+
state), and it reflects each change. It makes no decision about the state.
|
|
16
18
|
|
|
17
19
|
## Example
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
The implementation of a framework router bridge
|
|
20
22
|
|
|
21
23
|
```typescript
|
|
22
24
|
import type { RouterBridge } from "@xmachines/play-router";
|
|
@@ -26,7 +28,7 @@ class MyRouterBridge implements RouterBridge {
|
|
|
26
28
|
private watcher: Signal.Watcher | null = null;
|
|
27
29
|
|
|
28
30
|
async connect(): Promise<void> {
|
|
29
|
-
// Start
|
|
31
|
+
// Start the observation of the actor.currentRoute signal
|
|
30
32
|
this.watcher = new Signal.subtle.Watcher(() => {
|
|
31
33
|
const route = actor.currentRoute.get();
|
|
32
34
|
if (route) router.navigate(route);
|
|
@@ -35,7 +37,7 @@ class MyRouterBridge implements RouterBridge {
|
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
async disconnect(): Promise<void> {
|
|
38
|
-
// Stop
|
|
40
|
+
// Stop the observation, and clean the watchers up
|
|
39
41
|
this.watcher?.unwatch(actor.currentRoute);
|
|
40
42
|
this.watcher = null;
|
|
41
43
|
}
|
|
@@ -44,7 +46,7 @@ class MyRouterBridge implements RouterBridge {
|
|
|
44
46
|
|
|
45
47
|
## See
|
|
46
48
|
|
|
47
|
-
[Play RFC](../../../../rfc/play.md) -
|
|
49
|
+
[Play RFC](../../../../rfc/play.md) - invariant INV-04
|
|
48
50
|
|
|
49
51
|
## Methods
|
|
50
52
|
|
|
@@ -54,25 +56,26 @@ class MyRouterBridge implements RouterBridge {
|
|
|
54
56
|
connect(): void | Promise<void>;
|
|
55
57
|
```
|
|
56
58
|
|
|
57
|
-
Defined in: [play-router/src/types.ts:
|
|
59
|
+
Defined in: [play-router/src/types.ts:375](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L375)
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
Connects the router bridge to the Actor
|
|
60
62
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
The infrastructure calls it when it must start the observation of the Actor
|
|
64
|
+
signals, and when it must bring its own state, for example the browser URL, in line
|
|
65
|
+
with the Actor state.
|
|
63
66
|
|
|
64
67
|
#### Returns
|
|
65
68
|
|
|
66
69
|
`void` \| `Promise`\<`void`\>
|
|
67
70
|
|
|
68
|
-
|
|
71
|
+
The promise that resolves after the connection, or void for a synchronous connection
|
|
69
72
|
|
|
70
73
|
#### Example
|
|
71
74
|
|
|
72
75
|
```typescript
|
|
73
76
|
const bridge: RouterBridge = createBridge(actor, router);
|
|
74
77
|
await bridge.connect();
|
|
75
|
-
//
|
|
78
|
+
// The bridge observes the actor.currentRoute signal now
|
|
76
79
|
```
|
|
77
80
|
|
|
78
81
|
---
|
|
@@ -83,22 +86,22 @@ await bridge.connect();
|
|
|
83
86
|
disconnect(): void | Promise<void>;
|
|
84
87
|
```
|
|
85
88
|
|
|
86
|
-
Defined in: [play-router/src/types.ts:
|
|
89
|
+
Defined in: [play-router/src/types.ts:391](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L391)
|
|
87
90
|
|
|
88
|
-
|
|
91
|
+
Disconnects the router bridge from the Actor
|
|
89
92
|
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
The infrastructure calls it when it must stop the observation and free its
|
|
94
|
+
resources, for example a signal watcher and an event listener.
|
|
92
95
|
|
|
93
96
|
#### Returns
|
|
94
97
|
|
|
95
98
|
`void` \| `Promise`\<`void`\>
|
|
96
99
|
|
|
97
|
-
|
|
100
|
+
The promise that resolves after the disconnection, or void for a synchronous disconnection
|
|
98
101
|
|
|
99
102
|
#### Example
|
|
100
103
|
|
|
101
104
|
```typescript
|
|
102
105
|
await bridge.disconnect();
|
|
103
|
-
//
|
|
106
|
+
// The bridge stopped its observation, and it freed its resources
|
|
104
107
|
```
|
package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
type PlayRouterBridgeConstructor<TRouter> = (router, actor, routeMap) => RouterBridge;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-tanstack-solid-router/src/create-play-router-provider.tsx:32](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
9
|
+
Defined in: [play-tanstack-solid-router/src/create-play-router-provider.tsx:32](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-solid-router/src/create-play-router-provider.tsx#L32)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
The constructor shape that a bridge class must satisfy for
|
|
12
12
|
`createPlayRouterProvider`: `(router, actor, routeMap) → RouterBridge`.
|
|
13
13
|
|
|
14
14
|
## Type Parameters
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
type RoutableActor = PlayActor;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-tanstack-solid-router/src/play-router-provider.tsx:
|
|
9
|
+
Defined in: [play-tanstack-solid-router/src/play-router-provider.tsx:22](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-solid-router/src/play-router-provider.tsx#L22)
|
|
10
10
|
|
|
11
11
|
## Deprecated
|
|
12
12
|
|
|
13
|
-
Use `PlayActor` from `@xmachines/play-router`.
|
|
13
|
+
Use `PlayActor` from `@xmachines/play-router`. The next major version removes this alias.
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
type TanStackRouterInstance = ConstructorParameters<typeof TanStackSolidRouterBridge>[0];
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-tanstack-solid-router/src/play-router-provider.tsx:
|
|
9
|
+
Defined in: [play-tanstack-solid-router/src/play-router-provider.tsx:23](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-solid-router/src/play-router-provider.tsx#L23)
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
type TanStackRouterLike = object;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:
|
|
9
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:37](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L37)
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
`TanStackRouterBridgeBase
|
|
13
|
-
`@tanstack/solid-router`
|
|
11
|
+
The type-only interface of the TanStack Router surface that
|
|
12
|
+
`TanStackRouterBridgeBase` uses. An instance of `@tanstack/react-router` and an
|
|
13
|
+
instance of `@tanstack/solid-router` both satisfy it.
|
|
14
14
|
|
|
15
15
|
## Properties
|
|
16
16
|
|
|
@@ -20,7 +20,7 @@ Structural (type-only) interface for the TanStack Router surface used by
|
|
|
20
20
|
history: object;
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:
|
|
23
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:46](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L46)
|
|
24
24
|
|
|
25
25
|
#### location
|
|
26
26
|
|
|
@@ -28,9 +28,10 @@ Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:44](https:/
|
|
|
28
28
|
location: object;
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
`router.state.location`
|
|
31
|
+
The current location. `createRouter()` fills it from `window.location`, before
|
|
32
|
+
`router.load()`. It is always available in the browser.
|
|
33
|
+
`router.state.location` has a value only after `router.load()`, and that value
|
|
34
|
+
can be old.
|
|
34
35
|
|
|
35
36
|
##### location.pathname
|
|
36
37
|
|
|
@@ -68,11 +69,12 @@ subscribe(handler): () => void;
|
|
|
68
69
|
optional load(): void | Promise<void>;
|
|
69
70
|
```
|
|
70
71
|
|
|
71
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:
|
|
72
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:45](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L45)
|
|
72
73
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
Runs the TanStack route matching and the loaders again for the current location.
|
|
75
|
+
This method is optional. The bridge calls it after every navigation, and it does
|
|
76
|
+
not wait for the result. The matching and the loaders therefore stay correct,
|
|
77
|
+
also when no `<RouterProvider>` is mounted.
|
|
76
78
|
|
|
77
79
|
#### Returns
|
|
78
80
|
|
|
@@ -86,7 +88,7 @@ matching/loaders stay in sync even without a mounted `<RouterProvider>`.
|
|
|
86
88
|
navigate(args): void;
|
|
87
89
|
```
|
|
88
90
|
|
|
89
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:
|
|
91
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L38)
|
|
90
92
|
|
|
91
93
|
#### Parameters
|
|
92
94
|
|
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
const PlayRouterProvider: <TActor>(props) => any;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-tanstack-solid-router/src/play-router-provider.tsx:
|
|
9
|
+
Defined in: [play-tanstack-solid-router/src/play-router-provider.tsx:43](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-solid-router/src/play-router-provider.tsx#L43)
|
|
10
10
|
|
|
11
|
-
Connects a `PlayerActor` to TanStack Solid Router
|
|
12
|
-
browser URL in
|
|
11
|
+
Connects a `PlayerActor` to TanStack Solid Router. It keeps the actor state and the
|
|
12
|
+
browser URL in step, in both directions.
|
|
13
13
|
|
|
14
|
-
The bridge
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
The component creates the bridge one time for each of its instances, during its own
|
|
15
|
+
evaluation. It disconnects the bridge in `onCleanup`, when Solid disposes of the
|
|
16
|
+
component. React is different: the stability of a prop is no concern here, because
|
|
17
|
+
the `props` accessor of Solid is reactive already.
|
|
18
18
|
|
|
19
19
|
## Type Parameters
|
|
20
20
|
|