@xmachines/docs 2.2.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -16
- package/api/@xmachines/play/README.md +75 -97
- package/api/@xmachines/play/errors/README.md +8 -0
- package/api/@xmachines/play/{classes → errors/classes}/NonNullableError.md +6 -6
- package/api/@xmachines/play/{classes → errors/classes}/PlayError.md +35 -10
- package/api/@xmachines/play/index/README.md +75 -0
- package/api/@xmachines/play/index/functions/asCleanup.md +78 -0
- package/api/@xmachines/play/{functions → index/functions}/assertNonNullable.md +2 -2
- package/api/@xmachines/{play-actor → play/index}/functions/shallowEqualExcept.md +3 -3
- package/api/@xmachines/play/index/type-aliases/Cleanup.md +38 -0
- package/api/@xmachines/play/index/type-aliases/DisposeKey.md +32 -0
- package/api/@xmachines/play/{type-aliases → index/type-aliases}/PlayEvent.md +4 -4
- package/api/@xmachines/play/index/variables/DISPOSE.md +34 -0
- package/api/@xmachines/play-actor/README.md +78 -222
- package/api/@xmachines/play-actor/interfaces/ActorEvent.md +18 -0
- package/api/@xmachines/play-actor/interfaces/PlayActor.md +73 -0
- package/api/@xmachines/play-dom/README.md +99 -43
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +12 -11
- package/api/@xmachines/play-dom/functions/asCleanup.md +78 -0
- package/api/@xmachines/play-dom/functions/createPlayUI.md +6 -6
- package/api/@xmachines/play-dom/functions/createRenderer.md +3 -3
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +17 -11
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +5 -4
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +14 -12
- package/api/@xmachines/play-dom/type-aliases/Cleanup.md +38 -0
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +30 -8
- package/api/@xmachines/play-dom-router/README.md +99 -73
- package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +22 -21
- package/api/@xmachines/{play-vue-router → play-dom-router}/classes/RouteMap.md +12 -6
- package/api/@xmachines/play-dom-router/functions/asCleanup.md +78 -0
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +3 -8
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +7 -1
- package/api/@xmachines/play-dom-router/functions/createRouter.md +12 -6
- package/api/@xmachines/play-dom-router/interfaces/BasePathOptions.md +5 -5
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +73 -19
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +16 -16
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +8 -8
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +24 -21
- package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouterConnection.md +36 -7
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +40 -6
- package/api/@xmachines/play-dom-router/type-aliases/Cleanup.md +38 -0
- package/api/@xmachines/play-dom-router/variables/DISPOSE.md +34 -0
- package/api/@xmachines/play-react/README.md +18 -40
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +50 -11
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
- package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +11 -11
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +8 -6
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +6 -5
- package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +13 -13
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +11 -3
- package/api/@xmachines/play-react/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-react/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-react/variables/schema.md +52 -0
- package/api/@xmachines/play-react-router/README.md +22 -50
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +17 -16
- package/api/@xmachines/play-react-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +11 -8
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +16 -9
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +10 -10
- package/api/@xmachines/play-react-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +17 -7
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-router/README.md +108 -189
- package/api/@xmachines/play-router/errors/README.md +15 -0
- package/api/@xmachines/play-router/errors/classes/DuplicateBridgeError.md +191 -0
- package/api/@xmachines/play-router/errors/classes/DuplicateRoutePathError.md +175 -0
- package/api/@xmachines/play-router/errors/classes/EmptyRoutePathError.md +175 -0
- package/api/@xmachines/play-router/errors/classes/InvalidBasePathError.md +200 -0
- package/api/@xmachines/play-router/errors/classes/InvalidRoutePatternError.md +203 -0
- package/api/@xmachines/play-router/errors/classes/InvalidStateIdError.md +175 -0
- package/api/@xmachines/play-router/errors/classes/MissingBasePathParamError.md +199 -0
- package/api/@xmachines/play-router/errors/classes/RouterSyncError.md +192 -0
- package/api/@xmachines/play-router/errors/classes/UnknownStateTypeError.md +182 -0
- package/api/@xmachines/play-router/index/README.md +75 -0
- package/api/@xmachines/play-router/{classes → index/classes}/RouteMap.md +12 -6
- package/api/@xmachines/play-router/{classes → index/classes}/RouterBridgeBase.md +19 -17
- package/api/@xmachines/play-router/{functions → index/functions}/buildPlayRouteEvent.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/buildRouteTree.md +14 -4
- package/api/@xmachines/play-router/{functions → index/functions}/cleanFrameworkParams.md +3 -4
- package/api/@xmachines/play-router/{functions → index/functions}/createRouteMapFromTree.md +13 -6
- package/api/@xmachines/play-router/{functions → index/functions}/createRouterConnection.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/detectDuplicateRoutes.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/extractQuery.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/extractRouteParams.md +3 -3
- package/api/@xmachines/play-router/{functions → index/functions}/findRouteById.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/findRouteByPath.md +2 -2
- package/api/@xmachines/play-router/index/functions/getPatternParamNames.md +29 -0
- package/api/@xmachines/play-router/index/functions/getRequiredPatternParamNames.md +39 -0
- package/api/@xmachines/play-router/{functions → index/functions}/isMountableBridge.md +2 -2
- package/api/@xmachines/play-router/index/functions/joinBasePath.md +37 -0
- package/api/@xmachines/play-router/{functions → index/functions}/mountKey.md +2 -2
- package/api/@xmachines/play-router/index/functions/normalizeBasePath.md +43 -0
- package/api/@xmachines/play-router/{functions → index/functions}/openProviderBridge.md +14 -14
- package/api/@xmachines/play-router/index/functions/pickOwnParams.md +41 -0
- package/api/@xmachines/play-router/{functions → index/functions}/repointProviderBridge.md +2 -2
- package/api/@xmachines/play-router/index/functions/resolveBasePath.md +51 -0
- package/api/@xmachines/play-router/{functions → index/functions}/resolveFrameworkParams.md +11 -13
- package/api/@xmachines/play-router/{functions → index/functions}/sanitizePathname.md +2 -2
- package/api/@xmachines/play-router/index/functions/stripBasePath.md +44 -0
- package/api/@xmachines/play-router/{functions → index/functions}/validateRouteFormat.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/validateStateExists.md +2 -2
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/BasePathOptions.md +6 -6
- package/api/@xmachines/play-router/index/interfaces/BuildPlayRouteEventOptions.md +13 -0
- package/api/@xmachines/play-router/index/interfaces/FrameworkParamsSource.md +47 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/LocationLike.md +6 -6
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/MountableRouterBridge.md +9 -9
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/OpenProviderBridgeArgs.md +13 -13
- package/api/@xmachines/play-router/index/interfaces/PlayRouteEvent.md +130 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/PlayRouterProviderBaseProps.md +15 -15
- package/api/@xmachines/play-router/index/interfaces/ResolvedBasePath.md +14 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/ResolvedRoutePath.md +6 -6
- package/api/@xmachines/play-router/index/interfaces/Routable.md +26 -0
- package/api/@xmachines/play-router/index/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteInfo.md +11 -11
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteMapping.md +6 -6
- package/api/@xmachines/play-router/index/interfaces/RouteMatch.md +12 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteNode.md +13 -13
- package/api/@xmachines/play-router/index/interfaces/RouteObject.md +34 -0
- package/api/@xmachines/play-router/index/interfaces/RouteTree.md +27 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteWatcherHandle.md +7 -7
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouterBridge.md +5 -5
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouterConnection.md +38 -9
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/WindowLike.md +4 -4
- package/api/@xmachines/play-router/index/type-aliases/PlayRouterBridgeConstructor.md +46 -0
- package/api/@xmachines/play-router/index/type-aliases/RouteData.md +12 -0
- package/api/@xmachines/play-router/index/type-aliases/RouteDataResolver.md +31 -0
- package/api/@xmachines/play-router/index/type-aliases/RouteMetadata.md +11 -0
- package/api/@xmachines/play-router/index/variables/DISPOSE.md +34 -0
- package/api/@xmachines/play-router/index/variables/NO_BASE_PATH.md +18 -0
- package/api/@xmachines/play-router/index/variables/ROOT_NODE_ID.md +18 -0
- package/api/@xmachines/play-router/xstate/README.md +53 -0
- package/api/@xmachines/{play-dom-router → play-router/xstate}/functions/createRouteMap.md +8 -6
- package/api/@xmachines/play-router/{functions → xstate/functions}/extractMachineRoutes.md +4 -4
- package/api/@xmachines/play-router/xstate/functions/getNavigableRoutes.md +35 -0
- package/api/@xmachines/play-router/{functions → xstate/functions}/getRoutableRoutes.md +6 -6
- package/api/@xmachines/play-router/{functions → xstate/functions}/getRouteMappings.md +7 -7
- package/api/@xmachines/play-router/{functions → xstate/functions}/getTransitionReachableRoutes.md +2 -2
- package/api/@xmachines/play-router/{functions → xstate/functions}/isRouteReachable.md +2 -2
- package/api/@xmachines/play-router/{functions → xstate/functions}/machineToGraph.md +2 -2
- package/api/@xmachines/play-router/xstate/functions/routeExists.md +26 -0
- package/api/@xmachines/play-router/xstate/interfaces/MachineEdgeData.md +15 -0
- package/api/@xmachines/play-router/xstate/interfaces/MachineNodeData.md +17 -0
- package/api/@xmachines/play-router/{type-aliases → xstate/type-aliases}/MachineGraph.md +2 -2
- package/api/@xmachines/play-signals/README.md +5 -25
- package/api/@xmachines/play-signals/functions/watchSignal.md +27 -4
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalState.md +3 -3
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +4 -4
- package/api/@xmachines/play-signals/type-aliases/Cleanup.md +38 -0
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
- package/api/@xmachines/play-solid/README.md +36 -35
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/usePlayView.md +14 -1
- package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +11 -11
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +13 -13
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +16 -8
- package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +11 -3
- package/api/@xmachines/play-solid/variables/ActorContext.md +1 -1
- package/api/@xmachines/play-solid/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-solid/variables/schema.md +71 -0
- package/api/@xmachines/play-solid-router/README.md +31 -52
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +30 -53
- package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +9 -8
- package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +38 -35
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +12 -12
- package/api/@xmachines/play-solid-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +17 -7
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
- package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-svelte/README.md +13 -28
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-svelte/functions/getActorContext.md +1 -1
- package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +7 -1
- package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
- package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +12 -12
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +4 -4
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +14 -14
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +11 -3
- package/api/@xmachines/play-svelte/variables/schema.md +16 -0
- package/api/@xmachines/play-svelte-spa-router/README.md +22 -41
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +22 -21
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -2
- package/api/@xmachines/play-svelte-spa-router/interfaces/BasePathOptions.md +5 -5
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +8 -8
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-svelte-spa-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterConnection.md +36 -7
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +3 -3
- package/api/@xmachines/play-sveltekit-router/README.md +17 -35
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +22 -21
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -2
- package/api/@xmachines/play-sveltekit-router/interfaces/BasePathOptions.md +5 -5
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +8 -8
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-sveltekit-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterConnection.md +36 -7
- package/api/@xmachines/play-tanstack-react-router/README.md +19 -43
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +18 -17
- package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +11 -8
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +16 -9
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +10 -10
- package/api/@xmachines/play-tanstack-react-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +17 -7
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-tanstack-router/README.md +6 -4
- package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +17 -20
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +3 -3
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/README.md +26 -52
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +49 -45
- package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +9 -8
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +10 -10
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +17 -7
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-url/README.md +69 -0
- package/api/@xmachines/play-url/errors/README.md +17 -0
- package/api/@xmachines/play-url/errors/classes/InvalidBasePathError.md +200 -0
- package/api/@xmachines/play-url/errors/classes/InvalidRoutePatternError.md +203 -0
- package/api/@xmachines/play-url/errors/classes/MissingBasePathParamError.md +199 -0
- package/api/@xmachines/play-url/index/README.md +65 -0
- package/api/@xmachines/play-url/index/functions/cleanFrameworkParams.md +39 -0
- package/api/@xmachines/play-url/index/functions/getCandidates.md +29 -0
- package/api/@xmachines/play-url/index/functions/getCompiledPattern.md +31 -0
- package/api/@xmachines/play-url/index/functions/getIndexKey.md +30 -0
- package/api/@xmachines/play-url/index/functions/getNormalizedParamNameMap.md +32 -0
- package/api/@xmachines/play-url/index/functions/getPatternParamNames.md +29 -0
- package/api/@xmachines/play-url/index/functions/getRequiredPatternParamNames.md +39 -0
- package/api/@xmachines/play-url/index/functions/holdsUnsubstitutedParam.md +36 -0
- package/api/@xmachines/play-url/index/functions/isParameterizedPattern.md +36 -0
- package/api/@xmachines/{play-router → play-url/index}/functions/joinBasePath.md +2 -2
- package/api/@xmachines/{play-router → play-url/index}/functions/normalizeBasePath.md +2 -2
- package/api/@xmachines/play-url/index/functions/normalizeParamNames.md +36 -0
- package/api/@xmachines/play-url/index/functions/parsePattern.md +27 -0
- package/api/@xmachines/{play-router → play-url/index}/functions/pickOwnParams.md +4 -4
- package/api/@xmachines/{play-router → play-url/index}/functions/resolveBasePath.md +2 -2
- package/api/@xmachines/play-url/index/functions/resolveFrameworkParams.md +49 -0
- package/api/@xmachines/{play-router → play-url/index}/functions/stripBasePath.md +2 -2
- package/api/@xmachines/play-url/index/interfaces/BasePathOptions.md +28 -0
- package/api/@xmachines/{play-router → play-url/index}/interfaces/FrameworkParamsSource.md +9 -9
- package/api/@xmachines/play-url/index/interfaces/GroupPart.md +15 -0
- package/api/@xmachines/play-url/index/interfaces/LiteralPart.md +14 -0
- package/api/@xmachines/play-url/index/interfaces/ParamPart.md +21 -0
- package/api/@xmachines/play-url/index/interfaces/ParsedPattern.md +23 -0
- package/api/@xmachines/play-url/index/interfaces/PatternParam.md +15 -0
- package/api/@xmachines/{play-router → play-url/index}/interfaces/ResolvedBasePath.md +6 -6
- package/api/@xmachines/play-url/index/type-aliases/PatternModifier.md +11 -0
- package/api/@xmachines/play-url/index/type-aliases/PatternPart.md +9 -0
- package/api/@xmachines/play-url/index/type-aliases/URLPatternCtor.md +22 -0
- package/api/@xmachines/play-url/index/type-aliases/URLPatternLike.md +68 -0
- package/api/@xmachines/{play-router → play-url/index}/variables/NO_BASE_PATH.md +2 -2
- package/api/@xmachines/play-url/index/variables/URLPattern.md +21 -0
- package/api/@xmachines/play-view/README.md +165 -0
- package/api/@xmachines/play-view/errors/README.md +17 -0
- package/api/@xmachines/play-view/errors/classes/ReadOnlyContextError.md +192 -0
- package/api/@xmachines/play-view/index/README.md +55 -0
- package/api/@xmachines/{play-actor → play-view/index}/functions/attachRenderErrorHandler.md +6 -6
- package/api/@xmachines/{play-actor → play-view/index}/functions/composePlayState.md +2 -2
- package/api/@xmachines/play-view/index/functions/createFailureLatch.md +20 -0
- package/api/@xmachines/play-view/index/functions/createReportGuard.md +26 -0
- package/api/@xmachines/{play-actor → play-view/index}/functions/createViewStoreLifecycle.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/guardContextWrites.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/refreshContextSubtree.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/reuseComposedState.md +3 -3
- package/api/@xmachines/play-view/index/functions/sameViewInputs.md +25 -0
- package/api/@xmachines/{play-actor → play-view/index}/functions/toAtomState.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/typedSpec.md +2 -2
- package/api/@xmachines/play-view/index/interfaces/BaseActorProviderProps.md +49 -0
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/BaseViewContextValue.md +12 -12
- package/api/@xmachines/play-view/index/interfaces/FailureLatch.md +60 -0
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/PlaySpec.md +8 -8
- package/api/@xmachines/play-view/index/interfaces/ReportGuard.md +92 -0
- package/api/@xmachines/play-view/index/interfaces/ReportGuardMessages.md +18 -0
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ResolveViewStoreOptions.md +5 -5
- package/api/@xmachines/play-view/index/interfaces/ViewInputs.md +19 -0
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ViewStoreLifecycle.md +6 -5
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ViewStoreResolution.md +7 -7
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/Viewable.md +5 -5
- package/api/@xmachines/play-view/index/type-aliases/ViewActor.md +26 -0
- package/api/@xmachines/{play-actor → play-view/index}/variables/CONTEXT_STATE_KEY.md +2 -2
- package/api/@xmachines/play-vue/README.md +46 -42
- package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/functions/usePlayView.md +6 -1
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +13 -8
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +15 -10
- package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +11 -3
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue/variables/schema.md +71 -0
- package/api/@xmachines/play-vue-router/README.md +34 -77
- package/api/@xmachines/play-vue-router/errors/README.md +8 -0
- package/api/@xmachines/play-vue-router/errors/classes/VueRouterNavigationError.md +193 -0
- package/api/@xmachines/play-vue-router/errors/classes/VueRouterSendError.md +177 -0
- package/api/@xmachines/play-vue-router/index/README.md +20 -0
- package/api/@xmachines/play-vue-router/index/classes/RouteMap.md +157 -0
- package/api/@xmachines/play-vue-router/{classes → index/classes}/VueRouterBridge.md +24 -43
- package/api/@xmachines/play-vue-router/index/interfaces/PlayRouteEvent.md +130 -0
- package/api/@xmachines/play-vue-router/index/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-vue-router/{interfaces → index/interfaces}/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-vue-router/{interfaces → index/interfaces}/RouteMapping.md +6 -6
- package/api/@xmachines/play-vue-router/{interfaces → index/interfaces}/RouterBridge.md +5 -5
- package/api/@xmachines/play-vue-router/{variables → index/variables}/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-xstate/README.md +163 -98
- package/api/@xmachines/play-xstate/errors/README.md +13 -0
- package/api/@xmachines/play-xstate/errors/classes/ActorThrewNonErrorError.md +199 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidEventError.md +198 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidMachineError.md +169 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidRouteHandlerError.md +197 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidRouteMetadataError.md +176 -0
- package/api/@xmachines/play-xstate/errors/classes/MissingRouteParamError.md +199 -0
- package/api/@xmachines/play-xstate/errors/classes/MissingStateIdError.md +203 -0
- package/api/@xmachines/play-xstate/index/README.md +38 -0
- package/api/@xmachines/play-xstate/index/classes/PlayerActor.md +584 -0
- package/api/@xmachines/play-xstate/index/functions/compose.md +224 -0
- package/api/@xmachines/play-xstate/index/functions/definePlayer.md +158 -0
- package/api/@xmachines/play-xstate/index/interfaces/PlayerConfig.md +22 -0
- package/api/@xmachines/play-xstate/{interfaces → index/interfaces}/PlayerFactoryResumeOptions.md +3 -3
- package/api/@xmachines/play-xstate/{interfaces → index/interfaces}/PlayerOptions.md +8 -8
- package/api/@xmachines/play-xstate/index/type-aliases/Capability.md +33 -0
- package/api/@xmachines/play-xstate/index/type-aliases/PlayerConstructor.md +39 -0
- package/api/@xmachines/play-xstate/index/type-aliases/PlayerFactory.md +27 -0
- package/api/@xmachines/play-xstate/index/variables/DISPOSE.md +34 -0
- package/api/@xmachines/play-xstate/with-routing/README.md +46 -0
- package/api/@xmachines/play-xstate/{functions → with-routing/functions}/buildRouteUrl.md +2 -2
- package/api/@xmachines/play-xstate/{functions → with-routing/functions}/deriveRoute.md +4 -4
- package/api/@xmachines/play-xstate/{functions → with-routing/functions}/formatPlayRouteTransitions.md +2 -2
- package/api/@xmachines/play-xstate/{functions → with-routing/functions}/isAbsoluteRoute.md +3 -3
- package/api/@xmachines/play-xstate/with-routing/functions/withRouting.md +36 -0
- package/api/@xmachines/play-xstate/{interfaces → with-routing/interfaces}/RouteContext.md +6 -6
- package/api/@xmachines/play-xstate/with-routing/interfaces/RouteObject.md +34 -0
- package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteData.md +12 -0
- package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteDataResolver.md +31 -0
- package/api/@xmachines/play-xstate/{type-aliases → with-routing/type-aliases}/RouteMachineConfig.md +5 -5
- package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteMetadata.md +11 -0
- package/api/@xmachines/play-xstate/{type-aliases → with-routing/type-aliases}/RouteStateNode.md +21 -7
- package/api/@xmachines/play-xstate/with-view/README.md +31 -0
- package/api/@xmachines/play-xstate/with-view/functions/withView.md +32 -0
- package/api/@xmachines/shared/README.md +10 -32
- package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +2 -2
- package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +1 -1
- package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +2 -1
- package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +4 -4
- package/api/README.md +2 -0
- package/api/llms.txt +15 -10
- package/contributing/architecture.md +97 -65
- package/contributing/configuration.md +142 -41
- package/contributing/deployment.md +30 -28
- package/contributing/development.md +94 -31
- package/contributing/testing.md +90 -31
- package/examples/README.md +9 -7
- package/examples/form-validation.md +3 -2
- package/examples/multi-router-integration.md +61 -39
- package/examples/routing-patterns.md +15 -14
- package/examples/traffic-light.md +11 -5
- package/guides/README.md +1 -0
- package/guides/actor-model.md +35 -26
- package/guides/getting-started.md +47 -44
- package/guides/inspector.md +4 -4
- package/guides/routing.md +245 -0
- package/guides/signals.md +43 -0
- package/guides/state-machines.md +16 -17
- package/package.json +10 -9
- package/rfc/play.md +35 -22
- package/api/@xmachines/play-actor/classes/AbstractActor.md +0 -505
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +0 -48
- package/api/@xmachines/play-actor/interfaces/Routable.md +0 -14
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +0 -122
- package/api/@xmachines/play-react/type-aliases/PlayRendererProps.md +0 -13
- package/api/@xmachines/play-react-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-react-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +0 -35
- package/api/@xmachines/play-router/functions/getPatternParamNames.md +0 -24
- package/api/@xmachines/play-router/functions/getRequiredPatternParamNames.md +0 -36
- package/api/@xmachines/play-router/functions/routeExists.md +0 -26
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +0 -13
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +0 -15
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +0 -17
- package/api/@xmachines/play-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +0 -135
- package/api/@xmachines/play-router/interfaces/RoutableActor.md +0 -65
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +0 -12
- package/api/@xmachines/play-router/interfaces/RouteObject.md +0 -21
- package/api/@xmachines/play-router/interfaces/RouteTree.md +0 -21
- package/api/@xmachines/play-router/type-aliases/BaseRouteMapping.md +0 -13
- package/api/@xmachines/play-router/type-aliases/PlayRouterBridgeConstructor.md +0 -36
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +0 -11
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +0 -471
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +0 -13
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +0 -9
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +0 -9
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +0 -29
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +0 -31
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +0 -13
- package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +0 -9
- package/api/@xmachines/play-vue/variables/getPlayViewContext.md +0 -34
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +0 -135
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +0 -13
- package/api/@xmachines/play-vue-router/type-aliases/VueRouteMap.md +0 -13
- package/api/@xmachines/play-vue-router/variables/VueRouteMap.md +0 -13
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +0 -532
- package/api/@xmachines/play-xstate/functions/composeGuards.md +0 -86
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +0 -72
- package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +0 -43
- package/api/@xmachines/play-xstate/functions/definePlayer.md +0 -78
- package/api/@xmachines/play-xstate/functions/eventMatches.md +0 -45
- package/api/@xmachines/play-xstate/functions/hasContext.md +0 -45
- package/api/@xmachines/play-xstate/functions/negateGuard.md +0 -67
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +0 -20
- package/api/@xmachines/play-xstate/interfaces/RouteObject.md +0 -17
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +0 -19
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +0 -36
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +0 -23
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +0 -26
- package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +0 -9
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: TanStackRouterBridgeBase
|
|
4
4
|
|
|
5
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:133](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
5
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:133](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L133)
|
|
6
6
|
|
|
7
7
|
The shared TanStack Router adapter. It implements the RouterBridge protocol through RouterBridgeBase
|
|
8
8
|
|
|
@@ -29,7 +29,7 @@ Architectural invariants:
|
|
|
29
29
|
|
|
30
30
|
The class is concrete. You can create an instance of it directly. Each framework
|
|
31
31
|
package re-exports it, or makes a subclass of it, only to bind the public name of
|
|
32
|
-
the adapter.
|
|
32
|
+
the adapter.
|
|
33
33
|
|
|
34
34
|
## Example
|
|
35
35
|
|
|
@@ -41,11 +41,7 @@ return () => bridge.disconnect();
|
|
|
41
41
|
|
|
42
42
|
## Extends
|
|
43
43
|
|
|
44
|
-
- [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md)
|
|
45
|
-
|
|
46
|
-
## Extended by
|
|
47
|
-
|
|
48
|
-
- [`TanStackSolidRouterBridge`](../../play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md)
|
|
44
|
+
- [`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md)
|
|
49
45
|
|
|
50
46
|
## Constructors
|
|
51
47
|
|
|
@@ -56,10 +52,11 @@ new TanStackRouterBridgeBase(
|
|
|
56
52
|
router,
|
|
57
53
|
actor,
|
|
58
54
|
routeMap,
|
|
59
|
-
options?
|
|
55
|
+
options?
|
|
56
|
+
): TanStackRouterBridgeBase;
|
|
60
57
|
```
|
|
61
58
|
|
|
62
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:151](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
59
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:151](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L151)
|
|
63
60
|
|
|
64
61
|
Creates a TanStack Router bridge
|
|
65
62
|
|
|
@@ -78,7 +75,7 @@ Creates a TanStack Router bridge
|
|
|
78
75
|
|
|
79
76
|
#### Overrides
|
|
80
77
|
|
|
81
|
-
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`constructor`](../../play-router/classes/RouterBridgeBase.md#constructor)
|
|
78
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`constructor`](../../play-router/index/classes/RouterBridgeBase.md#constructor)
|
|
82
79
|
|
|
83
80
|
## Accessors
|
|
84
81
|
|
|
@@ -90,7 +87,7 @@ Creates a TanStack Router bridge
|
|
|
90
87
|
get basePath(): string;
|
|
91
88
|
```
|
|
92
89
|
|
|
93
|
-
Defined in: play-router/
|
|
90
|
+
Defined in: [play-router/src/router-bridge-base.ts:256](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/router-bridge-base.ts#L256)
|
|
94
91
|
|
|
95
92
|
The resolved URL prefix that the machine of this bridge is mounted under, or `""`
|
|
96
93
|
when the machine owns the complete router.
|
|
@@ -103,7 +100,7 @@ The resolved URL prefix of the mount, or `""` when the machine owns the complete
|
|
|
103
100
|
|
|
104
101
|
#### Inherited from
|
|
105
102
|
|
|
106
|
-
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`basePath`](../../play-router/classes/RouterBridgeBase.md#basepath)
|
|
103
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`basePath`](../../play-router/index/classes/RouterBridgeBase.md#basepath)
|
|
107
104
|
|
|
108
105
|
---
|
|
109
106
|
|
|
@@ -115,7 +112,7 @@ The resolved URL prefix of the mount, or `""` when the machine owns the complete
|
|
|
115
112
|
get basePathParams(): Readonly<Record<string, string>>;
|
|
116
113
|
```
|
|
117
114
|
|
|
118
|
-
Defined in: play-router/
|
|
115
|
+
Defined in: [play-router/src/router-bridge-base.ts:285](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/router-bridge-base.ts#L285)
|
|
119
116
|
|
|
120
117
|
The resolved values of the `:param` segments of the mount, or `{}` for a prefix
|
|
121
118
|
without a param.
|
|
@@ -156,7 +153,7 @@ mount while the machine stays on the same route, and no event goes out.
|
|
|
156
153
|
|
|
157
154
|
#### Inherited from
|
|
158
155
|
|
|
159
|
-
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`basePathParams`](../../play-router/classes/RouterBridgeBase.md#basepathparams)
|
|
156
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`basePathParams`](../../play-router/index/classes/RouterBridgeBase.md#basepathparams)
|
|
160
157
|
|
|
161
158
|
## Methods
|
|
162
159
|
|
|
@@ -166,7 +163,7 @@ mount while the machine stays on the same route, and no event goes out.
|
|
|
166
163
|
connect(): void;
|
|
167
164
|
```
|
|
168
165
|
|
|
169
|
-
Defined in: play-router/
|
|
166
|
+
Defined in: [play-router/src/router-bridge-base.ts:507](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/router-bridge-base.ts#L507)
|
|
170
167
|
|
|
171
168
|
Connects the router bridge to the Actor.
|
|
172
169
|
|
|
@@ -190,7 +187,7 @@ An adapter that needs a different behavior of the first synchronization override
|
|
|
190
187
|
|
|
191
188
|
#### Inherited from
|
|
192
189
|
|
|
193
|
-
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`connect`](../../play-router/classes/RouterBridgeBase.md#connect)
|
|
190
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`connect`](../../play-router/index/classes/RouterBridgeBase.md#connect)
|
|
194
191
|
|
|
195
192
|
---
|
|
196
193
|
|
|
@@ -200,7 +197,7 @@ An adapter that needs a different behavior of the first synchronization override
|
|
|
200
197
|
disconnect(): void;
|
|
201
198
|
```
|
|
202
199
|
|
|
203
|
-
Defined in: play-router/
|
|
200
|
+
Defined in: [play-router/src/router-bridge-base.ts:765](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/router-bridge-base.ts#L765)
|
|
204
201
|
|
|
205
202
|
Disconnects the router bridge from the Actor.
|
|
206
203
|
|
|
@@ -213,7 +210,7 @@ framework.
|
|
|
213
210
|
|
|
214
211
|
#### Inherited from
|
|
215
212
|
|
|
216
|
-
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`disconnect`](../../play-router/classes/RouterBridgeBase.md#disconnect)
|
|
213
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`disconnect`](../../play-router/index/classes/RouterBridgeBase.md#disconnect)
|
|
217
214
|
|
|
218
215
|
---
|
|
219
216
|
|
|
@@ -223,7 +220,7 @@ framework.
|
|
|
223
220
|
setBasePath(basePath?, basePathParams?): void;
|
|
224
221
|
```
|
|
225
222
|
|
|
226
|
-
Defined in: play-router/
|
|
223
|
+
Defined in: [play-router/src/router-bridge-base.ts:325](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/router-bridge-base.ts#L325)
|
|
227
224
|
|
|
228
225
|
Moves the machine to a different mount point, while it stays connected.
|
|
229
226
|
|
|
@@ -275,4 +272,4 @@ bridge.setBasePath("/:region/:machineId/play", { region: "us", machineId });
|
|
|
275
272
|
|
|
276
273
|
#### Inherited from
|
|
277
274
|
|
|
278
|
-
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`setBasePath`](../../play-router/classes/RouterBridgeBase.md#setbasepath)
|
|
275
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`setBasePath`](../../play-router/index/classes/RouterBridgeBase.md#setbasepath)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type TanStackRouteMapLike = object;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:95](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
9
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:95](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L95)
|
|
10
10
|
|
|
11
11
|
The narrow route-map surface that `TanStackRouterBridgeBase` requires.
|
|
12
12
|
`RouteMap` from `@xmachines/play-router` satisfies it. The bridge converts a
|
|
@@ -24,7 +24,7 @@ that holds one form only still resolves the path.
|
|
|
24
24
|
getPathByStateId(id): string | null | undefined;
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:97](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
27
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:97](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L97)
|
|
28
28
|
|
|
29
29
|
#### Parameters
|
|
30
30
|
|
|
@@ -44,7 +44,7 @@ Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:97](https:/
|
|
|
44
44
|
getStateIdByPath(path): string | null | undefined;
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:96](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
47
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:96](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L96)
|
|
48
48
|
|
|
49
49
|
#### Parameters
|
|
50
50
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type TanStackRouterLike = object;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:39](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
9
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:39](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L39)
|
|
10
10
|
|
|
11
11
|
The type-only interface of the TanStack Router surface that
|
|
12
12
|
`TanStackRouterBridgeBase` uses. An instance of `@tanstack/react-router` and an
|
|
@@ -20,7 +20,7 @@ instance of `@tanstack/solid-router` both satisfy it.
|
|
|
20
20
|
history: object;
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:72](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
23
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:72](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L72)
|
|
24
24
|
|
|
25
25
|
#### location
|
|
26
26
|
|
|
@@ -69,7 +69,7 @@ subscribe(handler): () => void;
|
|
|
69
69
|
optional options?: object;
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:58](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
72
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:58](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L58)
|
|
73
73
|
|
|
74
74
|
The options of the router. The bridge reads `parseSearch` only.
|
|
75
75
|
|
|
@@ -103,7 +103,7 @@ optional parseSearch(search): Record<string, unknown>;
|
|
|
103
103
|
optional load(): void | Promise<void>;
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:71](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
106
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:71](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L71)
|
|
107
107
|
|
|
108
108
|
Runs the TanStack route matching and the loaders again for the current location.
|
|
109
109
|
This method is optional. The bridge calls it after every navigation. The matching
|
|
@@ -128,7 +128,7 @@ bridge then synchronizes synchronously.
|
|
|
128
128
|
navigate(args): void;
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:48](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
131
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:48](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L48)
|
|
132
132
|
|
|
133
133
|
Navigates to a location. `search` carries the query of the target.
|
|
134
134
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**TanStack Solid Router adapter for XMachines Universal Player Architecture**
|
|
6
6
|
|
|
7
|
-
[](https://opensource.org/licenses/MIT) [](https://opensource.org/licenses/MIT) [](https://www.npmjs.com/package/@xmachines/play-tanstack-solid-router)
|
|
8
8
|
|
|
9
9
|
This package integrates TanStack Solid Router with the TC39 Signals. The logic then drives the navigation through the Solid.js reactivity.
|
|
10
10
|
|
|
@@ -30,34 +30,28 @@ pnpm add @xmachines/play-tanstack-solid-router @xmachines/play-router
|
|
|
30
30
|
|
|
31
31
|
- `@tanstack/solid-router` `^1.168.7`
|
|
32
32
|
- `solid-js` `^1.8.0`
|
|
33
|
-
- `xstate` `^5.31.0`
|
|
34
33
|
|
|
35
34
|
## Current Exports
|
|
36
35
|
|
|
37
36
|
- `TanStackSolidRouterBridge` — the primary adapter class
|
|
38
37
|
- `PlayRouterProvider` — the Solid component that manages the bridge lifecycle
|
|
39
38
|
- `PlayRouterProviderProps`, `TanStackRouterInstance` (types)
|
|
40
|
-
- `
|
|
41
|
-
- `
|
|
42
|
-
- `
|
|
39
|
+
- `RoutableActor` — `currentRoute`, `initialRoute` and `send`, from `@xmachines/play-router`. It names no view: routing implies no rendering. A renderer callback that reads `currentView` declares its own actor type, and the constraint keeps it whole
|
|
40
|
+
- `RouteMap`, `RouteMapping`, `RouteMapOptions` (re-exported from `@xmachines/play-router`)
|
|
41
|
+
- `createRouteMap` (re-exported from `@xmachines/play-router/xstate`)
|
|
43
42
|
- `TanStackRouterLike` (type)
|
|
44
43
|
- `RouterBridge`, `PlayRouteEvent` (types)
|
|
45
44
|
|
|
46
|
-
## URLPattern Support
|
|
47
|
-
|
|
48
|
-
This package matches each route pattern with the [URLPattern API](https://developer.mozilla.org/en-US/docs/Web/API/URLPattern), through [`@xmachines/play-router`](../play-router/README.md).
|
|
49
|
-
|
|
50
|
-
URLPattern is native in Node.js 24+ and in a modern browser (Chrome 95+, Firefox 117+, Safari 16.4+). In an older environment, load a polyfill **before** you import this package. See [`@xmachines/play-router`](../play-router/README.md) for the details.
|
|
51
|
-
|
|
52
45
|
## Quick Start
|
|
53
46
|
|
|
54
47
|
```tsx
|
|
55
48
|
import { createRouter, createRootRoute, createRoute } from "@tanstack/solid-router";
|
|
56
49
|
import { createMachine } from "xstate";
|
|
57
|
-
import { definePlayer,
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
|
|
50
|
+
import { definePlayer, compose, PlayerActor } from "@xmachines/play-xstate";
|
|
51
|
+
import { formatPlayRouteTransitions, withRouting } from "@xmachines/play-xstate/routing";
|
|
52
|
+
import { extractMachineRoutes, getRoutableRoutes } from "@xmachines/play-router/xstate";
|
|
53
|
+
import { TanStackSolidRouterBridge } from "@xmachines/play-tanstack-solid-router";
|
|
54
|
+
import { createRouteMap } from "@xmachines/play-router/xstate";
|
|
61
55
|
const machine = createMachine(
|
|
62
56
|
formatPlayRouteTransitions({
|
|
63
57
|
id: "app",
|
|
@@ -82,7 +76,8 @@ const tanstackRoutes = getRoutableRoutes(extractMachineRoutes(machine)).map((rou
|
|
|
82
76
|
);
|
|
83
77
|
const router = createRouter({ routeTree: rootRoute.addChildren(tanstackRoutes) });
|
|
84
78
|
|
|
85
|
-
|
|
79
|
+
// The bridge needs the routing capability
|
|
80
|
+
const actor = definePlayer({ machine, actor: compose(PlayerActor, withRouting) })();
|
|
86
81
|
actor.start();
|
|
87
82
|
|
|
88
83
|
const bridge = new TanStackSolidRouterBridge(router, actor, routeMap);
|
|
@@ -122,7 +117,6 @@ class TanStackSolidRouterBridge {
|
|
|
122
117
|
constructor(router: TanStackRouterLike, actor: RoutableActor, routeMap: RouteMap);
|
|
123
118
|
connect(): void;
|
|
124
119
|
disconnect(): void;
|
|
125
|
-
dispose(): void; // alias for disconnect()
|
|
126
120
|
}
|
|
127
121
|
```
|
|
128
122
|
|
|
@@ -139,7 +133,7 @@ class TanStackSolidRouterBridge {
|
|
|
139
133
|
This Solid component creates a `TanStackSolidRouterBridge`, connects it, and cleans it up for you.
|
|
140
134
|
|
|
141
135
|
```ts
|
|
142
|
-
interface PlayRouterProviderProps<TActor extends
|
|
136
|
+
interface PlayRouterProviderProps<TActor extends RoutableActor = RoutableActor> {
|
|
143
137
|
/** The actor to sync with TanStack Solid Router. */
|
|
144
138
|
actor: TActor;
|
|
145
139
|
/** The TanStack Router instance returned by `createRouter`. */
|
|
@@ -153,9 +147,9 @@ interface PlayRouterProviderProps<TActor extends PlayActor = PlayActor> {
|
|
|
153
147
|
|
|
154
148
|
The component creates the bridge synchronously, during its own evaluation, because this is the execution model of Solid. It disconnects the bridge in `onCleanup`, when Solid disposes of the component.
|
|
155
149
|
|
|
156
|
-
### `RouteMap
|
|
150
|
+
### `RouteMap`, and `createRouteMap` of `@xmachines/play-router/xstate`
|
|
157
151
|
|
|
158
|
-
|
|
152
|
+
They map each state ID to a URL path, and each URL back to a state ID. This package exports `RouteMap`, and it re-exports `createRouteMap` never: the barrel names no state machine.
|
|
159
153
|
|
|
160
154
|
```ts
|
|
161
155
|
const routeMap = new RouteMap([
|
|
@@ -172,8 +166,7 @@ routeMap.getStateIdByPath("/unknown"); // null
|
|
|
172
166
|
Or build from a machine directly:
|
|
173
167
|
|
|
174
168
|
```ts
|
|
175
|
-
import { createRouteMap } from "@xmachines/play-
|
|
176
|
-
|
|
169
|
+
import { createRouteMap } from "@xmachines/play-router/xstate";
|
|
177
170
|
const routeMap = createRouteMap(machine); // machine: your routable machine (states carry meta.route)
|
|
178
171
|
```
|
|
179
172
|
|
|
@@ -224,12 +217,17 @@ A user navigates to `/dashboard`, and the user is not authenticated:
|
|
|
224
217
|
```tsx
|
|
225
218
|
import { createRouter, RouterProvider, createRootRoute, createRoute } from "@tanstack/solid-router";
|
|
226
219
|
import { onCleanup } from "solid-js";
|
|
227
|
-
import { PlayRouterProvider
|
|
228
|
-
import {
|
|
229
|
-
import {
|
|
220
|
+
import { PlayRouterProvider } from "@xmachines/play-tanstack-solid-router";
|
|
221
|
+
import { createRouteMap } from "@xmachines/play-router/xstate";
|
|
222
|
+
import { definePlayer, compose, PlayerActor } from "@xmachines/play-xstate";
|
|
223
|
+
import { withRouting } from "@xmachines/play-xstate/routing";
|
|
224
|
+
import { extractMachineRoutes, getRoutableRoutes } from "@xmachines/play-router/xstate";
|
|
230
225
|
import { authMachine } from "./auth-machine.js"; // your routable machine (states carry meta.route)
|
|
231
226
|
|
|
232
|
-
const createPlayer = definePlayer({
|
|
227
|
+
const createPlayer = definePlayer({
|
|
228
|
+
machine: authMachine,
|
|
229
|
+
actor: compose(PlayerActor, withRouting),
|
|
230
|
+
});
|
|
233
231
|
const actor = createPlayer();
|
|
234
232
|
actor.start();
|
|
235
233
|
|
|
@@ -280,29 +278,6 @@ Bridge-first data flow:
|
|
|
280
278
|
|
|
281
279
|
The routing infrastructure therefore stays passive, and the state machine keeps the control of the business logic.
|
|
282
280
|
|
|
283
|
-
## Testing
|
|
284
|
-
|
|
285
|
-
Run tests for this package in isolation:
|
|
286
|
-
|
|
287
|
-
```bash
|
|
288
|
-
pnpm --filter @xmachines/play-tanstack-solid-router test
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
Or from the package directory:
|
|
292
|
-
|
|
293
|
-
```bash
|
|
294
|
-
pnpm test
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
**Browser tests** (`test/browser/**/*.browser.test.ts`) run in real Chromium through Playwright. They cover the asynchronous sequences that jsdom cannot reproduce: BACK and FORWARD navigation through `router.history.subscribe`, echo suppression under real microtask timing, the check of each `navigate({ to })` call, and subscriber teardown on `disconnect()` and on `dispose()`.
|
|
298
|
-
|
|
299
|
-
```bash
|
|
300
|
-
# Run browser tests only
|
|
301
|
-
pnpm exec vitest --config vitest.browser.config.ts --project play-tanstack-solid-router-browser
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
Coverage thresholds: lines 80%, functions 80%, branches 70%, statements 80%.
|
|
305
|
-
|
|
306
281
|
## Related Packages
|
|
307
282
|
|
|
308
283
|
- [@xmachines/play-router](../play-router/README.md) — core router primitives and `RouterBridgeBase`
|
|
@@ -315,6 +290,7 @@ Coverage thresholds: lines 80%, functions 80%, branches 70%, statements 80%.
|
|
|
315
290
|
|
|
316
291
|
- [Demo](../../../examples/@xmachines/play-tanstack-solid-router-demo/README.md)
|
|
317
292
|
- [SolidJS renderer](../play-solid/README.md)
|
|
293
|
+
- [Routing guide](../../../guides/routing.md) — the URLPattern language that a `meta.route` path declares
|
|
318
294
|
|
|
319
295
|
## License
|
|
320
296
|
|
|
@@ -327,9 +303,9 @@ MIT — see [LICENSE](LICENSE).
|
|
|
327
303
|
|
|
328
304
|
## Interfaces
|
|
329
305
|
|
|
330
|
-
- [PlayActor](interfaces/PlayActor.md)
|
|
331
306
|
- [PlayRouteEvent](interfaces/PlayRouteEvent.md)
|
|
332
307
|
- [PlayRouterProviderProps](interfaces/PlayRouterProviderProps.md)
|
|
308
|
+
- [RoutableActor](interfaces/RoutableActor.md)
|
|
333
309
|
- [RouteMapOptions](interfaces/RouteMapOptions.md)
|
|
334
310
|
- [RouteMapping](interfaces/RouteMapping.md)
|
|
335
311
|
- [RouterBridge](interfaces/RouterBridge.md)
|
|
@@ -338,7 +314,6 @@ MIT — see [LICENSE](LICENSE).
|
|
|
338
314
|
|
|
339
315
|
- [PlayRouterBridgeConstructor](type-aliases/PlayRouterBridgeConstructor.md)
|
|
340
316
|
- [PlayRouterProviderBaseProps](type-aliases/PlayRouterProviderBaseProps.md)
|
|
341
|
-
- [~~RoutableActor~~](type-aliases/RoutableActor.md)
|
|
342
317
|
- [TanStackRouterInstance](type-aliases/TanStackRouterInstance.md)
|
|
343
318
|
- [TanStackRouterLike](type-aliases/TanStackRouterLike.md)
|
|
344
319
|
|
|
@@ -349,4 +324,3 @@ MIT — see [LICENSE](LICENSE).
|
|
|
349
324
|
## Functions
|
|
350
325
|
|
|
351
326
|
- [createPlayRouterProvider](functions/createPlayRouterProvider.md)
|
|
352
|
-
- [createRouteMap](functions/createRouteMap.md)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: RouteMap
|
|
4
4
|
|
|
5
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
5
|
+
Defined in: [play-router/src/base-route-map.ts:111](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/base-route-map.ts#L111)
|
|
6
6
|
|
|
7
7
|
The shared base class of the route map for both directions.
|
|
8
8
|
|
|
@@ -17,12 +17,18 @@ of its own, and it inherits the complete public API from here.
|
|
|
17
17
|
- The class keeps each result of a first match in an LRU cache. The default size
|
|
18
18
|
is 500 entries, and the `cacheSize` constructor option changes it
|
|
19
19
|
|
|
20
|
-
**The syntax of a pattern
|
|
20
|
+
**The syntax of a pattern:** the whole URLPattern pathname grammar. The forms used most
|
|
21
|
+
often are:
|
|
21
22
|
|
|
22
23
|
- `:param` — a necessary segment. It matches exactly one segment without a `/`
|
|
23
24
|
- `:param?` — an optional segment. It matches zero segments or one segment without a `/`
|
|
24
25
|
- `*` — a wildcard. It matches each number of segments, as URLPattern defines
|
|
25
26
|
|
|
27
|
+
A `{…}` group, a `:param(\d+)` constraint, a `+` modifier and a `\:` escape are read
|
|
28
|
+
too. The [routing guide](../../../../guides/routing.md) states every form, the prefix
|
|
29
|
+
rule, and the one divergence from the standard: a param name of this library can hold a
|
|
30
|
+
hyphen.
|
|
31
|
+
|
|
26
32
|
**The forms of a stateId:** you can register a stateId, and you can look one up,
|
|
27
33
|
in the form `"#stateId"` or in the form `"stateId"`. `RouteMap` makes the
|
|
28
34
|
canonical form itself. `getStateIdByPath` returns the stateId exactly as you
|
|
@@ -58,7 +64,7 @@ map.getPathByStateId("missing"); // null
|
|
|
58
64
|
new RouteMap(mappings, options?): RouteMap;
|
|
59
65
|
```
|
|
60
66
|
|
|
61
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
67
|
+
Defined in: [play-router/src/base-route-map.ts:139](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/base-route-map.ts#L139)
|
|
62
68
|
|
|
63
69
|
Builds a route map from an array of the mappings between a state ID and a path.
|
|
64
70
|
|
|
@@ -87,7 +93,7 @@ candidates is therefore efficient.
|
|
|
87
93
|
getPathByStateId(stateId): string | null;
|
|
88
94
|
```
|
|
89
95
|
|
|
90
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
96
|
+
Defined in: [play-router/src/base-route-map.ts:242](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/base-route-map.ts#L242)
|
|
91
97
|
|
|
92
98
|
Returns the path pattern of a state ID.
|
|
93
99
|
|
|
@@ -123,7 +129,7 @@ map.getPathByStateId("missing"); // null
|
|
|
123
129
|
getStateIdByPath(path): string | null;
|
|
124
130
|
```
|
|
125
131
|
|
|
126
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
132
|
+
Defined in: [play-router/src/base-route-map.ts:197](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/base-route-map.ts#L197)
|
|
127
133
|
|
|
128
134
|
Resolves a URL path to its state ID.
|
|
129
135
|
|
|
@@ -2,23 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: TanStackSolidRouterBridge
|
|
4
4
|
|
|
5
|
-
Defined in: [play-tanstack-
|
|
5
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:133](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L133)
|
|
6
6
|
|
|
7
|
-
TanStack
|
|
7
|
+
The shared TanStack Router adapter. It implements the RouterBridge protocol through RouterBridgeBase
|
|
8
8
|
|
|
9
9
|
## Remarks
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
15
|
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
23
|
+
does internally: `router.history.subscribe(router.load)`.
|
|
24
|
+
|
|
25
|
+
Architectural invariants:
|
|
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
|
|
29
|
+
|
|
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.
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
const bridge = new TanStackRouterBridgeBase(router, actor, routeMap);
|
|
38
|
+
bridge.connect();
|
|
39
|
+
return () => bridge.disconnect();
|
|
40
|
+
```
|
|
18
41
|
|
|
19
42
|
## Extends
|
|
20
43
|
|
|
21
|
-
- [`
|
|
44
|
+
- [`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md)
|
|
22
45
|
|
|
23
46
|
## Constructors
|
|
24
47
|
|
|
@@ -29,10 +52,11 @@ new TanStackSolidRouterBridge(
|
|
|
29
52
|
router,
|
|
30
53
|
actor,
|
|
31
54
|
routeMap,
|
|
32
|
-
options?
|
|
55
|
+
options?
|
|
56
|
+
): TanStackRouterBridgeBase;
|
|
33
57
|
```
|
|
34
58
|
|
|
35
|
-
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:151](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
59
|
+
Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:151](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L151)
|
|
36
60
|
|
|
37
61
|
Creates a TanStack Router bridge
|
|
38
62
|
|
|
@@ -41,17 +65,17 @@ Creates a TanStack Router bridge
|
|
|
41
65
|
| Parameter | Type | Description |
|
|
42
66
|
| ---------- | ----------------------------------------------------------------------------------------- | --------------------------------------------------------- |
|
|
43
67
|
| `router` | [`TanStackRouterLike`](../type-aliases/TanStackRouterLike.md) | The TanStack Router instance from `createRouter` |
|
|
44
|
-
| `actor` | [`RoutableActor`](
|
|
68
|
+
| `actor` | [`RoutableActor`](../interfaces/RoutableActor.md) | The XMachines actor instance |
|
|
45
69
|
| `routeMap` | [`TanStackRouteMapLike`](../../play-tanstack-router/type-aliases/TanStackRouteMapLike.md) | The bidirectional map between the state IDs and the paths |
|
|
46
70
|
| `options?` | [`BasePathOptions`](../../play-dom-router/interfaces/BasePathOptions.md) | - |
|
|
47
71
|
|
|
48
72
|
#### Returns
|
|
49
73
|
|
|
50
|
-
`
|
|
74
|
+
`TanStackRouterBridgeBase`
|
|
51
75
|
|
|
52
|
-
####
|
|
76
|
+
#### Overrides
|
|
53
77
|
|
|
54
|
-
[`
|
|
78
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`constructor`](../../play-router/index/classes/RouterBridgeBase.md#constructor)
|
|
55
79
|
|
|
56
80
|
## Accessors
|
|
57
81
|
|
|
@@ -63,7 +87,7 @@ Creates a TanStack Router bridge
|
|
|
63
87
|
get basePath(): string;
|
|
64
88
|
```
|
|
65
89
|
|
|
66
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
90
|
+
Defined in: [play-router/src/router-bridge-base.ts:256](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/router-bridge-base.ts#L256)
|
|
67
91
|
|
|
68
92
|
The resolved URL prefix that the machine of this bridge is mounted under, or `""`
|
|
69
93
|
when the machine owns the complete router.
|
|
@@ -76,7 +100,7 @@ The resolved URL prefix of the mount, or `""` when the machine owns the complete
|
|
|
76
100
|
|
|
77
101
|
#### Inherited from
|
|
78
102
|
|
|
79
|
-
[`
|
|
103
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`basePath`](../../play-router/index/classes/RouterBridgeBase.md#basepath)
|
|
80
104
|
|
|
81
105
|
---
|
|
82
106
|
|
|
@@ -88,7 +112,7 @@ The resolved URL prefix of the mount, or `""` when the machine owns the complete
|
|
|
88
112
|
get basePathParams(): Readonly<Record<string, string>>;
|
|
89
113
|
```
|
|
90
114
|
|
|
91
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
115
|
+
Defined in: [play-router/src/router-bridge-base.ts:285](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/router-bridge-base.ts#L285)
|
|
92
116
|
|
|
93
117
|
The resolved values of the `:param` segments of the mount, or `{}` for a prefix
|
|
94
118
|
without a param.
|
|
@@ -129,7 +153,7 @@ mount while the machine stays on the same route, and no event goes out.
|
|
|
129
153
|
|
|
130
154
|
#### Inherited from
|
|
131
155
|
|
|
132
|
-
[`
|
|
156
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`basePathParams`](../../play-router/index/classes/RouterBridgeBase.md#basepathparams)
|
|
133
157
|
|
|
134
158
|
## Methods
|
|
135
159
|
|
|
@@ -139,7 +163,7 @@ mount while the machine stays on the same route, and no event goes out.
|
|
|
139
163
|
connect(): void;
|
|
140
164
|
```
|
|
141
165
|
|
|
142
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
166
|
+
Defined in: [play-router/src/router-bridge-base.ts:507](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/router-bridge-base.ts#L507)
|
|
143
167
|
|
|
144
168
|
Connects the router bridge to the Actor.
|
|
145
169
|
|
|
@@ -163,7 +187,7 @@ An adapter that needs a different behavior of the first synchronization override
|
|
|
163
187
|
|
|
164
188
|
#### Inherited from
|
|
165
189
|
|
|
166
|
-
[`
|
|
190
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`connect`](../../play-router/index/classes/RouterBridgeBase.md#connect)
|
|
167
191
|
|
|
168
192
|
---
|
|
169
193
|
|
|
@@ -173,7 +197,7 @@ An adapter that needs a different behavior of the first synchronization override
|
|
|
173
197
|
disconnect(): void;
|
|
174
198
|
```
|
|
175
199
|
|
|
176
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
200
|
+
Defined in: [play-router/src/router-bridge-base.ts:765](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/router-bridge-base.ts#L765)
|
|
177
201
|
|
|
178
202
|
Disconnects the router bridge from the Actor.
|
|
179
203
|
|
|
@@ -186,27 +210,7 @@ framework.
|
|
|
186
210
|
|
|
187
211
|
#### Inherited from
|
|
188
212
|
|
|
189
|
-
[`
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
### ~~dispose()~~
|
|
194
|
-
|
|
195
|
-
```ts
|
|
196
|
-
dispose(): void;
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
Defined in: [play-tanstack-solid-router/src/solid-router-bridge.ts:49](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-tanstack-solid-router/src/solid-router-bridge.ts#L49)
|
|
200
|
-
|
|
201
|
-
Disposes of the bridge. This method is the alias of disconnect.
|
|
202
|
-
|
|
203
|
-
#### Returns
|
|
204
|
-
|
|
205
|
-
`void`
|
|
206
|
-
|
|
207
|
-
#### Deprecated
|
|
208
|
-
|
|
209
|
-
Use [disconnect](#disconnect). Will be removed in the next major.
|
|
213
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`disconnect`](../../play-router/index/classes/RouterBridgeBase.md#disconnect)
|
|
210
214
|
|
|
211
215
|
---
|
|
212
216
|
|
|
@@ -216,7 +220,7 @@ Use [disconnect](#disconnect). Will be removed in the next major.
|
|
|
216
220
|
setBasePath(basePath?, basePathParams?): void;
|
|
217
221
|
```
|
|
218
222
|
|
|
219
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
223
|
+
Defined in: [play-router/src/router-bridge-base.ts:325](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/router-bridge-base.ts#L325)
|
|
220
224
|
|
|
221
225
|
Moves the machine to a different mount point, while it stays connected.
|
|
222
226
|
|
|
@@ -268,4 +272,4 @@ bridge.setBasePath("/:region/:machineId/play", { region: "us", machineId });
|
|
|
268
272
|
|
|
269
273
|
#### Inherited from
|
|
270
274
|
|
|
271
|
-
[`
|
|
275
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`setBasePath`](../../play-router/index/classes/RouterBridgeBase.md#setbasepath)
|