@xmachines/docs 2.0.0 → 2.1.1
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 +67 -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 +67 -17
- package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +9 -8
- package/api/@xmachines/play-tanstack-router/README.md +55 -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 +67 -17
- package/api/@xmachines/play-tanstack-solid-router/README.md +72 -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 +67 -17
- 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
|
@@ -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:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L38)
|
|
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:71](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L71)
|
|
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
|
|
|
@@ -60,6 +61,40 @@ subscribe(handler): () => void;
|
|
|
60
61
|
|
|
61
62
|
() => `void`
|
|
62
63
|
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### options?
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
optional options?: object;
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:57](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L57)
|
|
73
|
+
|
|
74
|
+
The options of the router. The bridge reads `parseSearch` only.
|
|
75
|
+
|
|
76
|
+
TanStack owns the encoding of a query: its default `stringifySearch` writes each
|
|
77
|
+
value through `JSON.stringify`, so a plain string arrives in the URL with quotes
|
|
78
|
+
around it. `parseSearch` is the inverse, and it is therefore the only correct way
|
|
79
|
+
to turn a query string of the URL into the `search` object that `navigate`
|
|
80
|
+
accepts. A router double may hold neither.
|
|
81
|
+
|
|
82
|
+
#### parseSearch()?
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
optional parseSearch(search): Record<string, unknown>;
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
##### Parameters
|
|
89
|
+
|
|
90
|
+
| Parameter | Type |
|
|
91
|
+
| --------- | -------- |
|
|
92
|
+
| `search` | `string` |
|
|
93
|
+
|
|
94
|
+
##### Returns
|
|
95
|
+
|
|
96
|
+
`Record`\<`string`, `unknown`\>
|
|
97
|
+
|
|
63
98
|
## Methods
|
|
64
99
|
|
|
65
100
|
### load()?
|
|
@@ -68,11 +103,18 @@ subscribe(handler): () => void;
|
|
|
68
103
|
optional load(): void | Promise<void>;
|
|
69
104
|
```
|
|
70
105
|
|
|
71
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:
|
|
106
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:70](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L70)
|
|
107
|
+
|
|
108
|
+
Runs the TanStack route matching and the loaders again for the current location.
|
|
109
|
+
This method is optional. The bridge calls it after every navigation. The matching
|
|
110
|
+
and the loaders therefore stay correct, also when no `<RouterProvider>` is
|
|
111
|
+
mounted.
|
|
72
112
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
113
|
+
The real implementation returns a promise. `watchRouterChanges` waits for that
|
|
114
|
+
promise before it synchronizes the actor, because `router.load()` is the only
|
|
115
|
+
public point that also runs `router.updateLatestLocation()`. See
|
|
116
|
+
`watchRouterChanges` for the reason. A test double may return `void`, and the
|
|
117
|
+
bridge then synchronizes synchronously.
|
|
76
118
|
|
|
77
119
|
#### Returns
|
|
78
120
|
|
|
@@ -86,14 +128,22 @@ matching/loaders stay in sync even without a mounted `<RouterProvider>`.
|
|
|
86
128
|
navigate(args): void;
|
|
87
129
|
```
|
|
88
130
|
|
|
89
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:
|
|
131
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:47](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L47)
|
|
132
|
+
|
|
133
|
+
Navigates to a location. `search` carries the query of the target.
|
|
134
|
+
|
|
135
|
+
The bridge passes `search` whenever the route of the actor holds a query. A
|
|
136
|
+
`navigate({ to })` call with no `search` makes TanStack rebuild the query from
|
|
137
|
+
`validateSearch({})` of the matched route, and a route that injects a default
|
|
138
|
+
then commits a different href than the bridge asked for.
|
|
90
139
|
|
|
91
140
|
#### Parameters
|
|
92
141
|
|
|
93
|
-
| Parameter
|
|
94
|
-
|
|
|
95
|
-
| `args`
|
|
96
|
-
| `args.
|
|
142
|
+
| Parameter | Type |
|
|
143
|
+
| -------------- | ----------------------------------------------------------------- |
|
|
144
|
+
| `args` | \{ `search?`: `Record`\<`string`, `unknown`\>; `to`: `string`; \} |
|
|
145
|
+
| `args.search?` | `Record`\<`string`, `unknown`\> |
|
|
146
|
+
| `args.to` | `string` |
|
|
97
147
|
|
|
98
148
|
#### Returns
|
|
99
149
|
|
|
@@ -6,16 +6,17 @@
|
|
|
6
6
|
const PlayRouterProvider: <TActor>(__namedParameters) => Element;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-tanstack-react-router/src/play-router-provider.tsx:
|
|
9
|
+
Defined in: [play-tanstack-react-router/src/play-router-provider.tsx:60](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-react-router/src/play-router-provider.tsx#L60)
|
|
10
10
|
|
|
11
|
-
Connects a `PlayerActor` to TanStack React Router
|
|
12
|
-
browser URL in
|
|
11
|
+
Connects a `PlayerActor` to TanStack React Router. It keeps the actor state and the
|
|
12
|
+
browser URL in step, in both directions.
|
|
13
13
|
|
|
14
|
-
The bridge
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
The component creates the bridge one time, on mount, and it disconnects the bridge
|
|
15
|
+
on unmount. It also builds the bridge again on a change of the identity of `actor`,
|
|
16
|
+
of `router`, or of `routeMap`. Therefore all three props must be **stable
|
|
17
|
+
references**: create them outside the JSX, or hold them with `useMemo`. Under the
|
|
18
|
+
React `<StrictMode>`, the effect runs two times on mount (connect, disconnect,
|
|
19
|
+
connect), and the bridge supports this.
|
|
19
20
|
|
|
20
21
|
## Type Parameters
|
|
21
22
|
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
Shared, framework-agnostic TanStack Router bridge base for XMachines Play.
|
|
6
6
|
|
|
7
|
-
[](https://opensource.org/licenses/MIT) [](https://opensource.org/licenses/MIT) [](https://www.npmjs.com/package/@xmachines/play-tanstack-router)
|
|
8
8
|
|
|
9
|
-
TanStack Router
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
[`@xmachines/play-router`](../play-router/README.md)
|
|
13
|
-
|
|
9
|
+
TanStack Router gives React and Solid the same `navigate`, `load`, and `history`
|
|
10
|
+
surface. Therefore the complete bridge implementation lives here, in
|
|
11
|
+
`TanStackRouterBridgeBase`. That class extends `RouterBridgeBase` from
|
|
12
|
+
[`@xmachines/play-router`](../play-router/README.md). Each framework adapter
|
|
13
|
+
package makes a subclass of it, and binds its own router type.
|
|
14
14
|
|
|
15
|
-
This package has **no TanStack runtime dependency
|
|
16
|
-
|
|
15
|
+
This package has **no TanStack runtime dependency**. `TanStackRouterLike` is a
|
|
16
|
+
type-only interface. It describes the small router surface that the bridge uses.
|
|
17
17
|
|
|
18
18
|
## Who consumes it
|
|
19
19
|
|
|
@@ -23,21 +23,59 @@ structural, type-only interface covering the small router surface the bridge use
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
25
|
```typescript
|
|
26
|
+
import { createMachine } from "xstate";
|
|
27
|
+
import { definePlayer, formatPlayRouteTransitions } from "@xmachines/play-xstate";
|
|
28
|
+
import { createRouteMap } from "@xmachines/play-router";
|
|
26
29
|
import { TanStackRouterBridgeBase } from "@xmachines/play-tanstack-router";
|
|
27
30
|
|
|
31
|
+
const machine = createMachine(
|
|
32
|
+
formatPlayRouteTransitions({
|
|
33
|
+
id: "app",
|
|
34
|
+
initial: "home",
|
|
35
|
+
states: {
|
|
36
|
+
home: { id: "home", meta: { route: "/" } },
|
|
37
|
+
about: { id: "about", meta: { route: "/about" } },
|
|
38
|
+
},
|
|
39
|
+
}),
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const actor = definePlayer({ machine })();
|
|
43
|
+
actor.start();
|
|
44
|
+
|
|
45
|
+
const routeMap = createRouteMap(machine);
|
|
46
|
+
|
|
28
47
|
export class MyTanStackBridge extends TanStackRouterBridgeBase {}
|
|
29
48
|
|
|
49
|
+
// router: your TanStack Router instance (from the React or Solid createRouter)
|
|
30
50
|
const bridge = new MyTanStackBridge(router, actor, routeMap);
|
|
31
51
|
bridge.connect();
|
|
32
|
-
//
|
|
33
|
-
|
|
52
|
+
// Disconnect the bridge at teardown
|
|
53
|
+
bridge.disconnect();
|
|
34
54
|
```
|
|
35
55
|
|
|
56
|
+
## Corrective navigation and a mounted `<RouterProvider>`
|
|
57
|
+
|
|
58
|
+
The bridge subscribes to `router.history`, and it calls `router.load()` for every
|
|
59
|
+
history event. The bridge waits for that `load()` promise before it synchronizes
|
|
60
|
+
the actor. The wait is necessary for a mounted `<RouterProvider>`: its
|
|
61
|
+
`Transitioner` component defers `router.updateLatestLocation()` into the
|
|
62
|
+
`startTransition` of the framework. Without the wait, `router.latestLocation`
|
|
63
|
+
still holds the previous href while the bridge runs. A corrective navigation for a
|
|
64
|
+
refused URL then looks like a navigation to the same URL, and `commitLocation` of
|
|
65
|
+
TanStack writes nothing to the browser history. The refused URL then stays in the
|
|
66
|
+
address bar. With the wait, `router.latestLocation` is current, and the correction
|
|
67
|
+
reaches the history. The bridge therefore works with a mounted `<RouterProvider>`
|
|
68
|
+
and also without one.
|
|
69
|
+
|
|
70
|
+
A burst of history events keeps its order: each event takes a sequence number, and
|
|
71
|
+
a deferred synchronization runs only while its number is still the newest one. A
|
|
72
|
+
`disconnect()` call retires every synchronization that still waits.
|
|
73
|
+
|
|
36
74
|
## Exports
|
|
37
75
|
|
|
38
|
-
- `TanStackRouterBridgeBase` —
|
|
39
|
-
- `TanStackRouterLike` —
|
|
40
|
-
- `TanStackRouteMapLike` — narrow route-map surface the bridge requires
|
|
76
|
+
- `TanStackRouterBridgeBase` — the concrete bridge base class. Use it directly, or make a subclass of it
|
|
77
|
+
- `TanStackRouterLike` — the TanStack router surface, as a type-only interface
|
|
78
|
+
- `TanStackRouteMapLike` — the narrow route-map surface that the bridge requires
|
|
41
79
|
|
|
42
80
|
## License
|
|
43
81
|
|
|
@@ -45,10 +83,10 @@ MIT
|
|
|
45
83
|
|
|
46
84
|
@xmachines/play-tanstack-router
|
|
47
85
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
`@xmachines/play-tanstack-solid-router
|
|
51
|
-
`TanStackRouterBridgeBase
|
|
86
|
+
The shared, framework-agnostic TanStack Router bridge base for XMachines Play.
|
|
87
|
+
`@xmachines/play-tanstack-react-router` and
|
|
88
|
+
`@xmachines/play-tanstack-solid-router` use it. Each of them makes a subclass of
|
|
89
|
+
`TanStackRouterBridgeBase`, and the subclass binds its own router type.
|
|
52
90
|
|
|
53
91
|
## Classes
|
|
54
92
|
|
|
@@ -2,32 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: TanStackRouterBridgeBase
|
|
4
4
|
|
|
5
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:
|
|
5
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:132](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L132)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The shared TanStack Router adapter. It implements the RouterBridge protocol through RouterBridgeBase
|
|
8
8
|
|
|
9
9
|
## Remarks
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
and Solid
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
router.subscribe("onBeforeLoad")
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
The class extends RouterBridgeBase, and the base class does all the common
|
|
12
|
+
lifecycle work and synchronization work. This class adds the TanStack navigation
|
|
13
|
+
methods and subscription methods that the React adapter and the Solid adapter
|
|
14
|
+
share.
|
|
15
|
+
|
|
16
|
+
The bridge subscribes to router.history, not to
|
|
17
|
+
router.subscribe("onBeforeLoad"). Therefore it also receives a browser BACK or
|
|
18
|
+
FORWARD navigation, which is a popstate event. The
|
|
19
|
+
router.subscribe("onBeforeLoad") method works only when the Transitioner
|
|
20
|
+
component of TanStack is mounted, which means inside a complete
|
|
21
|
+
<RouterProvider>. This bridge works without <RouterProvider>. Therefore it
|
|
22
|
+
subscribes to the history object directly, and this is exactly what Transitioner
|
|
21
23
|
does internally: `router.history.subscribe(router.load)`.
|
|
22
24
|
|
|
23
|
-
Architectural
|
|
25
|
+
Architectural invariants:
|
|
24
26
|
|
|
25
|
-
- INV-02 (Passive Infrastructure):
|
|
26
|
-
-
|
|
27
|
+
- INV-02 (Passive Infrastructure): the router reflects the actor state. It never decides
|
|
28
|
+
- The actor checks every navigation with its guards before the URL changes
|
|
27
29
|
|
|
28
|
-
The class is concrete
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
The class is concrete. You can create an instance of it directly. Each framework
|
|
31
|
+
package re-exports it, or makes a subclass of it, only to bind the public name of
|
|
32
|
+
the adapter. The Solid package also adds the `dispose()` alias.
|
|
31
33
|
|
|
32
34
|
## Example
|
|
33
35
|
|
|
@@ -56,17 +58,17 @@ new TanStackRouterBridgeBase(
|
|
|
56
58
|
routeMap): TanStackRouterBridgeBase;
|
|
57
59
|
```
|
|
58
60
|
|
|
59
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:
|
|
61
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:150](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L150)
|
|
60
62
|
|
|
61
|
-
|
|
63
|
+
Creates a TanStack Router bridge
|
|
62
64
|
|
|
63
65
|
#### Parameters
|
|
64
66
|
|
|
65
|
-
| Parameter | Type | Description
|
|
66
|
-
| ---------- | -------------------------------------------------------------------- |
|
|
67
|
-
| `router` | [`TanStackRouterLike`](../type-aliases/TanStackRouterLike.md) | TanStack Router instance
|
|
68
|
-
| `actor` | [`RoutableActor`](../../play-dom-router/interfaces/RoutableActor.md) | XMachines actor instance
|
|
69
|
-
| `routeMap` | [`TanStackRouteMapLike`](../type-aliases/TanStackRouteMapLike.md) |
|
|
67
|
+
| Parameter | Type | Description |
|
|
68
|
+
| ---------- | -------------------------------------------------------------------- | --------------------------------------------------------- |
|
|
69
|
+
| `router` | [`TanStackRouterLike`](../type-aliases/TanStackRouterLike.md) | The TanStack Router instance from `createRouter` |
|
|
70
|
+
| `actor` | [`RoutableActor`](../../play-dom-router/interfaces/RoutableActor.md) | The XMachines actor instance |
|
|
71
|
+
| `routeMap` | [`TanStackRouteMapLike`](../type-aliases/TanStackRouteMapLike.md) | The bidirectional map between the state IDs and the paths |
|
|
70
72
|
|
|
71
73
|
#### Returns
|
|
72
74
|
|
|
@@ -84,21 +86,23 @@ Create a TanStack Router bridge
|
|
|
84
86
|
connect(): void;
|
|
85
87
|
```
|
|
86
88
|
|
|
87
|
-
Defined in: play-router/dist/router-bridge-base.d.ts:
|
|
89
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:124
|
|
88
90
|
|
|
89
|
-
|
|
91
|
+
Connects the router bridge to the Actor.
|
|
90
92
|
|
|
91
|
-
|
|
92
|
-
starts
|
|
93
|
+
The method installs the TC39 Signal watcher of the direction from the actor to the
|
|
94
|
+
router. It then starts the watch of the router changes, which each framework does
|
|
95
|
+
in its own way.
|
|
93
96
|
|
|
94
|
-
|
|
97
|
+
The order of these steps is part of the contract of the bridge:
|
|
95
98
|
|
|
96
|
-
- `lastSyncedPath`
|
|
97
|
-
- the actor watcher
|
|
98
|
-
-
|
|
99
|
+
- The constructor seeds `lastSyncedPath` from `actor.currentRoute`
|
|
100
|
+
- The method installs the actor watcher before the router subscriptions of the adapter
|
|
101
|
+
- The first synchronization then separates a deep link from a restore, with `actor.initialRoute`
|
|
99
102
|
|
|
100
|
-
|
|
101
|
-
`getInitialRouterPath()
|
|
103
|
+
An adapter that needs a different behavior of the first synchronization overrides
|
|
104
|
+
`getInitialRouterPath()`. It does not change the order of the steps of
|
|
105
|
+
`connect()`.
|
|
102
106
|
|
|
103
107
|
#### Returns
|
|
104
108
|
|
|
@@ -116,11 +120,12 @@ Adapters that need custom initial-sync behavior should override
|
|
|
116
120
|
disconnect(): void;
|
|
117
121
|
```
|
|
118
122
|
|
|
119
|
-
Defined in: play-router/dist/router-bridge-base.d.ts:
|
|
123
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:131
|
|
120
124
|
|
|
121
|
-
|
|
125
|
+
Disconnects the router bridge from the Actor.
|
|
122
126
|
|
|
123
|
-
|
|
127
|
+
The method stops the watch of the signal, and it removes the router listener of the
|
|
128
|
+
framework.
|
|
124
129
|
|
|
125
130
|
#### Returns
|
|
126
131
|
|
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
type TanStackRouteMapLike = 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:94](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L94)
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
`RouteMap` from `@xmachines/play-router` satisfies it
|
|
13
|
-
|
|
11
|
+
The narrow route-map surface that `TanStackRouterBridgeBase` requires.
|
|
12
|
+
`RouteMap` from `@xmachines/play-router` satisfies it. The bridge converts a
|
|
13
|
+
`null` result into `undefined` internally.
|
|
14
14
|
|
|
15
|
-
`getPathByStateId`
|
|
16
|
-
`"stateId"
|
|
17
|
-
|
|
15
|
+
`getPathByStateId` can receive the stateId in the form `"#stateId"` or in the
|
|
16
|
+
bare form `"stateId"`. The bridge tries both forms. Therefore an implementation
|
|
17
|
+
that holds one form only still resolves the path.
|
|
18
18
|
|
|
19
19
|
## Methods
|
|
20
20
|
|
|
@@ -24,7 +24,7 @@ implementations keyed on a single form still resolve.
|
|
|
24
24
|
getPathByStateId(id): string | null | undefined;
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:
|
|
27
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:96](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L96)
|
|
28
28
|
|
|
29
29
|
#### Parameters
|
|
30
30
|
|
|
@@ -44,7 +44,7 @@ Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:68](https:/
|
|
|
44
44
|
getStateIdByPath(path): string | null | undefined;
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:
|
|
47
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:95](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L95)
|
|
48
48
|
|
|
49
49
|
#### Parameters
|
|
50
50
|
|
|
@@ -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:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L38)
|
|
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:71](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L71)
|
|
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
|
|
|
@@ -60,6 +61,40 @@ subscribe(handler): () => void;
|
|
|
60
61
|
|
|
61
62
|
() => `void`
|
|
62
63
|
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### options?
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
optional options?: object;
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:57](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L57)
|
|
73
|
+
|
|
74
|
+
The options of the router. The bridge reads `parseSearch` only.
|
|
75
|
+
|
|
76
|
+
TanStack owns the encoding of a query: its default `stringifySearch` writes each
|
|
77
|
+
value through `JSON.stringify`, so a plain string arrives in the URL with quotes
|
|
78
|
+
around it. `parseSearch` is the inverse, and it is therefore the only correct way
|
|
79
|
+
to turn a query string of the URL into the `search` object that `navigate`
|
|
80
|
+
accepts. A router double may hold neither.
|
|
81
|
+
|
|
82
|
+
#### parseSearch()?
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
optional parseSearch(search): Record<string, unknown>;
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
##### Parameters
|
|
89
|
+
|
|
90
|
+
| Parameter | Type |
|
|
91
|
+
| --------- | -------- |
|
|
92
|
+
| `search` | `string` |
|
|
93
|
+
|
|
94
|
+
##### Returns
|
|
95
|
+
|
|
96
|
+
`Record`\<`string`, `unknown`\>
|
|
97
|
+
|
|
63
98
|
## Methods
|
|
64
99
|
|
|
65
100
|
### load()?
|
|
@@ -68,11 +103,18 @@ subscribe(handler): () => void;
|
|
|
68
103
|
optional load(): void | Promise<void>;
|
|
69
104
|
```
|
|
70
105
|
|
|
71
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:
|
|
106
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:70](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L70)
|
|
107
|
+
|
|
108
|
+
Runs the TanStack route matching and the loaders again for the current location.
|
|
109
|
+
This method is optional. The bridge calls it after every navigation. The matching
|
|
110
|
+
and the loaders therefore stay correct, also when no `<RouterProvider>` is
|
|
111
|
+
mounted.
|
|
72
112
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
113
|
+
The real implementation returns a promise. `watchRouterChanges` waits for that
|
|
114
|
+
promise before it synchronizes the actor, because `router.load()` is the only
|
|
115
|
+
public point that also runs `router.updateLatestLocation()`. See
|
|
116
|
+
`watchRouterChanges` for the reason. A test double may return `void`, and the
|
|
117
|
+
bridge then synchronizes synchronously.
|
|
76
118
|
|
|
77
119
|
#### Returns
|
|
78
120
|
|
|
@@ -86,14 +128,22 @@ matching/loaders stay in sync even without a mounted `<RouterProvider>`.
|
|
|
86
128
|
navigate(args): void;
|
|
87
129
|
```
|
|
88
130
|
|
|
89
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:
|
|
131
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:47](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L47)
|
|
132
|
+
|
|
133
|
+
Navigates to a location. `search` carries the query of the target.
|
|
134
|
+
|
|
135
|
+
The bridge passes `search` whenever the route of the actor holds a query. A
|
|
136
|
+
`navigate({ to })` call with no `search` makes TanStack rebuild the query from
|
|
137
|
+
`validateSearch({})` of the matched route, and a route that injects a default
|
|
138
|
+
then commits a different href than the bridge asked for.
|
|
90
139
|
|
|
91
140
|
#### Parameters
|
|
92
141
|
|
|
93
|
-
| Parameter
|
|
94
|
-
|
|
|
95
|
-
| `args`
|
|
96
|
-
| `args.
|
|
142
|
+
| Parameter | Type |
|
|
143
|
+
| -------------- | ----------------------------------------------------------------- |
|
|
144
|
+
| `args` | \{ `search?`: `Record`\<`string`, `unknown`\>; `to`: `string`; \} |
|
|
145
|
+
| `args.search?` | `Record`\<`string`, `unknown`\> |
|
|
146
|
+
| `args.to` | `string` |
|
|
97
147
|
|
|
98
148
|
#### Returns
|
|
99
149
|
|