@xmachines/docs 1.0.0-beta.10
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/LICENSE +21 -0
- package/README.md +15 -0
- package/api/@xmachines/play/README.md +130 -0
- package/api/@xmachines/play/type-aliases/PlayEvent.md +81 -0
- package/api/@xmachines/play-actor/README.md +247 -0
- package/api/@xmachines/play-actor/classes/AbstractActor.md +520 -0
- package/api/@xmachines/play-actor/interfaces/Routable.md +29 -0
- package/api/@xmachines/play-actor/interfaces/ViewMetadata.md +17 -0
- package/api/@xmachines/play-actor/interfaces/Viewable.md +12 -0
- package/api/@xmachines/play-catalog/README.md +331 -0
- package/api/@xmachines/play-catalog/functions/defineCatalog.md +98 -0
- package/api/@xmachines/play-catalog/functions/defineComponents.md +134 -0
- package/api/@xmachines/play-catalog/type-aliases/Catalog.md +48 -0
- package/api/@xmachines/play-catalog/type-aliases/ComponentsFor.md +20 -0
- package/api/@xmachines/play-catalog/type-aliases/InferComponentProps.md +65 -0
- package/api/@xmachines/play-catalog/type-aliases/NoExtraKeys.md +17 -0
- package/api/@xmachines/play-react/README.md +423 -0
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +613 -0
- package/api/@xmachines/play-react/functions/useSignalEffect.md +68 -0
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +15 -0
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +14 -0
- package/api/@xmachines/play-react/interfaces/PlayRendererProps.md +15 -0
- package/api/@xmachines/play-react/variables/PlayRenderer.md +64 -0
- package/api/@xmachines/play-react-router/README.md +198 -0
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +321 -0
- package/api/@xmachines/play-react-router/classes/RouteMap.md +137 -0
- package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +19 -0
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +35 -0
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +14 -0
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +17 -0
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-react-router-demo/README.md +137 -0
- package/api/@xmachines/play-router/README.md +502 -0
- package/api/@xmachines/play-router/classes/BaseRouteMap.md +142 -0
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +300 -0
- package/api/@xmachines/play-router/functions/buildRouteTree.md +27 -0
- package/api/@xmachines/play-router/functions/connectRouter.md +67 -0
- package/api/@xmachines/play-router/functions/crawlMachine.md +92 -0
- package/api/@xmachines/play-router/functions/createBrowserHistory.md +47 -0
- package/api/@xmachines/play-router/functions/createRouteMap.md +53 -0
- package/api/@xmachines/play-router/functions/createRouter.md +76 -0
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +32 -0
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +64 -0
- package/api/@xmachines/play-router/functions/extractRoute.md +45 -0
- package/api/@xmachines/play-router/functions/findRouteById.md +37 -0
- package/api/@xmachines/play-router/functions/findRouteByPath.md +39 -0
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +35 -0
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +39 -0
- package/api/@xmachines/play-router/functions/routeExists.md +26 -0
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +29 -0
- package/api/@xmachines/play-router/functions/validateStateExists.md +29 -0
- package/api/@xmachines/play-router/interfaces/BaseRouteMapping.md +27 -0
- package/api/@xmachines/play-router/interfaces/BrowserHistory.md +172 -0
- package/api/@xmachines/play-router/interfaces/BrowserWindow.md +69 -0
- package/api/@xmachines/play-router/interfaces/ConnectRouterOptions.md +13 -0
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +19 -0
- package/api/@xmachines/play-router/interfaces/RouteMap.md +56 -0
- package/api/@xmachines/play-router/interfaces/RouteNode.md +21 -0
- package/api/@xmachines/play-router/interfaces/RouteObject.md +21 -0
- package/api/@xmachines/play-router/interfaces/RouteTree.md +20 -0
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-router/interfaces/StateVisit.md +15 -0
- package/api/@xmachines/play-router/interfaces/VanillaRouter.md +28 -0
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +11 -0
- package/api/@xmachines/play-router-demo/README.md +137 -0
- package/api/@xmachines/play-signals/README.md +176 -0
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +34 -0
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +49 -0
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +35 -0
- package/api/@xmachines/play-signals/interfaces/SignalState.md +68 -0
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +97 -0
- package/api/@xmachines/play-signals/namespaces/Signal/README.md +22 -0
- package/api/@xmachines/play-signals/namespaces/Signal/classes/Computed.md +52 -0
- package/api/@xmachines/play-signals/namespaces/Signal/classes/State.md +72 -0
- package/api/@xmachines/play-signals/namespaces/Signal/interfaces/Options.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/README.md +21 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/classes/Watcher.md +85 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/currentComputed.md +13 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSinks.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSources.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSinks.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSources.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/untrack.md +25 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/unwatched.md +9 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/watched.md +9 -0
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isComputed.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isState.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isWatcher.md +19 -0
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +32 -0
- package/api/@xmachines/play-solid/README.md +311 -0
- package/api/@xmachines/play-solid/interfaces/PlayRendererProps.md +15 -0
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +70 -0
- package/api/@xmachines/play-solid-router/README.md +666 -0
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +150 -0
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +347 -0
- package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +19 -0
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +32 -0
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +486 -0
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +14 -0
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +14 -0
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +9 -0
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +51 -0
- package/api/@xmachines/play-solid-router-demo/README.md +127 -0
- package/api/@xmachines/play-tanstack-react-router/README.md +226 -0
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +137 -0
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +348 -0
- package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +19 -0
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +53 -0
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +35 -0
- package/api/@xmachines/play-tanstack-react-router/functions/extractParams.md +38 -0
- package/api/@xmachines/play-tanstack-react-router/functions/extractQueryParams.md +33 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +14 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +17 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +26 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +9 -0
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +78 -0
- package/api/@xmachines/play-tanstack-react-router/variables/extractMachineRoutes.md +64 -0
- package/api/@xmachines/play-tanstack-react-router-demo/README.md +126 -0
- package/api/@xmachines/play-tanstack-solid-router/README.md +285 -0
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +150 -0
- package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +343 -0
- package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +19 -0
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +32 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +14 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +23 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +9 -0
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +9 -0
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +78 -0
- package/api/@xmachines/play-tanstack-solid-router-demo/README.md +126 -0
- package/api/@xmachines/play-vue/README.md +292 -0
- package/api/@xmachines/play-vue/interfaces/PlayRendererProps.md +14 -0
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +9 -0
- package/api/@xmachines/play-vue-router/README.md +604 -0
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +209 -0
- package/api/@xmachines/play-vue-router/classes/VueBaseRouteMap.md +201 -0
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +360 -0
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +19 -0
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +15 -0
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +9 -0
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +67 -0
- package/api/@xmachines/play-vue-router-demo/README.md +133 -0
- package/api/@xmachines/play-xstate/README.md +512 -0
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +527 -0
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +43 -0
- package/api/@xmachines/play-xstate/functions/composeGuards.md +79 -0
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +67 -0
- package/api/@xmachines/play-xstate/functions/definePlayer.md +127 -0
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +109 -0
- package/api/@xmachines/play-xstate/functions/eventMatches.md +40 -0
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +54 -0
- package/api/@xmachines/play-xstate/functions/hasContext.md +42 -0
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +41 -0
- package/api/@xmachines/play-xstate/functions/mergeViewProps.md +26 -0
- package/api/@xmachines/play-xstate/functions/negateGuard.md +61 -0
- package/api/@xmachines/play-xstate/functions/stateMatches.md +25 -0
- package/api/@xmachines/play-xstate/functions/validateComponentBinding.md +39 -0
- package/api/@xmachines/play-xstate/functions/validateViewProps.md +80 -0
- package/api/@xmachines/play-xstate/interfaces/CatalogEntry.md +16 -0
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +24 -0
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +26 -0
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +22 -0
- package/api/@xmachines/play-xstate/type-aliases/Catalog.md +21 -0
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +14 -0
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +34 -0
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +20 -0
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +29 -0
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +45 -0
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +51 -0
- package/api/@xmachines/play-xstate/type-aliases/ValidationResult.md +17 -0
- package/api/@xmachines/play-xstate/type-aliases/ViewMergeContext.md +35 -0
- package/api/@xmachines/shared/README.md +379 -0
- package/api/@xmachines/shared/functions/defineXmVitestConfig.md +29 -0
- package/api/@xmachines/shared/functions/xmAliases.md +24 -0
- package/api/README.md +25 -0
- package/api/llms.txt +26 -0
- package/examples/README.md +63 -0
- package/examples/basic-state-machine.md +70 -0
- package/examples/form-validation.md +167 -0
- package/examples/multi-router-integration.md +277 -0
- package/examples/routing-patterns.md +260 -0
- package/examples/traffic-light.md +99 -0
- package/guides/README.md +29 -0
- package/guides/getting-started.md +223 -0
- package/guides/installation.md +323 -0
- package/index.d.ts +3 -0
- package/index.js +4 -0
- package/package.json +54 -0
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-tanstack-react-router](../README.md) / TanStackReactRouterBridge
|
|
2
|
+
|
|
3
|
+
# Class: TanStackReactRouterBridge
|
|
4
|
+
|
|
5
|
+
Defined in: [play-tanstack-react-router/src/tanstack-router-bridge.ts:78](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-react-router/src/tanstack-router-bridge.ts#L78)
|
|
6
|
+
|
|
7
|
+
TanStack React Router adapter implementing RouterBridge protocol via RouterBridgeBase
|
|
8
|
+
|
|
9
|
+
## Remarks
|
|
10
|
+
|
|
11
|
+
Extends RouterBridgeBase to handle all common lifecycle and sync logic.
|
|
12
|
+
Only 3 TanStack-specific methods are implemented here.
|
|
13
|
+
|
|
14
|
+
Subscribes to router.history (not router.subscribe("onBeforeLoad")) so that
|
|
15
|
+
back/forward browser navigation (popstate events) are also captured. The
|
|
16
|
+
router.subscribe("onBeforeLoad") approach only works when TanStack's
|
|
17
|
+
Transitioner component is mounted (i.e. inside a full <RouterProvider>).
|
|
18
|
+
Since this bridge is used without <RouterProvider>, we must subscribe to
|
|
19
|
+
the underlying history object directly — which is exactly what Transitioner
|
|
20
|
+
does internally: `router.history.subscribe(router.load)`.
|
|
21
|
+
|
|
22
|
+
Architectural Invariants:
|
|
23
|
+
|
|
24
|
+
- INV-02 (Passive Infrastructure): Router reflects actor state, never decides
|
|
25
|
+
- Actor validates all navigation via guards before URL changes
|
|
26
|
+
|
|
27
|
+
## Example
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
const bridge = new TanStackReactRouterBridge(router, actor, routeMap);
|
|
31
|
+
bridge.connect();
|
|
32
|
+
return () => bridge.disconnect();
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Extends
|
|
36
|
+
|
|
37
|
+
- [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md)
|
|
38
|
+
|
|
39
|
+
## Constructors
|
|
40
|
+
|
|
41
|
+
### Constructor
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
new TanStackReactRouterBridge(
|
|
45
|
+
router,
|
|
46
|
+
actor,
|
|
47
|
+
routeMap): TanStackReactRouterBridge;
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Defined in: [play-tanstack-react-router/src/tanstack-router-bridge.ts:88](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-react-router/src/tanstack-router-bridge.ts#L88)
|
|
51
|
+
|
|
52
|
+
Create TanStack React Router bridge
|
|
53
|
+
|
|
54
|
+
#### Parameters
|
|
55
|
+
|
|
56
|
+
| Parameter | Type | Description |
|
|
57
|
+
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
|
|
58
|
+
| `router` | [`TanStackRouterLike`](../type-aliases/TanStackRouterLike.md) | TanStack React Router instance |
|
|
59
|
+
| `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<`AnyActorLogic`\> & [`Routable`](../../play-actor/interfaces/Routable.md) | XMachines actor instance |
|
|
60
|
+
| `routeMap` | [`RouteMap`](RouteMap.md) | Bidirectional mapping between state IDs and paths |
|
|
61
|
+
|
|
62
|
+
#### Returns
|
|
63
|
+
|
|
64
|
+
`TanStackReactRouterBridge`
|
|
65
|
+
|
|
66
|
+
#### Overrides
|
|
67
|
+
|
|
68
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`constructor`](../../play-router/classes/RouterBridgeBase.md#constructor)
|
|
69
|
+
|
|
70
|
+
## Properties
|
|
71
|
+
|
|
72
|
+
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
73
|
+
| --------------------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
|
|
74
|
+
| <a id="property-actor"></a> `actor` | `readonly` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<`AnyActorLogic`\> & [`Routable`](../../play-actor/interfaces/Routable.md) | Actor with currentRoute signal and send method | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`actor`](../../play-router/classes/RouterBridgeBase.md#property-actor) | play-router/dist/router-bridge-base.d.ts:55 |
|
|
75
|
+
| <a id="property-hasconnectedonce"></a> `hasConnectedOnce` | `protected` | `boolean` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`hasConnectedOnce`](../../play-router/classes/RouterBridgeBase.md#property-hasconnectedonce) | play-router/dist/router-bridge-base.d.ts:61 |
|
|
76
|
+
| <a id="property-isconnected"></a> `isConnected` | `protected` | `boolean` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`isConnected`](../../play-router/classes/RouterBridgeBase.md#property-isconnected) | play-router/dist/router-bridge-base.d.ts:60 |
|
|
77
|
+
| <a id="property-isprocessingnavigation"></a> `isProcessingNavigation` | `protected` | `boolean` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`isProcessingNavigation`](../../play-router/classes/RouterBridgeBase.md#property-isprocessingnavigation) | play-router/dist/router-bridge-base.d.ts:63 |
|
|
78
|
+
| <a id="property-lastsyncedpath"></a> `lastSyncedPath` | `protected` | `string` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`lastSyncedPath`](../../play-router/classes/RouterBridgeBase.md#property-lastsyncedpath) | play-router/dist/router-bridge-base.d.ts:62 |
|
|
79
|
+
| <a id="property-routemap"></a> `routeMap` | `readonly` | `object` | Bidirectional route map for stateId ↔ path resolution | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`routeMap`](../../play-router/classes/RouterBridgeBase.md#property-routemap) | play-router/dist/router-bridge-base.d.ts:56 |
|
|
80
|
+
| `routeMap.getPathByStateId` | `public` | `string` \| `null` \| `undefined` | - | - | play-router/dist/router-bridge-base.d.ts:58 |
|
|
81
|
+
| `routeMap.getStateIdByPath` | `public` | `string` \| `null` \| `undefined` | - | - | play-router/dist/router-bridge-base.d.ts:57 |
|
|
82
|
+
| <a id="property-routewatcher"></a> `routeWatcher` | `protected` | \| [`Watcher`](../../play-signals/namespaces/Signal/namespaces/subtle/classes/Watcher.md) \| `null` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`routeWatcher`](../../play-router/classes/RouterBridgeBase.md#property-routewatcher) | play-router/dist/router-bridge-base.d.ts:64 |
|
|
83
|
+
|
|
84
|
+
## Methods
|
|
85
|
+
|
|
86
|
+
### connect()
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
connect(): void;
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:81
|
|
93
|
+
|
|
94
|
+
Connect the router bridge to the Actor.
|
|
95
|
+
|
|
96
|
+
Sets up the TC39 Signal watcher for actor → router direction and
|
|
97
|
+
starts watching router changes (framework-specific).
|
|
98
|
+
|
|
99
|
+
#### Returns
|
|
100
|
+
|
|
101
|
+
`void`
|
|
102
|
+
|
|
103
|
+
#### Inherited from
|
|
104
|
+
|
|
105
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`connect`](../../play-router/classes/RouterBridgeBase.md#connect)
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
### disconnect()
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
disconnect(): void;
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:87
|
|
116
|
+
|
|
117
|
+
Disconnect the router bridge from the Actor.
|
|
118
|
+
|
|
119
|
+
Stops signal watching and unregisters framework-specific router listener.
|
|
120
|
+
|
|
121
|
+
#### Returns
|
|
122
|
+
|
|
123
|
+
`void`
|
|
124
|
+
|
|
125
|
+
#### Inherited from
|
|
126
|
+
|
|
127
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`disconnect`](../../play-router/classes/RouterBridgeBase.md#disconnect)
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
### extractParams()
|
|
132
|
+
|
|
133
|
+
```ts
|
|
134
|
+
protected extractParams(pathname, stateId): Record<string, string>;
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:134
|
|
138
|
+
|
|
139
|
+
Extract path parameters from URL using the URLPattern API.
|
|
140
|
+
|
|
141
|
+
Accesses `globalThis.URLPattern` at runtime — no polyfill is imported by this
|
|
142
|
+
library. If `URLPattern` is unavailable (Node.js < 24, older browsers without a
|
|
143
|
+
polyfill), this method returns `{}` silently (graceful degradation — routing still
|
|
144
|
+
works, params will be empty).
|
|
145
|
+
|
|
146
|
+
#### Parameters
|
|
147
|
+
|
|
148
|
+
| Parameter | Type | Description |
|
|
149
|
+
| ---------- | -------- | ------------------------------------------------- |
|
|
150
|
+
| `pathname` | `string` | The actual URL path (e.g., '/profile/john') |
|
|
151
|
+
| `stateId` | `string` | The matched state ID for looking up route pattern |
|
|
152
|
+
|
|
153
|
+
#### Returns
|
|
154
|
+
|
|
155
|
+
`Record`\<`string`, `string`\>
|
|
156
|
+
|
|
157
|
+
Extracted path parameters, or empty object if URLPattern is unavailable or no match
|
|
158
|
+
|
|
159
|
+
#### Inherited from
|
|
160
|
+
|
|
161
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`extractParams`](../../play-router/classes/RouterBridgeBase.md#extractparams)
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
### extractQuery()
|
|
166
|
+
|
|
167
|
+
```ts
|
|
168
|
+
protected extractQuery(search): Record<string, string>;
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:141
|
|
172
|
+
|
|
173
|
+
Extract query parameters from URL search string.
|
|
174
|
+
|
|
175
|
+
#### Parameters
|
|
176
|
+
|
|
177
|
+
| Parameter | Type | Description |
|
|
178
|
+
| --------- | -------- | ------------------------------------------------ |
|
|
179
|
+
| `search` | `string` | URL search string (e.g., '?tab=security&page=1') |
|
|
180
|
+
|
|
181
|
+
#### Returns
|
|
182
|
+
|
|
183
|
+
`Record`\<`string`, `string`\>
|
|
184
|
+
|
|
185
|
+
Extracted query parameters or empty object
|
|
186
|
+
|
|
187
|
+
#### Inherited from
|
|
188
|
+
|
|
189
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`extractQuery`](../../play-router/classes/RouterBridgeBase.md#extractquery)
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
### getInitialRouterPath()
|
|
194
|
+
|
|
195
|
+
```ts
|
|
196
|
+
protected getInitialRouterPath(): string | null;
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Defined in: [play-tanstack-react-router/src/tanstack-router-bridge.ts:110](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-react-router/src/tanstack-router-bridge.ts#L110)
|
|
200
|
+
|
|
201
|
+
Read the router's current pathname for initial sync.
|
|
202
|
+
|
|
203
|
+
Called once in connect() to handle cold-load / deep-link scenarios where
|
|
204
|
+
the URL differs from the actor's initial state.
|
|
205
|
+
|
|
206
|
+
#### Returns
|
|
207
|
+
|
|
208
|
+
`string` \| `null`
|
|
209
|
+
|
|
210
|
+
#### Overrides
|
|
211
|
+
|
|
212
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`getInitialRouterPath`](../../play-router/classes/RouterBridgeBase.md#getinitialrouterpath)
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
### navigateRouter()
|
|
217
|
+
|
|
218
|
+
```ts
|
|
219
|
+
protected navigateRouter(path): void;
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Defined in: [play-tanstack-react-router/src/tanstack-router-bridge.ts:100](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-react-router/src/tanstack-router-bridge.ts#L100)
|
|
223
|
+
|
|
224
|
+
Navigate the framework router to the given path.
|
|
225
|
+
|
|
226
|
+
Called when actor's currentRoute signal changes to a new path.
|
|
227
|
+
Must trigger the framework router's navigation (e.g., router.navigate(path)).
|
|
228
|
+
|
|
229
|
+
#### Parameters
|
|
230
|
+
|
|
231
|
+
| Parameter | Type |
|
|
232
|
+
| --------- | -------- |
|
|
233
|
+
| `path` | `string` |
|
|
234
|
+
|
|
235
|
+
#### Returns
|
|
236
|
+
|
|
237
|
+
`void`
|
|
238
|
+
|
|
239
|
+
#### Overrides
|
|
240
|
+
|
|
241
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`navigateRouter`](../../play-router/classes/RouterBridgeBase.md#navigaterouter)
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
### syncActorFromRouter()
|
|
246
|
+
|
|
247
|
+
```ts
|
|
248
|
+
protected syncActorFromRouter(pathname, search?): void;
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:101
|
|
252
|
+
|
|
253
|
+
Sync actor state when router location changes.
|
|
254
|
+
|
|
255
|
+
Sends play.route event to actor with resolved stateId, params, and query.
|
|
256
|
+
Prevents circular updates via isProcessingNavigation flag.
|
|
257
|
+
|
|
258
|
+
#### Parameters
|
|
259
|
+
|
|
260
|
+
| Parameter | Type |
|
|
261
|
+
| ---------- | -------- |
|
|
262
|
+
| `pathname` | `string` |
|
|
263
|
+
| `search?` | `string` |
|
|
264
|
+
|
|
265
|
+
#### Returns
|
|
266
|
+
|
|
267
|
+
`void`
|
|
268
|
+
|
|
269
|
+
#### Inherited from
|
|
270
|
+
|
|
271
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`syncActorFromRouter`](../../play-router/classes/RouterBridgeBase.md#syncactorfromrouter)
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
### syncRouterFromActor()
|
|
276
|
+
|
|
277
|
+
```ts
|
|
278
|
+
protected syncRouterFromActor(route): void;
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:94
|
|
282
|
+
|
|
283
|
+
Sync router location when actor route signal changes.
|
|
284
|
+
|
|
285
|
+
Calls navigateRouter() for framework-specific navigation.
|
|
286
|
+
Prevents circular updates via isProcessingNavigation flag.
|
|
287
|
+
|
|
288
|
+
#### Parameters
|
|
289
|
+
|
|
290
|
+
| Parameter | Type |
|
|
291
|
+
| --------- | --------- |
|
|
292
|
+
| `route` | `unknown` |
|
|
293
|
+
|
|
294
|
+
#### Returns
|
|
295
|
+
|
|
296
|
+
`void`
|
|
297
|
+
|
|
298
|
+
#### Inherited from
|
|
299
|
+
|
|
300
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`syncRouterFromActor`](../../play-router/classes/RouterBridgeBase.md#syncrouterfromactor)
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
### unwatchRouterChanges()
|
|
305
|
+
|
|
306
|
+
```ts
|
|
307
|
+
protected unwatchRouterChanges(): void;
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
Defined in: [play-tanstack-react-router/src/tanstack-router-bridge.ts:131](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-react-router/src/tanstack-router-bridge.ts#L131)
|
|
311
|
+
|
|
312
|
+
Stop watching for router location changes.
|
|
313
|
+
|
|
314
|
+
Called by disconnect(). Should clean up the framework-specific subscription.
|
|
315
|
+
|
|
316
|
+
#### Returns
|
|
317
|
+
|
|
318
|
+
`void`
|
|
319
|
+
|
|
320
|
+
#### Overrides
|
|
321
|
+
|
|
322
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`unwatchRouterChanges`](../../play-router/classes/RouterBridgeBase.md#unwatchrouterchanges)
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
### watchRouterChanges()
|
|
327
|
+
|
|
328
|
+
```ts
|
|
329
|
+
protected watchRouterChanges(): void;
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
Defined in: [play-tanstack-react-router/src/tanstack-router-bridge.ts:123](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-react-router/src/tanstack-router-bridge.ts#L123)
|
|
333
|
+
|
|
334
|
+
Subscribe to ALL navigation events via router.history.
|
|
335
|
+
|
|
336
|
+
router.history.subscribe fires for PUSH, POP, BACK, FORWARD, REPLACE, and GO —
|
|
337
|
+
covering both link clicks and browser back/forward button presses.
|
|
338
|
+
|
|
339
|
+
The subscriber callback receives { location, action } where location is the
|
|
340
|
+
new history location with pathname and search already updated.
|
|
341
|
+
|
|
342
|
+
#### Returns
|
|
343
|
+
|
|
344
|
+
`void`
|
|
345
|
+
|
|
346
|
+
#### Overrides
|
|
347
|
+
|
|
348
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`watchRouterChanges`](../../play-router/classes/RouterBridgeBase.md#watchrouterchanges)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-tanstack-react-router](../README.md) / PlayRouterProvider
|
|
2
|
+
|
|
3
|
+
# Function: PlayRouterProvider()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function PlayRouterProvider(__namedParameters): Element;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [play-tanstack-react-router/src/play-router-provider.tsx:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-react-router/src/play-router-provider.tsx#L38)
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
| Parameter | Type |
|
|
14
|
+
| ------------------- | --------------------------------------------------------------------- |
|
|
15
|
+
| `__namedParameters` | [`PlayRouterProviderProps`](../interfaces/PlayRouterProviderProps.md) |
|
|
16
|
+
|
|
17
|
+
## Returns
|
|
18
|
+
|
|
19
|
+
`Element`
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-tanstack-react-router](../README.md) / createRouteMap
|
|
2
|
+
|
|
3
|
+
# Function: createRouteMap()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function createRouteMap(routeTree): RouteMap;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: play-router/dist/create-route-map.d.ts:65
|
|
10
|
+
|
|
11
|
+
Create a RouteMap from a RouteTree for efficient path lookups.
|
|
12
|
+
|
|
13
|
+
Architecture:
|
|
14
|
+
|
|
15
|
+
- Pure function - no side effects
|
|
16
|
+
- O(1) lookups for exact matches via Map
|
|
17
|
+
- O(k) bucket-indexed pattern matching with URLPattern, where k = routes in the
|
|
18
|
+
first-segment bucket (typically << total routes)
|
|
19
|
+
- Returns formatted state IDs (with # prefix)
|
|
20
|
+
- Extracts params from matched patterns
|
|
21
|
+
|
|
22
|
+
**URLPattern requirement:** Dynamic route pattern matching requires `URLPattern`
|
|
23
|
+
to be available on `globalThis`. On Node.js < 24 and older browsers, load a polyfill
|
|
24
|
+
before calling this function:
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import "urlpattern-polyfill"; // before importing @xmachines/play-router
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
If `URLPattern` is unavailable, parameterized routes will not match and a
|
|
31
|
+
`console.warn` is emitted. Static (exact) routes are unaffected.
|
|
32
|
+
|
|
33
|
+
Usage:
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
const routeTree = extractMachineRoutes(machine);
|
|
37
|
+
const routeMap = createRouteMap(routeTree);
|
|
38
|
+
|
|
39
|
+
const { to, params } = routeMap.resolve("/settings/account");
|
|
40
|
+
if (to) {
|
|
41
|
+
actor.send({ type: "play.route", to, params });
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Parameters
|
|
46
|
+
|
|
47
|
+
| Parameter | Type |
|
|
48
|
+
| ----------- | -------------------------------------------------------- |
|
|
49
|
+
| `routeTree` | [`RouteTree`](../../play-router/interfaces/RouteTree.md) |
|
|
50
|
+
|
|
51
|
+
## Returns
|
|
52
|
+
|
|
53
|
+
[`RouteMap`](../../play-router/interfaces/RouteMap.md)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-tanstack-react-router](../README.md) / createRouteMapFromTree
|
|
2
|
+
|
|
3
|
+
# Function: createRouteMapFromTree()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function createRouteMapFromTree(routeTree): RouteMap;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [play-tanstack-react-router/src/route-map.ts:73](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-react-router/src/route-map.ts#L73)
|
|
10
|
+
|
|
11
|
+
Create RouteMap from RouteTree
|
|
12
|
+
|
|
13
|
+
Converts XMachines route tree to RouteMap for use with router adapters.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| ----------- | -------------------------------------------------------- | -------------------------------------- |
|
|
19
|
+
| `routeTree` | [`RouteTree`](../../play-router/interfaces/RouteTree.md) | Route tree from extractMachineRoutes() |
|
|
20
|
+
|
|
21
|
+
## Returns
|
|
22
|
+
|
|
23
|
+
[`RouteMap`](../classes/RouteMap.md)
|
|
24
|
+
|
|
25
|
+
RouteMap instance
|
|
26
|
+
|
|
27
|
+
## Example
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import { extractMachineRoutes } from "@xmachines/play-router";
|
|
31
|
+
import { createRouteMapFromTree } from "@xmachines/play-tanstack-react-router";
|
|
32
|
+
|
|
33
|
+
const routeTree = extractMachineRoutes(machine);
|
|
34
|
+
const routeMap = createRouteMapFromTree(routeTree);
|
|
35
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-tanstack-react-router](../README.md) / extractParams
|
|
2
|
+
|
|
3
|
+
# Function: extractParams()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function extractParams(pathname, pattern): Record<string, string>;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [play-tanstack-react-router/src/extract-params.ts:29](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-react-router/src/extract-params.ts#L29)
|
|
10
|
+
|
|
11
|
+
Extract route parameters from URL path based on route pattern using URLPattern API
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
| Parameter | Type | Description |
|
|
16
|
+
| ---------- | -------- | ---------------------------------------------------- |
|
|
17
|
+
| `pathname` | `string` | Actual URL path (e.g., "/profile/123") |
|
|
18
|
+
| `pattern` | `string` | Route pattern with params (e.g., "/profile/:userId") |
|
|
19
|
+
|
|
20
|
+
## Returns
|
|
21
|
+
|
|
22
|
+
`Record`\<`string`, `string`\>
|
|
23
|
+
|
|
24
|
+
Object with extracted parameters
|
|
25
|
+
|
|
26
|
+
## Example
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
extractParams("/profile/123", "/profile/:userId");
|
|
30
|
+
// Returns: { userId: "123" }
|
|
31
|
+
|
|
32
|
+
extractParams("/api/123", "/api/:id(\\d+)");
|
|
33
|
+
// Returns: { id: "123" }
|
|
34
|
+
// Validates numeric constraint via URLPattern
|
|
35
|
+
|
|
36
|
+
extractParams("/docs/intro", "/docs/*");
|
|
37
|
+
// Returns: { "0": "intro" }
|
|
38
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-tanstack-react-router](../README.md) / extractQueryParams
|
|
2
|
+
|
|
3
|
+
# Function: extractQueryParams()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function extractQueryParams(search): Record<string, string>;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [play-tanstack-react-router/src/extract-params.ts:68](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-react-router/src/extract-params.ts#L68)
|
|
10
|
+
|
|
11
|
+
Extract query parameters from search string
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
| Parameter | Type | Description |
|
|
16
|
+
| --------- | -------- | -------------------------------------------------------------------------------- |
|
|
17
|
+
| `search` | `string` | Query string with or without leading ? (e.g., "?tab=settings" or "tab=settings") |
|
|
18
|
+
|
|
19
|
+
## Returns
|
|
20
|
+
|
|
21
|
+
`Record`\<`string`, `string`\>
|
|
22
|
+
|
|
23
|
+
Object mapping query parameter names to values
|
|
24
|
+
|
|
25
|
+
## Example
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
extractQueryParams("?tab=settings&theme=dark");
|
|
29
|
+
// Returns: { tab: "settings", theme: "dark" }
|
|
30
|
+
|
|
31
|
+
extractQueryParams("q=hello%20world");
|
|
32
|
+
// Returns: { q: "hello world" } (auto-decoded)
|
|
33
|
+
```
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-tanstack-react-router](../README.md) / PlayRouteEvent
|
|
2
|
+
|
|
3
|
+
# Interface: PlayRouteEvent
|
|
4
|
+
|
|
5
|
+
Defined in: play-router/dist/types.d.ts:182
|
|
6
|
+
|
|
7
|
+
Enhanced routing event with parameter and query support
|
|
8
|
+
|
|
9
|
+
Unified routing event used throughout the Play architecture. Supports parameter-aware
|
|
10
|
+
navigation patterns (e.g., `/profile/:userId`) for dynamic route segments.
|
|
11
|
+
|
|
12
|
+
**Architectural Context:** Implements **Passive Infrastructure (INV-04)** by representing
|
|
13
|
+
user navigation intent that the Actor evaluates through guards. Infrastructure proposes
|
|
14
|
+
via `play.route` events, Actor decides via state machine transitions.
|
|
15
|
+
|
|
16
|
+
**Browser Navigation Flow:**
|
|
17
|
+
|
|
18
|
+
1. Browser fires `popstate`
|
|
19
|
+
2. Router adapter resolves URL to route target
|
|
20
|
+
3. Adapter sends `PlayRouteEvent` to Actor
|
|
21
|
+
4. Actor validates transition via state machine guards
|
|
22
|
+
|
|
23
|
+
## Param
|
|
24
|
+
|
|
25
|
+
Event discriminator (always "play.route")
|
|
26
|
+
|
|
27
|
+
## Param
|
|
28
|
+
|
|
29
|
+
Target state ID with # prefix (e.g., '#home', '#profile')
|
|
30
|
+
|
|
31
|
+
## Param
|
|
32
|
+
|
|
33
|
+
Merged path + query parameters (path parameters win conflicts)
|
|
34
|
+
|
|
35
|
+
## Param
|
|
36
|
+
|
|
37
|
+
Query parameters only (isolated from path params)
|
|
38
|
+
|
|
39
|
+
## Param
|
|
40
|
+
|
|
41
|
+
Full URLPattern match result for debugging/observability (optional)
|
|
42
|
+
|
|
43
|
+
## Examples
|
|
44
|
+
|
|
45
|
+
Combining base and routing events
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import type { PlayEvent } from "@xmachines/play";
|
|
49
|
+
import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
50
|
+
|
|
51
|
+
type AppEvent = PlayEvent | PlayRouteEvent;
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Basic navigation to a route
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
58
|
+
|
|
59
|
+
const event: PlayRouteEvent = {
|
|
60
|
+
type: "play.route",
|
|
61
|
+
to: "#home",
|
|
62
|
+
};
|
|
63
|
+
actor.send(event);
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Navigation with route parameters
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
70
|
+
|
|
71
|
+
const event: PlayRouteEvent = {
|
|
72
|
+
type: "play.route",
|
|
73
|
+
to: "#profile",
|
|
74
|
+
params: { userId: "123" },
|
|
75
|
+
};
|
|
76
|
+
actor.send(event);
|
|
77
|
+
// Resolves to route: /profile/123
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Navigation with query parameters
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
84
|
+
|
|
85
|
+
const event: PlayRouteEvent = {
|
|
86
|
+
type: "play.route",
|
|
87
|
+
to: "#settings",
|
|
88
|
+
params: { section: "profile" }, // Merged: path + query
|
|
89
|
+
query: { tab: "security" }, // Query-only
|
|
90
|
+
};
|
|
91
|
+
actor.send(event);
|
|
92
|
+
// Resolves to route: /settings/profile?tab=security
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## See
|
|
96
|
+
|
|
97
|
+
[RFC Play v1](https://gitlab.com/xmachin-es/rfc/-/blob/main/src/play-v1.md)
|
|
98
|
+
|
|
99
|
+
## Remarks
|
|
100
|
+
|
|
101
|
+
Use `play.route` when you need parameter-aware navigation with the `route: {}`
|
|
102
|
+
config pattern on your state machine nodes. The `match` field exposes the full
|
|
103
|
+
URLPatternResult for advanced use cases (debugging, pattern analysis).
|
|
104
|
+
|
|
105
|
+
## Indexable
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
[key: string]: unknown
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Properties
|
|
112
|
+
|
|
113
|
+
| Property | Modifier | Type | Defined in |
|
|
114
|
+
| -------------------------------------- | ---------- | ------------------------------ | ------------------------------- |
|
|
115
|
+
| <a id="property-match"></a> `match?` | `readonly` | `unknown` | play-router/dist/types.d.ts:187 |
|
|
116
|
+
| <a id="property-params"></a> `params?` | `readonly` | `Record`\<`string`, `string`\> | play-router/dist/types.d.ts:185 |
|
|
117
|
+
| <a id="property-query"></a> `query?` | `readonly` | `Record`\<`string`, `string`\> | play-router/dist/types.d.ts:186 |
|
|
118
|
+
| <a id="property-to"></a> `to` | `readonly` | `string` | play-router/dist/types.d.ts:184 |
|
|
119
|
+
| <a id="property-type"></a> `type` | `readonly` | `"play.route"` | play-router/dist/types.d.ts:183 |
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-tanstack-react-router](../README.md) / PlayRouterProviderProps
|
|
2
|
+
|
|
3
|
+
# Interface: PlayRouterProviderProps
|
|
4
|
+
|
|
5
|
+
Defined in: [play-tanstack-react-router/src/play-router-provider.tsx:28](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-react-router/src/play-router-provider.tsx#L28)
|
|
6
|
+
|
|
7
|
+
## Properties
|
|
8
|
+
|
|
9
|
+
| Property | Type | Defined in |
|
|
10
|
+
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| <a id="property-actor"></a> `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<`AnyActorLogic`\> & [`Routable`](../../play-actor/interfaces/Routable.md) & [`Viewable`](../../play-actor/interfaces/Viewable.md) | [play-tanstack-react-router/src/play-router-provider.tsx:29](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-react-router/src/play-router-provider.tsx#L29) |
|
|
12
|
+
| <a id="property-renderer"></a> `renderer` | (`actor`, `router`) => `ReactNode` | [play-tanstack-react-router/src/play-router-provider.tsx:32](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-react-router/src/play-router-provider.tsx#L32) |
|
|
13
|
+
| <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md) | [play-tanstack-react-router/src/play-router-provider.tsx:31](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-react-router/src/play-router-provider.tsx#L31) |
|
|
14
|
+
| <a id="property-router"></a> `router` | [`TanStackRouterLike`](../type-aliases/TanStackRouterLike.md) | [play-tanstack-react-router/src/play-router-provider.tsx:30](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-react-router/src/play-router-provider.tsx#L30) |
|