@xmachines/docs 1.0.0-beta.20 → 1.0.0-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/@xmachines/play/README.md +1 -1
- package/api/@xmachines/play/classes/PlayError.md +4 -4
- package/api/@xmachines/play/type-aliases/PlayEvent.md +3 -3
- package/api/@xmachines/play-actor/README.md +2 -2
- package/api/@xmachines/play-actor/classes/AbstractActor.md +4 -4
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +2 -2
- package/api/@xmachines/play-actor/interfaces/Routable.md +3 -3
- package/api/@xmachines/play-actor/interfaces/ViewMetadata.md +3 -3
- package/api/@xmachines/play-actor/interfaces/Viewable.md +2 -2
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +4 -4
- package/api/@xmachines/play-dom/functions/connectRenderer.md +1 -1
- package/api/@xmachines/play-dom/functions/renderSpec.md +1 -1
- package/api/@xmachines/play-dom/interfaces/ConnectRendererOptions.md +7 -7
- package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +7 -7
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +3 -3
- package/api/@xmachines/play-dom/type-aliases/DomComponentRenderer.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +1 -1
- package/api/@xmachines/play-react/README.md +21 -1
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +5 -5
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/useSignalEffect.md +8 -1
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +4 -4
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +3 -3
- package/api/@xmachines/play-react/interfaces/PlayRendererProps.md +7 -6
- package/api/@xmachines/play-react/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +34 -21
- package/api/@xmachines/play-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +7 -7
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +4 -4
- package/api/@xmachines/play-router/README.md +18 -1
- package/api/@xmachines/play-router/classes/BaseRouteMap.md +4 -4
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +34 -21
- package/api/@xmachines/play-router/functions/buildRouteTree.md +1 -1
- package/api/@xmachines/play-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-router/functions/createBrowserHistory.md +6 -1
- package/api/@xmachines/play-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-router/functions/createRouter.md +1 -1
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteById.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteByPath.md +1 -1
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/isRouteReachable.md +1 -1
- package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
- package/api/@xmachines/play-router/functions/routeExists.md +1 -1
- package/api/@xmachines/play-router/functions/sanitizePathname.md +1 -1
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +1 -1
- package/api/@xmachines/play-router/functions/validateStateExists.md +1 -1
- package/api/@xmachines/play-router/interfaces/BaseRouteMapping.md +3 -3
- package/api/@xmachines/play-router/interfaces/BrowserHistory.md +14 -14
- package/api/@xmachines/play-router/interfaces/BrowserWindow.md +14 -14
- package/api/@xmachines/play-router/interfaces/ConnectRouterOptions.md +4 -4
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +3 -3
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +5 -5
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +7 -7
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +8 -8
- package/api/@xmachines/play-router/interfaces/RouteMap.md +4 -4
- package/api/@xmachines/play-router/interfaces/RouteNode.md +10 -10
- package/api/@xmachines/play-router/interfaces/RouteObject.md +2 -2
- package/api/@xmachines/play-router/interfaces/RouteTree.md +5 -5
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +4 -4
- package/api/@xmachines/play-router/interfaces/VanillaRouter.md +4 -4
- package/api/@xmachines/play-router/type-aliases/MachineGraph.md +1 -1
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-signals/README.md +2 -2
- package/api/@xmachines/play-signals/functions/watchSignal.md +1 -1
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalState.md +3 -3
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +4 -4
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
- package/api/@xmachines/play-solid/README.md +21 -1
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/interfaces/PlayRendererProps.md +7 -6
- package/api/@xmachines/play-solid/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +7 -1
- package/api/@xmachines/play-solid-router/README.md +1 -1
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +35 -22
- package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +4 -4
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +7 -7
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +4 -4
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +34 -21
- package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/extractParams.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/extractQueryParams.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +7 -7
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/README.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +35 -22
- package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +7 -7
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +4 -4
- package/api/@xmachines/play-vue/README.md +21 -1
- package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/interfaces/PlayRendererProps.md +5 -5
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
- package/api/@xmachines/play-vue/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue-router/README.md +1 -1
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +7 -7
- package/api/@xmachines/play-vue-router/classes/VueBaseRouteMap.md +7 -7
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +35 -22
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +7 -7
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +4 -4
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +4 -4
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-xstate/README.md +14 -2
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +14 -14
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +1 -1
- package/api/@xmachines/play-xstate/functions/composeGuards.md +1 -1
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +1 -1
- package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +1 -1
- package/api/@xmachines/play-xstate/functions/definePlayer.md +2 -2
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +2 -2
- package/api/@xmachines/play-xstate/functions/eventMatches.md +1 -1
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +1 -1
- package/api/@xmachines/play-xstate/functions/hasContext.md +1 -1
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +1 -1
- package/api/@xmachines/play-xstate/functions/negateGuard.md +1 -1
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +3 -3
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +2 -2
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +6 -6
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +5 -5
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +4 -4
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +4 -4
- package/api/@xmachines/shared/functions/defineXmVitestConfig.md +2 -2
- package/api/@xmachines/shared/functions/xmAliases.md +1 -1
- package/api/{_media → rfc}/play.md +1 -1
- package/package.json +2 -2
- package/rfc/play.md +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayErrorBoundaryState
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:28](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:28](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react/src/PlayErrorBoundary.tsx#L28)
|
|
6
6
|
|
|
7
7
|
Internal state shape for PlayErrorBoundary
|
|
8
8
|
|
|
@@ -10,5 +10,5 @@ Internal state shape for PlayErrorBoundary
|
|
|
10
10
|
|
|
11
11
|
| Property | Type | Defined in |
|
|
12
12
|
| ----------------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
-
| <a id="property-error"></a> `error` | `Error` \| `null` | [packages/play-react/src/PlayErrorBoundary.tsx:30](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
14
|
-
| <a id="property-haserror"></a> `hasError` | `boolean` | [packages/play-react/src/PlayErrorBoundary.tsx:29](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
13
|
+
| <a id="property-error"></a> `error` | `Error` \| `null` | [packages/play-react/src/PlayErrorBoundary.tsx:30](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react/src/PlayErrorBoundary.tsx#L30) |
|
|
14
|
+
| <a id="property-haserror"></a> `hasError` | `boolean` | [packages/play-react/src/PlayErrorBoundary.tsx:29](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react/src/PlayErrorBoundary.tsx#L29) |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayRendererProps\<TLogic\>
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-react/src/types.ts:
|
|
5
|
+
Defined in: [packages/play-react/src/types.ts:33](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react/src/types.ts#L33)
|
|
6
6
|
|
|
7
7
|
Props for PlayRenderer component
|
|
8
8
|
|
|
@@ -16,8 +16,9 @@ Props for PlayRenderer component
|
|
|
16
16
|
|
|
17
17
|
| Property | Type | Description | Defined in |
|
|
18
18
|
| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
19
|
-
| <a id="property-actions"></a> `actions?` | `object` | Maps json-render action names to XState event type strings. Values are constrained to `EventFromLogic<TLogic>["type"]` — passing a non-existent event type string is a compile error when TLogic is specified. | [packages/play-react/src/types.ts:
|
|
20
|
-
| <a id="property-actor"></a> `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<`TLogic`, [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Viewable`](../../play-actor/interfaces/Viewable.md) | Actor instance with currentView signal (requires Viewable capability) | [packages/play-react/src/types.ts:
|
|
21
|
-
| <a id="property-fallback"></a> `fallback?` | `ReactNode` | Optional component shown when currentView is null | [packages/play-react/src/types.ts:
|
|
22
|
-
| <a id="property-
|
|
23
|
-
| <a id="property-
|
|
19
|
+
| <a id="property-actions"></a> `actions?` | `object` | Maps json-render action names to XState event type strings. Values are constrained to `EventFromLogic<TLogic>["type"]` — passing a non-existent event type string is a compile error when TLogic is specified. | [packages/play-react/src/types.ts:70](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react/src/types.ts#L70) |
|
|
20
|
+
| <a id="property-actor"></a> `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<`TLogic`, [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Viewable`](../../play-actor/interfaces/Viewable.md) | Actor instance with currentView signal (requires Viewable capability) | [packages/play-react/src/types.ts:35](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react/src/types.ts#L35) |
|
|
21
|
+
| <a id="property-fallback"></a> `fallback?` | `ReactNode` | Optional component shown when currentView is null | [packages/play-react/src/types.ts:51](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react/src/types.ts#L51) |
|
|
22
|
+
| <a id="property-onerror"></a> `onError?` | (`error`, `info`) => `void` | Optional callback invoked when a catalog component throws during render. Receives the error and React ErrorInfo — use to forward to Sentry, Datadog, etc. | [packages/play-react/src/types.ts:63](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react/src/types.ts#L63) |
|
|
23
|
+
| <a id="property-registry"></a> `registry` | `ComponentRegistry` | ComponentRegistry from defineRegistry() in @json-render/react | [packages/play-react/src/types.ts:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react/src/types.ts#L38) |
|
|
24
|
+
| <a id="property-store"></a> `store?` | `StateStore` | Optional external StateStore (e.g. from @json-render/xstate). When provided, PlayRenderer operates in controlled mode — spec.state is ignored and the store is the single source of truth for UI state. When omitted, a fresh @xstate/store atom is created internally per view transition, seeded from spec.state. | [packages/play-react/src/types.ts:48](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react/src/types.ts#L48) |
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
type PlayActor = AbstractActor<AnyActorLogic>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/src/useActor.ts:26](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-react/src/useActor.ts:26](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react/src/useActor.ts#L26)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const PlayRenderer: React.FC<PlayRendererProps>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/src/PlayRenderer.tsx:65](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-react/src/PlayRenderer.tsx:65](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react/src/PlayRenderer.tsx#L65)
|
|
10
10
|
|
|
11
11
|
Main renderer component that subscribes to actor signals and renders UI
|
|
12
12
|
via @json-render/react Renderer.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: ReactRouterBridge
|
|
4
4
|
|
|
5
|
-
Defined in: [play-react-router/src/react-router-bridge.ts:28](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [play-react-router/src/react-router-bridge.ts:28](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react-router/src/react-router-bridge.ts#L28)
|
|
6
6
|
|
|
7
7
|
Abstract base class for all `@xmachines` router adapter bridges.
|
|
8
8
|
|
|
@@ -25,7 +25,7 @@ new ReactRouterBridge(
|
|
|
25
25
|
routeMap): ReactRouterBridge;
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
Defined in: [play-react-router/src/react-router-bridge.ts:31](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
28
|
+
Defined in: [play-react-router/src/react-router-bridge.ts:31](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react-router/src/react-router-bridge.ts#L31)
|
|
29
29
|
|
|
30
30
|
#### Parameters
|
|
31
31
|
|
|
@@ -47,15 +47,15 @@ Defined in: [play-react-router/src/react-router-bridge.ts:31](https://gitlab.com
|
|
|
47
47
|
|
|
48
48
|
| Property | Modifier | Type | Default value | Description | Inherited from | Defined in |
|
|
49
49
|
| --------------------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
50
|
-
| <a id="property-actor"></a> `actor` | `readonly` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic), [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Routable`](../../play-actor/interfaces/Routable.md) | `undefined` | A `Routable` actor exposing `currentRoute` and `send`. | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`actor`](../../play-router/classes/RouterBridgeBase.md#property-actor) | [play-router/src/router-bridge-base.ts:
|
|
51
|
-
| <a id="property-hasconnectedonce"></a> `hasConnectedOnce` | `protected` | `boolean` | `false` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`hasConnectedOnce`](../../play-router/classes/RouterBridgeBase.md#property-hasconnectedonce) | [play-router/src/router-bridge-base.ts:
|
|
52
|
-
| <a id="property-isconnected"></a> `isConnected` | `protected` | `boolean` | `false` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`isConnected`](../../play-router/classes/RouterBridgeBase.md#property-isconnected) | [play-router/src/router-bridge-base.ts:
|
|
53
|
-
| <a id="property-isprocessingnavigation"></a> `isProcessingNavigation` | `protected` | `boolean` | `false` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`isProcessingNavigation`](../../play-router/classes/RouterBridgeBase.md#property-isprocessingnavigation) | [play-router/src/router-bridge-base.ts:
|
|
54
|
-
| <a id="property-lastsyncedpath"></a> `lastSyncedPath` | `protected` | `string` \| `null` | `null` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`lastSyncedPath`](../../play-router/classes/RouterBridgeBase.md#property-lastsyncedpath) | [play-router/src/router-bridge-base.ts:
|
|
55
|
-
| <a id="property-routemap"></a> `routeMap` | `readonly` | `object` | `undefined` | Bidirectional route map for `stateId ↔ path` resolution. Provide `getStateIdByPath` and `getPathByStateId`. Framework adapters typically wrap the result of `createRouteMap()` or an equivalent. | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`routeMap`](../../play-router/classes/RouterBridgeBase.md#property-routemap) | [play-router/src/router-bridge-base.ts:
|
|
56
|
-
| `routeMap.getPathByStateId` | `public` | `string` \| `null` \| `undefined` | `undefined` | - | - | [play-router/src/router-bridge-base.ts:
|
|
57
|
-
| `routeMap.getStateIdByPath` | `public` | `string` \| `null` \| `undefined` | `undefined` | - | - | [play-router/src/router-bridge-base.ts:
|
|
58
|
-
| <a id="property-routewatcher"></a> `routeWatcher` | `protected` | \| [`RouteWatcherHandle`](../../play-router/interfaces/RouteWatcherHandle.md) \| `null` | `null` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`routeWatcher`](../../play-router/classes/RouterBridgeBase.md#property-routewatcher) | [play-router/src/router-bridge-base.ts:
|
|
50
|
+
| <a id="property-actor"></a> `actor` | `readonly` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic), [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Routable`](../../play-actor/interfaces/Routable.md) | `undefined` | A `Routable` actor exposing `currentRoute` and `send`. | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`actor`](../../play-router/classes/RouterBridgeBase.md#property-actor) | [play-router/src/router-bridge-base.ts:102](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/router-bridge-base.ts#L102) |
|
|
51
|
+
| <a id="property-hasconnectedonce"></a> `hasConnectedOnce` | `protected` | `boolean` | `false` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`hasConnectedOnce`](../../play-router/classes/RouterBridgeBase.md#property-hasconnectedonce) | [play-router/src/router-bridge-base.ts:90](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/router-bridge-base.ts#L90) |
|
|
52
|
+
| <a id="property-isconnected"></a> `isConnected` | `protected` | `boolean` | `false` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`isConnected`](../../play-router/classes/RouterBridgeBase.md#property-isconnected) | [play-router/src/router-bridge-base.ts:89](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/router-bridge-base.ts#L89) |
|
|
53
|
+
| <a id="property-isprocessingnavigation"></a> `isProcessingNavigation` | `protected` | `boolean` | `false` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`isProcessingNavigation`](../../play-router/classes/RouterBridgeBase.md#property-isprocessingnavigation) | [play-router/src/router-bridge-base.ts:92](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/router-bridge-base.ts#L92) |
|
|
54
|
+
| <a id="property-lastsyncedpath"></a> `lastSyncedPath` | `protected` | `string` \| `null` | `null` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`lastSyncedPath`](../../play-router/classes/RouterBridgeBase.md#property-lastsyncedpath) | [play-router/src/router-bridge-base.ts:91](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/router-bridge-base.ts#L91) |
|
|
55
|
+
| <a id="property-routemap"></a> `routeMap` | `readonly` | `object` | `undefined` | Bidirectional route map for `stateId ↔ path` resolution. Provide `getStateIdByPath` and `getPathByStateId`. Framework adapters typically wrap the result of `createRouteMap()` or an equivalent. | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`routeMap`](../../play-router/classes/RouterBridgeBase.md#property-routemap) | [play-router/src/router-bridge-base.ts:103](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/router-bridge-base.ts#L103) |
|
|
56
|
+
| `routeMap.getPathByStateId` | `public` | `string` \| `null` \| `undefined` | `undefined` | - | - | [play-router/src/router-bridge-base.ts:105](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/router-bridge-base.ts#L105) |
|
|
57
|
+
| `routeMap.getStateIdByPath` | `public` | `string` \| `null` \| `undefined` | `undefined` | - | - | [play-router/src/router-bridge-base.ts:104](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/router-bridge-base.ts#L104) |
|
|
58
|
+
| <a id="property-routewatcher"></a> `routeWatcher` | `protected` | \| [`RouteWatcherHandle`](../../play-router/interfaces/RouteWatcherHandle.md) \| `null` | `null` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`routeWatcher`](../../play-router/classes/RouterBridgeBase.md#property-routewatcher) | [play-router/src/router-bridge-base.ts:93](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/router-bridge-base.ts#L93) |
|
|
59
59
|
|
|
60
60
|
## Methods
|
|
61
61
|
|
|
@@ -65,13 +65,22 @@ Defined in: [play-react-router/src/react-router-bridge.ts:31](https://gitlab.com
|
|
|
65
65
|
connect(): void;
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
68
|
+
Defined in: [play-router/src/router-bridge-base.ts:129](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/router-bridge-base.ts#L129)
|
|
69
69
|
|
|
70
70
|
Connect the router bridge to the Actor.
|
|
71
71
|
|
|
72
72
|
Sets up the TC39 Signal watcher for actor → router direction and
|
|
73
73
|
starts watching router changes (framework-specific).
|
|
74
74
|
|
|
75
|
+
Ordering here is part of the bridge contract:
|
|
76
|
+
|
|
77
|
+
- `lastSyncedPath` is seeded in the constructor from `actor.currentRoute`
|
|
78
|
+
- the actor watcher is installed before adapter router subscriptions
|
|
79
|
+
- initial sync then resolves deep-link vs restore using `actor.initialRoute`
|
|
80
|
+
|
|
81
|
+
Adapters that need custom initial-sync behavior should override
|
|
82
|
+
`getInitialRouterPath()` rather than reordering `connect()` steps.
|
|
83
|
+
|
|
75
84
|
#### Returns
|
|
76
85
|
|
|
77
86
|
`void`
|
|
@@ -88,7 +97,7 @@ starts watching router changes (framework-specific).
|
|
|
88
97
|
disconnect(): void;
|
|
89
98
|
```
|
|
90
99
|
|
|
91
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
100
|
+
Defined in: [play-router/src/router-bridge-base.ts:197](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/router-bridge-base.ts#L197)
|
|
92
101
|
|
|
93
102
|
Disconnect the router bridge from the Actor.
|
|
94
103
|
|
|
@@ -110,7 +119,7 @@ Stops signal watching and unregisters framework-specific router listener.
|
|
|
110
119
|
protected extractParams(pathname, stateId): Record<string, string>;
|
|
111
120
|
```
|
|
112
121
|
|
|
113
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
122
|
+
Defined in: [play-router/src/router-bridge-base.ts:300](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/router-bridge-base.ts#L300)
|
|
114
123
|
|
|
115
124
|
Extract path parameters from URL using the URLPattern API.
|
|
116
125
|
|
|
@@ -144,7 +153,7 @@ Extracted path parameters, or empty object if URLPattern is unavailable or no ma
|
|
|
144
153
|
protected extractQuery(search): Record<string, string>;
|
|
145
154
|
```
|
|
146
155
|
|
|
147
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
156
|
+
Defined in: [play-router/src/router-bridge-base.ts:321](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/router-bridge-base.ts#L321)
|
|
148
157
|
|
|
149
158
|
Extract query parameters from URL search string.
|
|
150
159
|
|
|
@@ -172,7 +181,7 @@ Extracted query parameters or empty object
|
|
|
172
181
|
protected getInitialRouterPath(): string | null;
|
|
173
182
|
```
|
|
174
183
|
|
|
175
|
-
Defined in: [play-react-router/src/react-router-bridge.ts:49](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
184
|
+
Defined in: [play-react-router/src/react-router-bridge.ts:49](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react-router/src/react-router-bridge.ts#L49)
|
|
176
185
|
|
|
177
186
|
Return the router's current pathname so connect() can sync the actor to
|
|
178
187
|
the URL on initial load. router.subscribe() only fires on future navigations
|
|
@@ -195,7 +204,7 @@ the page on /about would leave the actor in its default "home" state.
|
|
|
195
204
|
protected navigateRouter(path): void;
|
|
196
205
|
```
|
|
197
206
|
|
|
198
|
-
Defined in: [play-react-router/src/react-router-bridge.ts:39](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
207
|
+
Defined in: [play-react-router/src/react-router-bridge.ts:39](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react-router/src/react-router-bridge.ts#L39)
|
|
199
208
|
|
|
200
209
|
Navigate the framework router to the given path.
|
|
201
210
|
|
|
@@ -224,7 +233,7 @@ Must trigger the framework router's navigation (e.g., router.navigate(path)).
|
|
|
224
233
|
protected syncActorFromRouter(pathname, search?): void;
|
|
225
234
|
```
|
|
226
235
|
|
|
227
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
236
|
+
Defined in: [play-router/src/router-bridge-base.ts:248](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/router-bridge-base.ts#L248)
|
|
228
237
|
|
|
229
238
|
Sync actor state when router location changes.
|
|
230
239
|
|
|
@@ -254,13 +263,17 @@ Prevents circular updates via isProcessingNavigation flag.
|
|
|
254
263
|
protected syncRouterFromActor(route): void;
|
|
255
264
|
```
|
|
256
265
|
|
|
257
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
266
|
+
Defined in: [play-router/src/router-bridge-base.ts:228](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/router-bridge-base.ts#L228)
|
|
258
267
|
|
|
259
268
|
Sync router location when actor route signal changes.
|
|
260
269
|
|
|
261
270
|
Calls navigateRouter() for framework-specific navigation.
|
|
262
271
|
Prevents circular updates via isProcessingNavigation flag.
|
|
263
272
|
|
|
273
|
+
`lastSyncedPath` is updated before `navigateRouter()` and the processing flag is
|
|
274
|
+
released in a microtask so synchronous router callbacks triggered by navigation are
|
|
275
|
+
suppressed as circular echoes.
|
|
276
|
+
|
|
264
277
|
#### Parameters
|
|
265
278
|
|
|
266
279
|
| Parameter | Type |
|
|
@@ -283,7 +296,7 @@ Prevents circular updates via isProcessingNavigation flag.
|
|
|
283
296
|
protected unwatchRouterChanges(): void;
|
|
284
297
|
```
|
|
285
298
|
|
|
286
|
-
Defined in: [play-react-router/src/react-router-bridge.ts:59](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
299
|
+
Defined in: [play-react-router/src/react-router-bridge.ts:59](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react-router/src/react-router-bridge.ts#L59)
|
|
287
300
|
|
|
288
301
|
Stop watching for router location changes.
|
|
289
302
|
|
|
@@ -305,7 +318,7 @@ Called by disconnect(). Should clean up the framework-specific subscription.
|
|
|
305
318
|
protected watchRouterChanges(): void;
|
|
306
319
|
```
|
|
307
320
|
|
|
308
|
-
Defined in: [play-react-router/src/react-router-bridge.ts:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
321
|
+
Defined in: [play-react-router/src/react-router-bridge.ts:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react-router/src/react-router-bridge.ts#L53)
|
|
309
322
|
|
|
310
323
|
Start watching for router location changes.
|
|
311
324
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: RouteMap
|
|
4
4
|
|
|
5
|
-
Defined in: [play-react-router/src/route-map.ts:54](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [play-react-router/src/route-map.ts:54](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react-router/src/route-map.ts#L54)
|
|
6
6
|
|
|
7
7
|
Bidirectional route mapper for React Router.
|
|
8
8
|
|
|
@@ -40,7 +40,7 @@ routeMap.getPathByStateId("home"); // "/"
|
|
|
40
40
|
new RouteMap(mappings): RouteMap;
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
43
|
+
Defined in: [play-router/src/base-route-map.ts:118](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/base-route-map.ts#L118)
|
|
44
44
|
|
|
45
45
|
Build a route map from an array of state ID ↔ path mappings.
|
|
46
46
|
|
|
@@ -70,7 +70,7 @@ buckets for efficient candidate selection.
|
|
|
70
70
|
getPathByStateId(stateId): string | null;
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
73
|
+
Defined in: [play-router/src/base-route-map.ts:202](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/base-route-map.ts#L202)
|
|
74
74
|
|
|
75
75
|
Look up the path pattern registered for a state ID.
|
|
76
76
|
|
|
@@ -105,7 +105,7 @@ map.getPathByStateId("missing"); // null
|
|
|
105
105
|
getStateIdByPath(path): string | null;
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
108
|
+
Defined in: [play-router/src/base-route-map.ts:167](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/base-route-map.ts#L167)
|
|
109
109
|
|
|
110
110
|
Resolve a URL path to its mapped state ID.
|
|
111
111
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function PlayRouterProvider<TActor>(__namedParameters): Element;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-react-router/src/play-router-provider.tsx:21](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [play-react-router/src/play-router-provider.tsx:21](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react-router/src/play-router-provider.tsx#L21)
|
|
10
10
|
|
|
11
11
|
## Type Parameters
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function createRouteMapFromTree(routeTree): RouteMap;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-react-router/src/route-map.ts:73](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [play-react-router/src/route-map.ts:73](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react-router/src/route-map.ts#L73)
|
|
10
10
|
|
|
11
11
|
Create RouteMap from RouteTree
|
|
12
12
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayRouteEvent
|
|
4
4
|
|
|
5
|
-
Defined in: [play-router/src/types.ts:216](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [play-router/src/types.ts:216](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/types.ts#L216)
|
|
6
6
|
|
|
7
7
|
Enhanced routing event with parameter and query support
|
|
8
8
|
|
|
@@ -94,7 +94,7 @@ actor.send(event);
|
|
|
94
94
|
|
|
95
95
|
## See
|
|
96
96
|
|
|
97
|
-
[Play RFC](../../../
|
|
97
|
+
[Play RFC](../../../rfc/play.md)
|
|
98
98
|
|
|
99
99
|
## Remarks
|
|
100
100
|
|
|
@@ -112,8 +112,8 @@ URLPatternResult for advanced use cases (debugging, pattern analysis).
|
|
|
112
112
|
|
|
113
113
|
| Property | Modifier | Type | Defined in |
|
|
114
114
|
| -------------------------------------- | ---------- | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
115
|
-
| <a id="property-match"></a> `match?` | `readonly` | `unknown` | [play-router/src/types.ts:221](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
116
|
-
| <a id="property-params"></a> `params?` | `readonly` | `Record`\<`string`, `string`\> | [play-router/src/types.ts:219](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
117
|
-
| <a id="property-query"></a> `query?` | `readonly` | `Record`\<`string`, `string`\> | [play-router/src/types.ts:220](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
118
|
-
| <a id="property-to"></a> `to` | `readonly` | `string` | [play-router/src/types.ts:218](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
119
|
-
| <a id="property-type"></a> `type` | `readonly` | `"play.route"` | [play-router/src/types.ts:217](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
115
|
+
| <a id="property-match"></a> `match?` | `readonly` | `unknown` | [play-router/src/types.ts:221](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/types.ts#L221) |
|
|
116
|
+
| <a id="property-params"></a> `params?` | `readonly` | `Record`\<`string`, `string`\> | [play-router/src/types.ts:219](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/types.ts#L219) |
|
|
117
|
+
| <a id="property-query"></a> `query?` | `readonly` | `Record`\<`string`, `string`\> | [play-router/src/types.ts:220](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/types.ts#L220) |
|
|
118
|
+
| <a id="property-to"></a> `to` | `readonly` | `string` | [play-router/src/types.ts:218](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/types.ts#L218) |
|
|
119
|
+
| <a id="property-type"></a> `type` | `readonly` | `"play.route"` | [play-router/src/types.ts:217](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/types.ts#L217) |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayRouterProviderProps\<TActor\>
|
|
4
4
|
|
|
5
|
-
Defined in: [play-react-router/src/play-router-provider.tsx:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [play-react-router/src/play-router-provider.tsx:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react-router/src/play-router-provider.tsx#L10)
|
|
6
6
|
|
|
7
7
|
## Type Parameters
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@ Defined in: [play-react-router/src/play-router-provider.tsx:10](https://gitlab.c
|
|
|
14
14
|
|
|
15
15
|
| Property | Type | Description | Defined in |
|
|
16
16
|
| ----------------------------------------- | ------------------------------------ | --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
-
| <a id="property-actor"></a> `actor` | `TActor` | - | [play-react-router/src/play-router-provider.tsx:14](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
18
|
-
| <a id="property-renderer"></a> `renderer` | (`actor`, `router`) => `ReactNode` | Renderer callback receives the same concrete actor type that was passed in. | [play-react-router/src/play-router-provider.tsx:18](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
19
|
-
| <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md) | - | [play-react-router/src/play-router-provider.tsx:16](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
20
|
-
| <a id="property-router"></a> `router` | `Router` | - | [play-react-router/src/play-router-provider.tsx:15](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
17
|
+
| <a id="property-actor"></a> `actor` | `TActor` | - | [play-react-router/src/play-router-provider.tsx:14](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react-router/src/play-router-provider.tsx#L14) |
|
|
18
|
+
| <a id="property-renderer"></a> `renderer` | (`actor`, `router`) => `ReactNode` | Renderer callback receives the same concrete actor type that was passed in. | [play-react-router/src/play-router-provider.tsx:18](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react-router/src/play-router-provider.tsx#L18) |
|
|
19
|
+
| <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md) | - | [play-react-router/src/play-router-provider.tsx:16](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react-router/src/play-router-provider.tsx#L16) |
|
|
20
|
+
| <a id="property-router"></a> `router` | `Router` | - | [play-react-router/src/play-router-provider.tsx:15](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react-router/src/play-router-provider.tsx#L15) |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: RouteMapping
|
|
4
4
|
|
|
5
|
-
Defined in: [play-react-router/src/route-map.ts:22](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [play-react-router/src/route-map.ts:22](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react-router/src/route-map.ts#L22)
|
|
6
6
|
|
|
7
7
|
Mapping between state machine state ID and router path.
|
|
8
8
|
|
|
@@ -13,5 +13,5 @@ Fields are `readonly` — entries are immutable once passed to `RouteMap`.
|
|
|
13
13
|
|
|
14
14
|
| Property | Modifier | Type | Description | Defined in |
|
|
15
15
|
| --------------------------------------- | ---------- | -------- | -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
16
|
-
| <a id="property-path"></a> `path` | `readonly` | `string` | Router path with optional parameters (e.g., `"/settings/:section?"`) | [play-react-router/src/route-map.ts:26](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
17
|
-
| <a id="property-stateid"></a> `stateId` | `readonly` | `string` | State ID from state machine (e.g., `"home"`, `"settings.profile"`) | [play-react-router/src/route-map.ts:24](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
16
|
+
| <a id="property-path"></a> `path` | `readonly` | `string` | Router path with optional parameters (e.g., `"/settings/:section?"`) | [play-react-router/src/route-map.ts:26](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react-router/src/route-map.ts#L26) |
|
|
17
|
+
| <a id="property-stateid"></a> `stateId` | `readonly` | `string` | State ID from state machine (e.g., `"home"`, `"settings.profile"`) | [play-react-router/src/route-map.ts:24](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-react-router/src/route-map.ts#L24) |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: RouterBridge
|
|
4
4
|
|
|
5
|
-
Defined in: [play-router/src/types.ts:264](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [play-router/src/types.ts:264](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/types.ts#L264)
|
|
6
6
|
|
|
7
7
|
RouterBridge interface for runtime infrastructure adapters
|
|
8
8
|
|
|
@@ -44,7 +44,7 @@ class TanStackRouterBridge implements RouterBridge {
|
|
|
44
44
|
|
|
45
45
|
## See
|
|
46
46
|
|
|
47
|
-
[Play RFC](../../../
|
|
47
|
+
[Play RFC](../../../rfc/play.md) - Invariant INV-04
|
|
48
48
|
|
|
49
49
|
## Methods
|
|
50
50
|
|
|
@@ -54,7 +54,7 @@ class TanStackRouterBridge implements RouterBridge {
|
|
|
54
54
|
connect(): void | Promise<void>;
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
Defined in: [play-router/src/types.ts:280](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
57
|
+
Defined in: [play-router/src/types.ts:280](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/types.ts#L280)
|
|
58
58
|
|
|
59
59
|
Connect the router bridge to the Actor
|
|
60
60
|
|
|
@@ -83,7 +83,7 @@ await bridge.connect();
|
|
|
83
83
|
disconnect(): void | Promise<void>;
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
Defined in: [play-router/src/types.ts:296](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
86
|
+
Defined in: [play-router/src/types.ts:296](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/types.ts#L296)
|
|
87
87
|
|
|
88
88
|
Disconnect the router bridge from the Actor
|
|
89
89
|
|
|
@@ -16,7 +16,7 @@ It also exports `RouterBridgeBase`, the shared base class used by framework adap
|
|
|
16
16
|
|
|
17
17
|
The low-level `connectRouter()` path now uses the same router-to-actor event builder and route-map match helper as `RouterBridgeBase`, so pathname sanitization, state-id normalization, param extraction, and query extraction stay aligned across vanilla and framework adapters.
|
|
18
18
|
|
|
19
|
-
Per [Play RFC](../../
|
|
19
|
+
Per [Play RFC](../../rfc/play.md), this package implements:
|
|
20
20
|
|
|
21
21
|
- **Actor Authority (INV-01):** Routes derive from machine definitions, not external configuration
|
|
22
22
|
|
|
@@ -183,6 +183,23 @@ Bridge teardown must be explicit and deterministic:
|
|
|
183
183
|
- Do not rely on GC-only cleanup guidance.
|
|
184
184
|
- Infrastructure remains passive: bridges observe and forward intents, actors decide validity.
|
|
185
185
|
- `createBrowserHistory().destroy()` is idempotent and restores shared `window.history` patches only after the last wrapper for that window is removed.
|
|
186
|
+
- **Note**: `createBrowserHistory()` mutates global `window.history` methods (`pushState` and `replaceState`) and coordinates wrappers with shared ref-count state. To reduce leakage, create one history wrapper per browser window at the application boundary and always pair it with `destroy()` during teardown.
|
|
187
|
+
|
|
188
|
+
## Bridge Sync Ordering
|
|
189
|
+
|
|
190
|
+
`RouterBridgeBase.connect()` has an intentional ordering contract used by all framework adapters:
|
|
191
|
+
|
|
192
|
+
- seed `lastSyncedPath` from `actor.currentRoute` in the constructor
|
|
193
|
+
- install the actor route watcher
|
|
194
|
+
- install adapter router subscriptions
|
|
195
|
+
- resolve initial sync using `getInitialRouterPath()` and `actor.initialRoute`
|
|
196
|
+
|
|
197
|
+
That final step distinguishes:
|
|
198
|
+
|
|
199
|
+
- **deep-link:** browser URL differs from the machine's initial route, so router wins and the actor receives `play.route`
|
|
200
|
+
- **restore:** browser URL is still at the machine's initial route while the actor was restored elsewhere, so actor wins and the bridge pushes the actor route back into the router
|
|
201
|
+
|
|
202
|
+
Actor-originated router sync also keeps `isProcessingNavigation` set until the next microtask. That short window intentionally suppresses synchronous router callbacks that echo the same navigation back into the actor.
|
|
186
203
|
|
|
187
204
|
## Diagnostics
|
|
188
205
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: BaseRouteMap
|
|
4
4
|
|
|
5
|
-
Defined in: [base-route-map.ts:
|
|
5
|
+
Defined in: [base-route-map.ts:99](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/base-route-map.ts#L99)
|
|
6
6
|
|
|
7
7
|
Shared bidirectional route map base class.
|
|
8
8
|
|
|
@@ -57,7 +57,7 @@ map.getPathByStateId("missing"); // null
|
|
|
57
57
|
new BaseRouteMap(mappings): BaseRouteMap;
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
Defined in: [base-route-map.ts:
|
|
60
|
+
Defined in: [base-route-map.ts:118](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/base-route-map.ts#L118)
|
|
61
61
|
|
|
62
62
|
Build a route map from an array of state ID ↔ path mappings.
|
|
63
63
|
|
|
@@ -83,7 +83,7 @@ buckets for efficient candidate selection.
|
|
|
83
83
|
getPathByStateId(stateId): string | null;
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
Defined in: [base-route-map.ts:
|
|
86
|
+
Defined in: [base-route-map.ts:202](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/base-route-map.ts#L202)
|
|
87
87
|
|
|
88
88
|
Look up the path pattern registered for a state ID.
|
|
89
89
|
|
|
@@ -114,7 +114,7 @@ map.getPathByStateId("missing"); // null
|
|
|
114
114
|
getStateIdByPath(path): string | null;
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
-
Defined in: [base-route-map.ts:
|
|
117
|
+
Defined in: [base-route-map.ts:167](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.22/packages/play-router/src/base-route-map.ts#L167)
|
|
118
118
|
|
|
119
119
|
Resolve a URL path to its mapped state ID.
|
|
120
120
|
|