@xmachines/docs 3.0.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 +11 -100
- 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/{functions → index/functions}/asCleanup.md +2 -2
- 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/{type-aliases → index/type-aliases}/Cleanup.md +3 -3
- package/api/@xmachines/play/{type-aliases → index/type-aliases}/DisposeKey.md +2 -2
- package/api/@xmachines/play/{type-aliases → index/type-aliases}/PlayEvent.md +4 -4
- package/api/@xmachines/play/{variables → index/variables}/DISPOSE.md +2 -2
- package/api/@xmachines/play-actor/README.md +78 -229
- 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 +28 -40
- 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 +4 -4
- package/api/@xmachines/play-dom/functions/createRenderer.md +1 -1
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +3 -3
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +3 -3
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +6 -6
- package/api/@xmachines/play-dom/type-aliases/Cleanup.md +2 -2
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +29 -12
- package/api/@xmachines/play-dom-router/README.md +70 -70
- 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 +9 -3
- package/api/@xmachines/play-dom-router/functions/createRouter.md +8 -14
- package/api/@xmachines/play-dom-router/interfaces/BasePathOptions.md +5 -5
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +70 -26
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +14 -14
- 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 +8 -8
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +36 -23
- package/api/@xmachines/play-dom-router/type-aliases/Cleanup.md +2 -2
- package/api/@xmachines/play-dom-router/variables/DISPOSE.md +2 -2
- package/api/@xmachines/play-react/README.md +17 -39
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +14 -10
- 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 +6 -6
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +4 -4
- 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 +104 -196
- 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 +10 -10
- 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-xstate → play-router/index}/variables/DISPOSE.md +3 -3
- 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-router/{functions → 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 +2 -24
- package/api/@xmachines/play-signals/functions/watchSignal.md +1 -1
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalState.md +3 -3
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +4 -4
- package/api/@xmachines/play-signals/type-aliases/Cleanup.md +2 -2
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
- package/api/@xmachines/play-solid/README.md +14 -31
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/usePlayView.md +1 -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 +8 -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 +11 -26
- 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 +1 -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 +8 -8
- 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 +8 -8
- 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-actor → play-view/index}/functions/createFailureLatch.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/createReportGuard.md +2 -2
- 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-actor → play-view/index}/functions/sameViewInputs.md +2 -2
- 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-actor → play-view/index}/interfaces/FailureLatch.md +6 -5
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/PlaySpec.md +8 -8
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ReportGuard.md +6 -6
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ReportGuardMessages.md +6 -6
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ResolveViewStoreOptions.md +5 -5
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ViewInputs.md +7 -7
- 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 +15 -33
- 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 +1 -1
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +9 -9
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +11 -11
- 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 +153 -105
- 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-router → play-xstate/index}/variables/DISPOSE.md +3 -3
- 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 +94 -66
- package/contributing/configuration.md +85 -26
- package/contributing/deployment.md +30 -28
- package/contributing/development.md +51 -10
- package/contributing/testing.md +87 -28
- 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 +49 -46
- package/guides/inspector.md +4 -4
- package/guides/routing.md +245 -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/type-aliases/DisposablePlayUI.md +0 -36
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-dom-router/interfaces/DisposableBrowserHistory.md +0 -262
- package/api/@xmachines/play-dom-router/interfaces/DisposableVanillaRouter.md +0 -80
- 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/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 -39
- 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 -568
- 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: SolidRouterBridge
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [play-solid-router/src/solid-router-bridge.ts:73](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-solid-router/src/solid-router-bridge.ts#L73)
|
|
6
6
|
|
|
7
7
|
The SolidJS Router integration bridge. It extends RouterBridgeBase
|
|
8
8
|
|
|
@@ -17,14 +17,16 @@ it. Two cases still reach it: a bridge under a `basePath`, where Solid matched a
|
|
|
17
17
|
of the HOST and its params describe the route of the machine never, and a location
|
|
18
18
|
that fills a segment of the pattern while Solid reports none of its names.
|
|
19
19
|
|
|
20
|
-
This is about the CALLS, and not about the
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
bridge does.
|
|
20
|
+
This is about the CALLS that a navigation makes, and not about the availability of the
|
|
21
|
+
API. `@xmachines/play-router` carries `urlpattern-polyfill` as an ordinary dependency
|
|
22
|
+
and it uses the native URLPattern when the runtime has one, so the API is present
|
|
23
|
+
whatever this bridge does. A BAD pattern is a question of the route map: `RouteMap`
|
|
24
|
+
compiles each parameterized route in its constructor and throws an
|
|
25
|
+
`InvalidRoutePatternError` there. See the `extractParams` override of this class.
|
|
24
26
|
|
|
25
27
|
## Extends
|
|
26
28
|
|
|
27
|
-
- [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md)
|
|
29
|
+
- [`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md)
|
|
28
30
|
|
|
29
31
|
## Constructors
|
|
30
32
|
|
|
@@ -37,10 +39,11 @@ new SolidRouterBridge(
|
|
|
37
39
|
params,
|
|
38
40
|
actor,
|
|
39
41
|
routeMap,
|
|
40
|
-
options?
|
|
42
|
+
options?
|
|
43
|
+
): SolidRouterBridge;
|
|
41
44
|
```
|
|
42
45
|
|
|
43
|
-
Defined in: [
|
|
46
|
+
Defined in: [play-solid-router/src/solid-router-bridge.ts:96](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-solid-router/src/solid-router-bridge.ts#L96)
|
|
44
47
|
|
|
45
48
|
Creates a SolidJS Router bridge
|
|
46
49
|
|
|
@@ -48,14 +51,14 @@ Creates a SolidJS Router bridge
|
|
|
48
51
|
|
|
49
52
|
#### Parameters
|
|
50
53
|
|
|
51
|
-
| Parameter | Type | Description
|
|
52
|
-
| --------------- | ------------------------------------------------------------------------ |
|
|
53
|
-
| `solidNavigate` | `Navigator` | The result of the useNavigate() hook
|
|
54
|
-
| `location` | [`LocationLike`](../../play-router/interfaces/LocationLike.md)
|
|
55
|
-
| `params` | `Params` | The result of the useParams() hook. The bridge reads each path parameter directly from it. A parameterized route therefore
|
|
56
|
-
| `actor` | [`RoutableActor`](
|
|
57
|
-
| `routeMap` | [`RouteMap`](RouteMap.md) | The bidirectional map between the state IDs and the paths
|
|
58
|
-
| `options?` | [`BasePathOptions`](../../play-dom-router/interfaces/BasePathOptions.md) | -
|
|
54
|
+
| Parameter | Type | Description |
|
|
55
|
+
| --------------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
56
|
+
| `solidNavigate` | `Navigator` | The result of the useNavigate() hook |
|
|
57
|
+
| `location` | [`LocationLike`](../../play-router/index/interfaces/LocationLike.md) | The result of the useLocation() hook |
|
|
58
|
+
| `params` | `Params` | The result of the useParams() hook. The bridge reads each path parameter directly from it. A parameterized route therefore runs no URLPattern match of its own |
|
|
59
|
+
| `actor` | [`RoutableActor`](../interfaces/RoutableActor.md) | The XMachines actor instance |
|
|
60
|
+
| `routeMap` | [`RouteMap`](RouteMap.md) | The bidirectional map between the state IDs and the paths |
|
|
61
|
+
| `options?` | [`BasePathOptions`](../../play-dom-router/interfaces/BasePathOptions.md) | - |
|
|
59
62
|
|
|
60
63
|
#### Returns
|
|
61
64
|
|
|
@@ -63,7 +66,7 @@ Creates a SolidJS Router bridge
|
|
|
63
66
|
|
|
64
67
|
#### Overrides
|
|
65
68
|
|
|
66
|
-
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`constructor`](../../play-router/classes/RouterBridgeBase.md#constructor)
|
|
69
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`constructor`](../../play-router/index/classes/RouterBridgeBase.md#constructor)
|
|
67
70
|
|
|
68
71
|
## Accessors
|
|
69
72
|
|
|
@@ -75,7 +78,7 @@ Creates a SolidJS Router bridge
|
|
|
75
78
|
get basePath(): string;
|
|
76
79
|
```
|
|
77
80
|
|
|
78
|
-
Defined in: [
|
|
81
|
+
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)
|
|
79
82
|
|
|
80
83
|
The resolved URL prefix that the machine of this bridge is mounted under, or `""`
|
|
81
84
|
when the machine owns the complete router.
|
|
@@ -88,7 +91,7 @@ The resolved URL prefix of the mount, or `""` when the machine owns the complete
|
|
|
88
91
|
|
|
89
92
|
#### Inherited from
|
|
90
93
|
|
|
91
|
-
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`basePath`](../../play-router/classes/RouterBridgeBase.md#basepath)
|
|
94
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`basePath`](../../play-router/index/classes/RouterBridgeBase.md#basepath)
|
|
92
95
|
|
|
93
96
|
---
|
|
94
97
|
|
|
@@ -100,7 +103,7 @@ The resolved URL prefix of the mount, or `""` when the machine owns the complete
|
|
|
100
103
|
get basePathParams(): Readonly<Record<string, string>>;
|
|
101
104
|
```
|
|
102
105
|
|
|
103
|
-
Defined in: [
|
|
106
|
+
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)
|
|
104
107
|
|
|
105
108
|
The resolved values of the `:param` segments of the mount, or `{}` for a prefix
|
|
106
109
|
without a param.
|
|
@@ -141,7 +144,7 @@ mount while the machine stays on the same route, and no event goes out.
|
|
|
141
144
|
|
|
142
145
|
#### Inherited from
|
|
143
146
|
|
|
144
|
-
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`basePathParams`](../../play-router/classes/RouterBridgeBase.md#basepathparams)
|
|
147
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`basePathParams`](../../play-router/index/classes/RouterBridgeBase.md#basepathparams)
|
|
145
148
|
|
|
146
149
|
## Methods
|
|
147
150
|
|
|
@@ -151,7 +154,7 @@ mount while the machine stays on the same route, and no event goes out.
|
|
|
151
154
|
connect(): void;
|
|
152
155
|
```
|
|
153
156
|
|
|
154
|
-
Defined in: [
|
|
157
|
+
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)
|
|
155
158
|
|
|
156
159
|
Connects the router bridge to the Actor.
|
|
157
160
|
|
|
@@ -175,7 +178,7 @@ An adapter that needs a different behavior of the first synchronization override
|
|
|
175
178
|
|
|
176
179
|
#### Inherited from
|
|
177
180
|
|
|
178
|
-
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`connect`](../../play-router/classes/RouterBridgeBase.md#connect)
|
|
181
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`connect`](../../play-router/index/classes/RouterBridgeBase.md#connect)
|
|
179
182
|
|
|
180
183
|
---
|
|
181
184
|
|
|
@@ -185,7 +188,7 @@ An adapter that needs a different behavior of the first synchronization override
|
|
|
185
188
|
disconnect(): void;
|
|
186
189
|
```
|
|
187
190
|
|
|
188
|
-
Defined in: [
|
|
191
|
+
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)
|
|
189
192
|
|
|
190
193
|
Disconnects the router bridge from the Actor.
|
|
191
194
|
|
|
@@ -198,33 +201,7 @@ framework.
|
|
|
198
201
|
|
|
199
202
|
#### Inherited from
|
|
200
203
|
|
|
201
|
-
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`disconnect`](../../play-router/classes/RouterBridgeBase.md#disconnect)
|
|
202
|
-
|
|
203
|
-
---
|
|
204
|
-
|
|
205
|
-
### ~~dispose()~~
|
|
206
|
-
|
|
207
|
-
```ts
|
|
208
|
-
dispose(): void;
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
Defined in: [packages/play-solid-router/src/solid-router-bridge.ts:256](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-solid-router/src/solid-router-bridge.ts#L256)
|
|
212
|
-
|
|
213
|
-
Disposes of the bridge. This method is the alias of disconnect.
|
|
214
|
-
|
|
215
|
-
#### Returns
|
|
216
|
-
|
|
217
|
-
`void`
|
|
218
|
-
|
|
219
|
-
#### Example
|
|
220
|
-
|
|
221
|
-
```tsx
|
|
222
|
-
onCleanup(() => bridge.dispose());
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
#### Deprecated
|
|
226
|
-
|
|
227
|
-
Use [disconnect](#disconnect). Will be removed in the next major.
|
|
204
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`disconnect`](../../play-router/index/classes/RouterBridgeBase.md#disconnect)
|
|
228
205
|
|
|
229
206
|
---
|
|
230
207
|
|
|
@@ -234,7 +211,7 @@ Use [disconnect](#disconnect). Will be removed in the next major.
|
|
|
234
211
|
setBasePath(basePath?, basePathParams?): void;
|
|
235
212
|
```
|
|
236
213
|
|
|
237
|
-
Defined in: [
|
|
214
|
+
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)
|
|
238
215
|
|
|
239
216
|
Moves the machine to a different mount point, while it stays connected.
|
|
240
217
|
|
|
@@ -286,4 +263,4 @@ bridge.setBasePath("/:region/:machineId/play", { region: "us", machineId });
|
|
|
286
263
|
|
|
287
264
|
#### Inherited from
|
|
288
265
|
|
|
289
|
-
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`setBasePath`](../../play-router/classes/RouterBridgeBase.md#setbasepath)
|
|
266
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`setBasePath`](../../play-router/index/classes/RouterBridgeBase.md#setbasepath)
|
|
@@ -3,24 +3,25 @@
|
|
|
3
3
|
# Function: createPlayRouterProvider()
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
|
-
function createPlayRouterProvider<TRouter>(BridgeCtor): <TActor>(props) => any;
|
|
6
|
+
function createPlayRouterProvider<TRouter, TActorBase>(BridgeCtor): <TActor>(props) => any;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [
|
|
9
|
+
Defined in: [play-solid-router/src/create-play-router-provider.tsx:51](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-solid-router/src/create-play-router-provider.tsx#L51)
|
|
10
10
|
|
|
11
11
|
Builds a `PlayRouterProvider` for one Solid bridge class.
|
|
12
12
|
|
|
13
13
|
## Type Parameters
|
|
14
14
|
|
|
15
|
-
| Type Parameter |
|
|
16
|
-
|
|
|
17
|
-
| `TRouter`
|
|
15
|
+
| Type Parameter | Default type |
|
|
16
|
+
| ------------------------------------------------------------------------ | ------------------------------------------------- |
|
|
17
|
+
| `TRouter` | - |
|
|
18
|
+
| `TActorBase` _extends_ [`RoutableActor`](../interfaces/RoutableActor.md) | [`RoutableActor`](../interfaces/RoutableActor.md) |
|
|
18
19
|
|
|
19
20
|
## Parameters
|
|
20
21
|
|
|
21
|
-
| Parameter | Type
|
|
22
|
-
| ------------ |
|
|
23
|
-
| `BridgeCtor` | [`PlayRouterBridgeConstructor`](../type-aliases/PlayRouterBridgeConstructor.md)\<`TRouter`\> | The bridge class, built as `new BridgeCtor(router, actor, routeMap, options)`. |
|
|
22
|
+
| Parameter | Type | Description |
|
|
23
|
+
| ------------ | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
|
|
24
|
+
| `BridgeCtor` | [`PlayRouterBridgeConstructor`](../type-aliases/PlayRouterBridgeConstructor.md)\<`TRouter`, `TActorBase`\> | The bridge class, built as `new BridgeCtor(router, actor, routeMap, options)`. |
|
|
24
25
|
|
|
25
26
|
## Returns
|
|
26
27
|
|
|
@@ -1,47 +1,51 @@
|
|
|
1
1
|
[API](../../../README.md) / [@xmachines/play-solid-router](../README.md) / PlayActor
|
|
2
2
|
|
|
3
|
-
# Interface: PlayActor
|
|
3
|
+
# Interface: PlayActor\<TSnapshot, TEvent\>
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [play-actor/src/play-actor.ts:75](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-actor/src/play-actor.ts#L75)
|
|
6
6
|
|
|
7
|
-
The
|
|
8
|
-
adapter: `play-solid-router`, `play-vue-router`, `play-react-router`, and each
|
|
9
|
-
adapter on the shared framework router bridge bases.
|
|
7
|
+
The actor contract of the Play Architecture. It names NO engine.
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
An actor of XMachines holds exactly two things, and this interface names both: the
|
|
10
|
+
reactive snapshot, and the typed event dispatch. A state machine library is the concern
|
|
11
|
+
of an adapter, and `@xmachines/play-xstate` is the adapter of XState v5.
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
example for the renderer callback parameter of `PlayRouterProvider`, and in
|
|
19
|
-
`PlayRenderer`.
|
|
13
|
+
Both type parameters carry their real type through, and neither one erases it.
|
|
14
|
+
`AbstractActor` declares `Signal.State<unknown>`, so every consumer of a snapshot reads
|
|
15
|
+
`unknown` and asserts its way back.
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
A capability is optional, and each one lives with the package that holds its shared
|
|
18
|
+
machinery: `Routable` is in `@xmachines/play-router`, and `Viewable` is in
|
|
19
|
+
`@xmachines/play-view`. Neither one names an engine either, and neither one implies the
|
|
20
|
+
other.
|
|
23
21
|
|
|
24
22
|
## Example
|
|
25
23
|
|
|
26
24
|
```typescript
|
|
27
|
-
import type { PlayActor } from "@xmachines/play-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
import type { PlayActor } from "@xmachines/play-actor";
|
|
26
|
+
import type { Viewable } from "@xmachines/play-view";
|
|
27
|
+
|
|
28
|
+
// A renderer reads the view capability and the send of the contract. It names no
|
|
29
|
+
// engine, and it keeps the event union of the machine.
|
|
30
|
+
function mount<TSnapshot, TEvent extends ActorEvent>(
|
|
31
|
+
actor: PlayActor<TSnapshot, TEvent> & Viewable,
|
|
32
|
+
): void {
|
|
33
|
+
actor.currentView.get();
|
|
31
34
|
}
|
|
32
35
|
```
|
|
33
36
|
|
|
34
|
-
##
|
|
37
|
+
## Type Parameters
|
|
35
38
|
|
|
36
|
-
|
|
39
|
+
| Type Parameter | Default type | Description |
|
|
40
|
+
| ---------------------------------------------------------------------------- | --------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
41
|
+
| `TSnapshot` | `unknown` | The type of the snapshot that `state` holds, for example `SnapshotFrom<TMachine>`. |
|
|
42
|
+
| `TEvent` _extends_ [`ActorEvent`](../../play-actor/interfaces/ActorEvent.md) | [`ActorEvent`](../../play-actor/interfaces/ActorEvent.md) | The event union that `send` accepts, for example `EventFromLogic<TMachine>`. |
|
|
37
43
|
|
|
38
44
|
## Properties
|
|
39
45
|
|
|
40
|
-
| Property
|
|
41
|
-
|
|
|
42
|
-
| <a id="property-
|
|
43
|
-
| <a id="property-currentview"></a> `currentView` | `readonly` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<[`PlaySpec`](../../play-actor/interfaces/PlaySpec.md) \| `null`\> | The TC39 Signal of the current view spec of the actor, or `null` when no view is active. | - | [packages/play-router/src/types.ts:315](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-router/src/types.ts#L315) |
|
|
44
|
-
| <a id="property-initialroute"></a> `initialRoute` | `readonly` | `string` \| `null` | The route of the initial state of the machine. The constructor fixes it. A router bridge compares it with the browser URL. It therefore separates a deep link, where the router wins, from a restore of a session, where the actor wins. | [`RoutableActor`](../../play-dom-router/interfaces/RoutableActor.md).[`initialRoute`](../../play-dom-router/interfaces/RoutableActor.md#property-initialroute) | [packages/play-router/src/types.ts:281](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-router/src/types.ts#L281) |
|
|
46
|
+
| Property | Modifier | Type | Description | Defined in |
|
|
47
|
+
| ----------------------------------- | ---------- | ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
48
|
+
| <a id="property-state"></a> `state` | `readonly` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<`TSnapshot`\> | The reactive snapshot of the current actor state. The infrastructure observes this signal, and it reacts to each state change. It therefore holds no coupling to the internal state machine of the actor. | [play-actor/src/play-actor.ts:82](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-actor/src/play-actor.ts#L82) |
|
|
45
49
|
|
|
46
50
|
## Methods
|
|
47
51
|
|
|
@@ -51,20 +55,19 @@ function MyRouterProvider({ actor }: { actor: PlayActor }) {
|
|
|
51
55
|
send(event): void;
|
|
52
56
|
```
|
|
53
57
|
|
|
54
|
-
Defined in: [
|
|
58
|
+
Defined in: [play-actor/src/play-actor.ts:90](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-actor/src/play-actor.ts#L90)
|
|
59
|
+
|
|
60
|
+
Sends an event to the actor.
|
|
55
61
|
|
|
56
|
-
|
|
62
|
+
`TEvent` gives the type safety: a concrete adapter binds it to the event union of its
|
|
63
|
+
own machine, and the compiler then refuses an event that the machine does not declare.
|
|
57
64
|
|
|
58
65
|
#### Parameters
|
|
59
66
|
|
|
60
|
-
| Parameter | Type
|
|
61
|
-
| --------- |
|
|
62
|
-
| `event` |
|
|
67
|
+
| Parameter | Type |
|
|
68
|
+
| --------- | -------- |
|
|
69
|
+
| `event` | `TEvent` |
|
|
63
70
|
|
|
64
71
|
#### Returns
|
|
65
72
|
|
|
66
73
|
`void`
|
|
67
|
-
|
|
68
|
-
#### Inherited from
|
|
69
|
-
|
|
70
|
-
[`RoutableActor`](../../play-dom-router/interfaces/RoutableActor.md).[`send`](../../play-dom-router/interfaces/RoutableActor.md#send)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayRouteEvent
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [play-router/src/types.ts:336](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L336)
|
|
6
6
|
|
|
7
7
|
The routing event, with its parameters and its query
|
|
8
8
|
|
|
@@ -118,18 +118,13 @@ Use `play.route` when you need a navigation that knows the parameters, with the
|
|
|
118
118
|
gives you the complete URLPatternResult, for an advanced use such as a debug or an
|
|
119
119
|
analysis of the pattern.
|
|
120
120
|
|
|
121
|
-
## Indexable
|
|
122
|
-
|
|
123
|
-
```ts
|
|
124
|
-
[key: string]: unknown
|
|
125
|
-
```
|
|
126
|
-
|
|
127
121
|
## Properties
|
|
128
122
|
|
|
129
|
-
| Property | Modifier | Type
|
|
130
|
-
| -------------------------------------- | ---------- |
|
|
131
|
-
| <a id="property-
|
|
132
|
-
| <a id="property-
|
|
133
|
-
| <a id="property-
|
|
134
|
-
| <a id="property-
|
|
135
|
-
| <a id="property-
|
|
123
|
+
| Property | Modifier | Type | Description | Defined in |
|
|
124
|
+
| -------------------------------------- | ---------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
125
|
+
| <a id="property-data"></a> `data?` | `readonly` | [`RouteData`](../../play-router/index/type-aliases/RouteData.md) | The extra data that the SENDER of this event supplies: a router bridge, or the code of an application. It is not what the target state declares — that is [RouteObject.data](../../play-router/index/interfaces/RouteObject.md#property-data), and a resolver there reads this field. | [play-router/src/types.ts:346](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L346) |
|
|
126
|
+
| <a id="property-match"></a> `match?` | `readonly` | `unknown` | - | [play-router/src/types.ts:347](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L347) |
|
|
127
|
+
| <a id="property-params"></a> `params?` | `readonly` | `Record`\<`string`, `string`\> | - | [play-router/src/types.ts:339](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L339) |
|
|
128
|
+
| <a id="property-query"></a> `query?` | `readonly` | `Record`\<`string`, `string`\> | - | [play-router/src/types.ts:340](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L340) |
|
|
129
|
+
| <a id="property-to"></a> `to` | `readonly` | `string` | - | [play-router/src/types.ts:338](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L338) |
|
|
130
|
+
| <a id="property-type"></a> `type` | `readonly` | `"play.route"` | - | [play-router/src/types.ts:337](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L337) |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayRouterProviderProps\<TActor\>
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [play-solid-router/src/play-router-provider.tsx:47](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-solid-router/src/play-router-provider.tsx#L47)
|
|
6
6
|
|
|
7
7
|
The props of the `PlayRouterProvider` of Solid Router.
|
|
8
8
|
|
|
@@ -16,17 +16,17 @@ both directions. Take them from `useNavigate()`, from `useLocation()`, and from
|
|
|
16
16
|
|
|
17
17
|
## Type Parameters
|
|
18
18
|
|
|
19
|
-
| Type Parameter
|
|
20
|
-
|
|
|
21
|
-
| `TActor` _extends_ [`
|
|
19
|
+
| Type Parameter | Default type |
|
|
20
|
+
| ------------------------------------------------------ | ----------------------------------- |
|
|
21
|
+
| `TActor` _extends_ [`RoutableActor`](RoutableActor.md) | [`RoutableActor`](RoutableActor.md) |
|
|
22
22
|
|
|
23
23
|
## Properties
|
|
24
24
|
|
|
25
|
-
| Property | Type | Description | Inherited from | Defined in
|
|
26
|
-
| ------------------------------------------------------ | --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
|
|
27
|
-
| <a id="property-actor"></a> `actor` | `TActor` | The actor to keep in step with the router. It must be a stable reference: give the same actor instance on every render. An actor in the JSX, or a new actor on each render, makes the bridge disconnect and connect again each time. | `PlayRouterProviderBaseProps.actor` | [
|
|
28
|
-
| <a id="property-basepath"></a> `basePath?` | `string` | Mounts the routes of the machine under a URL prefix that the host owns, so that the routes of the host and the routes of the machine share one router. `actor`, `router`, and `routeMap` each need a stable reference. This prop needs none, and it rebuilds the bridge never: a change moves the live bridge with `setBasePath()`, so a host route that renders again with a new prefix keeps the actor, the route map, and its cache. The prefix says WHERE an actor is mounted, and never WHICH actor is mounted. An actor never changes identity, so a prefix segment that IDENTIFIES the actor gives a different `actor` prop instead, and THAT rebuilds the bridge — which is correct, because one actor takes one bridge. A location outside the prefix belongs completely to the host: the bridge sends no event there, and it corrects no URL there. Every `:param` needs a value. An unresolved one throws a `MissingBasePathParamError` out of the mount effect, because the bridge writes no URL without it. Render this component only after the host holds the value, which a route loader or a `useParams()` call does already. | `PlayRouterProviderBaseProps.basePath` | [
|
|
29
|
-
| <a id="property-basepathparams"></a> `basePathParams?` | `Record`\<`string`, `string` \| `number`\> | The values of the `:param` segments of [PlayRouterProviderBaseProps.basePath](../../play-react-router/interfaces/PlayRouterProviderProps.md#property-basepath), for example `{ machineId }` for `basePath="/:machineId/play"`. An inline object literal is correct here: the provider compares this prop by value, and a move to the same prefix does nothing. | `PlayRouterProviderBaseProps.basePathParams` | [
|
|
30
|
-
| <a id="property-renderer"></a> `renderer` | (`actor`, `router`) => `any` | The renderer callback receives the same concrete actor type as the prop. | `PlayRouterProviderBaseProps.renderer` | [
|
|
31
|
-
| <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md) | The route map of both directions, for the lookup between a state ID and a URL path. **It must be a stable reference.** The provider builds the bridge again on each change of the identity of `routeMap`. A value in the JSX, for example `createRouteMapFromTree(routeTree)`, makes a new object on every render, and the bridge therefore connects again on every render. Hold the value with `useMemo`: `const routeMap = useMemo(() => createRouteMapFromTree(routeTree), [routeTree]);` | `PlayRouterProviderBaseProps.routeMap` | [
|
|
32
|
-
| <a id="property-router"></a> `router` | [`SolidRouterHooks`](../type-aliases/SolidRouterHooks.md) | The router instance that the bridge keeps in step with the actor. It must be a stable reference. | `PlayRouterProviderBaseProps.router` | [
|
|
25
|
+
| Property | Type | Description | Inherited from | Defined in |
|
|
26
|
+
| ------------------------------------------------------ | --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
27
|
+
| <a id="property-actor"></a> `actor` | `TActor` | The actor to keep in step with the router. It must be a stable reference: give the same actor instance on every render. An actor in the JSX, or a new actor on each render, makes the bridge disconnect and connect again each time. | `PlayRouterProviderBaseProps.actor` | [play-router/src/provider-lifecycle.ts:42](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/provider-lifecycle.ts#L42) |
|
|
28
|
+
| <a id="property-basepath"></a> `basePath?` | `string` | Mounts the routes of the machine under a URL prefix that the host owns, so that the routes of the host and the routes of the machine share one router. `actor`, `router`, and `routeMap` each need a stable reference. This prop needs none, and it rebuilds the bridge never: a change moves the live bridge with `setBasePath()`, so a host route that renders again with a new prefix keeps the actor, the route map, and its cache. The prefix says WHERE an actor is mounted, and never WHICH actor is mounted. An actor never changes identity, so a prefix segment that IDENTIFIES the actor gives a different `actor` prop instead, and THAT rebuilds the bridge — which is correct, because one actor takes one bridge. A location outside the prefix belongs completely to the host: the bridge sends no event there, and it corrects no URL there. Every `:param` needs a value. An unresolved one throws a `MissingBasePathParamError` out of the mount effect, because the bridge writes no URL without it. Render this component only after the host holds the value, which a route loader or a `useParams()` call does already. | `PlayRouterProviderBaseProps.basePath` | [play-router/src/provider-lifecycle.ts:80](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/provider-lifecycle.ts#L80) |
|
|
29
|
+
| <a id="property-basepathparams"></a> `basePathParams?` | `Record`\<`string`, `string` \| `number`\> | The values of the `:param` segments of [PlayRouterProviderBaseProps.basePath](../../play-react-router/interfaces/PlayRouterProviderProps.md#property-basepath), for example `{ machineId }` for `basePath="/:machineId/play"`. An inline object literal is correct here: the provider compares this prop by value, and a move to the same prefix does nothing. | `PlayRouterProviderBaseProps.basePathParams` | [play-router/src/provider-lifecycle.ts:89](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/provider-lifecycle.ts#L89) |
|
|
30
|
+
| <a id="property-renderer"></a> `renderer` | (`actor`, `router`) => `any` | The renderer callback receives the same concrete actor type as the prop. | `PlayRouterProviderBaseProps.renderer` | [play-router/src/provider-lifecycle.ts:91](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/provider-lifecycle.ts#L91) |
|
|
31
|
+
| <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md) | The route map of both directions, for the lookup between a state ID and a URL path. **It must be a stable reference.** The provider builds the bridge again on each change of the identity of `routeMap`. A value in the JSX, for example `createRouteMapFromTree(routeTree)`, makes a new object on every render, and the bridge therefore connects again on every render. Hold the value with `useMemo`: `const routeMap = useMemo(() => createRouteMapFromTree(routeTree), [routeTree]);` | `PlayRouterProviderBaseProps.routeMap` | [play-router/src/provider-lifecycle.ts:57](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/provider-lifecycle.ts#L57) |
|
|
32
|
+
| <a id="property-router"></a> `router` | [`SolidRouterHooks`](../type-aliases/SolidRouterHooks.md) | The router instance that the bridge keeps in step with the actor. It must be a stable reference. | `PlayRouterProviderBaseProps.router` | [play-router/src/provider-lifecycle.ts:44](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/provider-lifecycle.ts#L44) |
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-solid-router](../README.md) / RoutableActor
|
|
2
|
+
|
|
3
|
+
# Interface: RoutableActor
|
|
4
|
+
|
|
5
|
+
Defined in: [play-router/src/types.ts:392](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L392)
|
|
6
|
+
|
|
7
|
+
The minimal actor interface that `RouterBridgeBase` and every framework router
|
|
8
|
+
adapter require.
|
|
9
|
+
|
|
10
|
+
It names `send` itself, and it therefore gives `RouterBridgeBase.actor.send` a type that
|
|
11
|
+
accepts a `PlayRouteEvent` directly. That removes the unsafe cast
|
|
12
|
+
`(actor.send as (e: PlayRouteEvent) => void)`.
|
|
13
|
+
|
|
14
|
+
It is [Routable](../../play-router/index/interfaces/Routable.md) with `send`. The two members of the capability are declared once,
|
|
15
|
+
in `Routable`, and this interface extends it. A copy of them here drifts the day that
|
|
16
|
+
one of the two files changes.
|
|
17
|
+
|
|
18
|
+
**It names the view NOWHERE. Routing implies no rendering.** No file of this package,
|
|
19
|
+
and no file of any of the eight router adapters, ever reads `currentView`. A provider
|
|
20
|
+
whose renderer callback reads the view binds its own `TActor`, and a constraint keeps
|
|
21
|
+
the concrete type of the actor whole, so that callback still reads the exact spec of
|
|
22
|
+
that actor.
|
|
23
|
+
|
|
24
|
+
Every `PlayActor` of `@xmachines/play-actor` that also implements `Routable`, and whose
|
|
25
|
+
event union holds `PlayRouteEvent`, satisfies this interface structurally. A machine
|
|
26
|
+
that declares no route event does NOT satisfy it, and that refusal is correct: a bridge
|
|
27
|
+
cannot navigate an actor that receives no route event.
|
|
28
|
+
|
|
29
|
+
## Example
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import type { RoutableActor } from "@xmachines/play-router";
|
|
33
|
+
|
|
34
|
+
class MyBridge extends RouterBridgeBase {
|
|
35
|
+
constructor(actor: RoutableActor, routeMap: RouteMap) {
|
|
36
|
+
super(actor, routeMap);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Extends
|
|
42
|
+
|
|
43
|
+
- [`Routable`](../../play-router/index/interfaces/Routable.md)
|
|
44
|
+
|
|
45
|
+
## Properties
|
|
46
|
+
|
|
47
|
+
| Property | Modifier | Type | Inherited from | Defined in |
|
|
48
|
+
| ------------------------------------------------- | ---------- | -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
49
|
+
| <a id="property-currentroute"></a> `currentRoute` | `readonly` | [`Computed`](../../play-signals/namespaces/Signal/classes/Computed.md)\<`string` \| `null`\> | [`Routable`](../../play-router/index/interfaces/Routable.md).[`currentRoute`](../../play-router/index/interfaces/Routable.md#property-currentroute) | [play-router/src/types.ts:354](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L354) |
|
|
50
|
+
| <a id="property-initialroute"></a> `initialRoute` | `readonly` | `string` \| `null` | [`Routable`](../../play-router/index/interfaces/Routable.md).[`initialRoute`](../../play-router/index/interfaces/Routable.md#property-initialroute) | [play-router/src/types.ts:355](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L355) |
|
|
51
|
+
|
|
52
|
+
## Methods
|
|
53
|
+
|
|
54
|
+
### send()
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
send(event): void;
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Defined in: [play-router/src/types.ts:394](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L394)
|
|
61
|
+
|
|
62
|
+
Sends a route navigation event to the actor.
|
|
63
|
+
|
|
64
|
+
#### Parameters
|
|
65
|
+
|
|
66
|
+
| Parameter | Type |
|
|
67
|
+
| --------- | ------------------------------------- |
|
|
68
|
+
| `event` | [`PlayRouteEvent`](PlayRouteEvent.md) |
|
|
69
|
+
|
|
70
|
+
#### Returns
|
|
71
|
+
|
|
72
|
+
`void`
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: RouteMapOptions
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [play-router/src/types.ts:567](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L567)
|
|
6
6
|
|
|
7
7
|
The options of `createRouteMap` and of `createRouteMapFromTree`.
|
|
8
8
|
|
|
9
9
|
## Properties
|
|
10
10
|
|
|
11
|
-
| Property | Type | Description | Defined in
|
|
12
|
-
| -------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
-
| <a id="property-cachesize"></a> `cacheSize?` | `number` | The maximum number of the resolved parameterized path lookups in the cache. `RouteMap.getStateIdByPath()` resolves a parameterized pattern, for example `/profile/:userId`, with URLPattern on each call. The map keeps each path of a frequent visit in an LRU cache, and a later lookup of that path is therefore O(1). Raise this value for an application with a large set of parameterized routes, or with a high frequency of the navigation. The default is `500`. | [
|
|
11
|
+
| Property | Type | Description | Defined in |
|
|
12
|
+
| -------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
+
| <a id="property-cachesize"></a> `cacheSize?` | `number` | The maximum number of the resolved parameterized path lookups in the cache. `RouteMap.getStateIdByPath()` resolves a parameterized pattern, for example `/profile/:userId`, with URLPattern on each call. The map keeps each path of a frequent visit in an LRU cache, and a later lookup of that path is therefore O(1). Raise this value for an application with a large set of parameterized routes, or with a high frequency of the navigation. The default is `500`. | [play-router/src/types.ts:579](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L579) |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: RouteMapping
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [play-router/src/base-route-map.ts:54](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/base-route-map.ts#L54)
|
|
6
6
|
|
|
7
7
|
One entry of the map between a state ID and a path.
|
|
8
8
|
|
|
@@ -22,7 +22,7 @@ const optionalMapping: RouteMapping = { stateId: "settings", path: "/settings/:s
|
|
|
22
22
|
|
|
23
23
|
## Properties
|
|
24
24
|
|
|
25
|
-
| Property | Modifier | Type | Description | Defined in
|
|
26
|
-
| --------------------------------------- | ---------- | -------- | ------------------------------------------------------------------------------------------------ |
|
|
27
|
-
| <a id="property-path"></a> `path` | `readonly` | `string` | The pattern of the URL path, for example `"/"`, `"/profile/:userId"`, or `"/settings/:section?"` | [
|
|
28
|
-
| <a id="property-stateid"></a> `stateId` | `readonly` | `string` | The state ID of the state machine, for example `"home"` or `"#profile"` | [
|
|
25
|
+
| Property | Modifier | Type | Description | Defined in |
|
|
26
|
+
| --------------------------------------- | ---------- | -------- | ------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
27
|
+
| <a id="property-path"></a> `path` | `readonly` | `string` | The pattern of the URL path, for example `"/"`, `"/profile/:userId"`, or `"/settings/:section?"` | [play-router/src/base-route-map.ts:58](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/base-route-map.ts#L58) |
|
|
28
|
+
| <a id="property-stateid"></a> `stateId` | `readonly` | `string` | The state ID of the state machine, for example `"home"` or `"#profile"` | [play-router/src/base-route-map.ts:56](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/base-route-map.ts#L56) |
|