@xmachines/docs 1.0.0-beta.16 → 1.0.0-beta.18
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 +56 -17
- package/api/@xmachines/play/classes/PlayError.md +240 -0
- package/api/@xmachines/play/type-aliases/PlayEvent.md +4 -4
- package/api/@xmachines/play-actor/README.md +32 -31
- package/api/@xmachines/play-actor/classes/AbstractActor.md +20 -19
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +37 -0
- package/api/@xmachines/play-actor/interfaces/Routable.md +5 -4
- package/api/@xmachines/play-actor/interfaces/ViewMetadata.md +6 -6
- package/api/@xmachines/play-actor/interfaces/Viewable.md +8 -8
- package/api/@xmachines/play-dom/README.md +36 -0
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +83 -0
- package/api/@xmachines/play-dom/functions/connectRenderer.md +51 -0
- package/api/@xmachines/play-dom/functions/renderSpec.md +28 -0
- package/api/@xmachines/play-dom/interfaces/ConnectRendererOptions.md +18 -0
- package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +18 -0
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +14 -0
- package/api/@xmachines/play-dom/type-aliases/DomComponentRenderer.md +23 -0
- package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +11 -0
- package/api/@xmachines/play-react/README.md +227 -305
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +5 -5
- package/api/@xmachines/play-react/functions/defineRegistry.md +47 -0
- package/api/@xmachines/play-react/functions/useActor.md +13 -0
- package/api/@xmachines/play-react/functions/useBoundProp.md +43 -0
- package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
- package/api/@xmachines/play-react/functions/useStateBinding.md +32 -0
- package/api/@xmachines/play-react/interfaces/ComponentContext.md +35 -0
- 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 +15 -7
- package/api/@xmachines/play-react/type-aliases/ComponentFn.md +34 -0
- package/api/@xmachines/play-react/type-aliases/PlayActor.md +9 -0
- package/api/@xmachines/play-react/variables/PlayRenderer.md +18 -30
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +32 -32
- package/api/@xmachines/play-react-router/classes/RouteMap.md +5 -5
- package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +11 -5
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +14 -8
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-router/README.md +51 -0
- package/api/@xmachines/play-router/classes/BaseRouteMap.md +6 -6
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +33 -35
- 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/crawlMachine.md +1 -1
- package/api/@xmachines/play-router/functions/createBrowserHistory.md +4 -1
- package/api/@xmachines/play-router/functions/createRouteMap.md +3 -3
- 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/extractRoute.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/routeExists.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 +19 -15
- package/api/@xmachines/play-router/interfaces/BrowserWindow.md +14 -14
- package/api/@xmachines/play-router/interfaces/ConnectRouterOptions.md +6 -6
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +6 -6
- 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 +4 -4
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +55 -0
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-router/interfaces/StateVisit.md +4 -4
- package/api/@xmachines/play-router/interfaces/VanillaRouter.md +4 -4
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-signals/README.md +22 -10
- package/api/@xmachines/play-signals/functions/watchSignal.md +35 -0
- 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 +193 -219
- package/api/@xmachines/play-solid/functions/defineRegistry.md +47 -0
- package/api/@xmachines/play-solid/functions/useActor.md +13 -0
- package/api/@xmachines/play-solid/functions/useStateBinding.md +23 -0
- package/api/@xmachines/play-solid/interfaces/ComponentContext.md +35 -0
- package/api/@xmachines/play-solid/interfaces/PlayRendererProps.md +15 -7
- package/api/@xmachines/play-solid/type-aliases/ComponentFn.md +34 -0
- package/api/@xmachines/play-solid/type-aliases/PlayActor.md +9 -0
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +15 -43
- package/api/@xmachines/play-solid-router/README.md +56 -30
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +6 -6
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +37 -37
- package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +11 -5
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +18 -17
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +14 -8
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +3 -1
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/README.md +1 -5
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +45 -33
- package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +11 -5
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +2 -2
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.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/PlayRouterProviderProps.md +14 -8
- 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/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +24 -4
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +6 -6
- package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +33 -33
- package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +11 -5
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +14 -8
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +3 -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 +219 -209
- package/api/@xmachines/play-vue/functions/defineRegistry.md +32 -0
- package/api/@xmachines/play-vue/functions/useActor.md +13 -0
- package/api/@xmachines/play-vue/functions/useStateBinding.md +30 -0
- package/api/@xmachines/play-vue/interfaces/ComponentContext.md +35 -0
- package/api/@xmachines/play-vue/interfaces/PlayRendererProps.md +14 -6
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +16 -0
- package/api/@xmachines/play-vue/type-aliases/ComponentFn.md +33 -0
- package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +15 -0
- package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +21 -0
- package/api/@xmachines/play-vue/type-aliases/PlayActor.md +9 -0
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue-router/README.md +74 -29
- 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 +48 -51
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +4 -4
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +3 -1
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +7 -1
- package/api/@xmachines/play-xstate/README.md +236 -111
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +36 -33
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +24 -18
- 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/definePlayer.md +12 -61
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +1 -1
- 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/functions/stateMatches.md +1 -1
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +9 -13
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +2 -2
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +8 -9
- 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 +14 -4
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +19 -4
- package/api/@xmachines/shared/functions/defineXmVitestConfig.md +2 -2
- package/api/@xmachines/shared/functions/xmAliases.md +1 -1
- package/api/README.md +2 -2
- package/api/llms.txt +12 -6
- package/examples/multi-router-integration.md +31 -19
- package/guides/README.md +2 -1
- package/guides/installation.md +1 -6
- package/package.json +2 -2
- package/api/@xmachines/play-catalog/README.md +0 -331
- package/api/@xmachines/play-catalog/functions/defineCatalog.md +0 -98
- package/api/@xmachines/play-catalog/functions/defineComponents.md +0 -134
- package/api/@xmachines/play-catalog/type-aliases/Catalog.md +0 -48
- package/api/@xmachines/play-catalog/type-aliases/ComponentsFor.md +0 -20
- package/api/@xmachines/play-catalog/type-aliases/InferComponentProps.md +0 -65
- package/api/@xmachines/play-catalog/type-aliases/NoExtraKeys.md +0 -17
- package/api/@xmachines/play-xstate/functions/mergeViewProps.md +0 -26
- package/api/@xmachines/play-xstate/functions/validateComponentBinding.md +0 -39
- package/api/@xmachines/play-xstate/functions/validateViewProps.md +0 -80
- package/api/@xmachines/play-xstate/interfaces/CatalogEntry.md +0 -16
- package/api/@xmachines/play-xstate/type-aliases/Catalog.md +0 -21
- package/api/@xmachines/play-xstate/type-aliases/ValidationResult.md +0 -17
- package/api/@xmachines/play-xstate/type-aliases/ViewMergeContext.md +0 -35
|
@@ -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.18/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,15 +25,15 @@ 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.18/packages/play-react-router/src/react-router-bridge.ts#L31)
|
|
29
29
|
|
|
30
30
|
#### Parameters
|
|
31
31
|
|
|
32
|
-
| Parameter | Type
|
|
33
|
-
| ---------- |
|
|
34
|
-
| `router` | `Router`
|
|
35
|
-
| `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic)\> & [`Routable`](../../play-actor/interfaces/Routable.md) |
|
|
36
|
-
| `routeMap` | [`RouteMap`](RouteMap.md)
|
|
32
|
+
| Parameter | Type |
|
|
33
|
+
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
34
|
+
| `router` | `Router` |
|
|
35
|
+
| `actor` | [`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) |
|
|
36
|
+
| `routeMap` | [`RouteMap`](RouteMap.md) |
|
|
37
37
|
|
|
38
38
|
#### Returns
|
|
39
39
|
|
|
@@ -45,17 +45,17 @@ Defined in: [play-react-router/src/react-router-bridge.ts:31](https://gitlab.com
|
|
|
45
45
|
|
|
46
46
|
## Properties
|
|
47
47
|
|
|
48
|
-
| Property | Modifier | Type
|
|
49
|
-
| --------------------------------------------------------------------- | ----------- |
|
|
50
|
-
| <a id="property-actor"></a> `actor` | `readonly` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic)\> & [`Routable`](../../play-actor/interfaces/Routable.md) |
|
|
51
|
-
| <a id="property-hasconnectedonce"></a> `hasConnectedOnce` | `protected` | `boolean`
|
|
52
|
-
| <a id="property-isconnected"></a> `isConnected` | `protected` | `boolean`
|
|
53
|
-
| <a id="property-isprocessingnavigation"></a> `isProcessingNavigation` | `protected` | `boolean`
|
|
54
|
-
| <a id="property-lastsyncedpath"></a> `lastSyncedPath` | `protected` | `string`
|
|
55
|
-
| <a id="property-routemap"></a> `routeMap` | `readonly` | `object`
|
|
56
|
-
| `routeMap.getPathByStateId` | `public` | `string` \| `null` \| `undefined`
|
|
57
|
-
| `routeMap.getStateIdByPath` | `public` | `string` \| `null` \| `undefined`
|
|
58
|
-
| <a id="property-routewatcher"></a> `routeWatcher` | `protected` | \| [`
|
|
48
|
+
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
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) | A `Routable` actor exposing `currentRoute` and `send`. | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`actor`](../../play-router/classes/RouterBridgeBase.md#property-actor) | play-router/dist/router-bridge-base.d.ts:73 |
|
|
51
|
+
| <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:79 |
|
|
52
|
+
| <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:78 |
|
|
53
|
+
| <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:81 |
|
|
54
|
+
| <a id="property-lastsyncedpath"></a> `lastSyncedPath` | `protected` | `string` \| `null` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`lastSyncedPath`](../../play-router/classes/RouterBridgeBase.md#property-lastsyncedpath) | play-router/dist/router-bridge-base.d.ts:80 |
|
|
55
|
+
| <a id="property-routemap"></a> `routeMap` | `readonly` | `object` | 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/dist/router-bridge-base.d.ts:74 |
|
|
56
|
+
| `routeMap.getPathByStateId` | `public` | `string` \| `null` \| `undefined` | - | - | play-router/dist/router-bridge-base.d.ts:76 |
|
|
57
|
+
| `routeMap.getStateIdByPath` | `public` | `string` \| `null` \| `undefined` | - | - | play-router/dist/router-bridge-base.d.ts:75 |
|
|
58
|
+
| <a id="property-routewatcher"></a> `routeWatcher` | `protected` | \| [`RouteWatcherHandle`](../../play-router/interfaces/RouteWatcherHandle.md) \| `null` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`routeWatcher`](../../play-router/classes/RouterBridgeBase.md#property-routewatcher) | play-router/dist/router-bridge-base.d.ts:82 |
|
|
59
59
|
|
|
60
60
|
## Methods
|
|
61
61
|
|
|
@@ -65,7 +65,7 @@ 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/dist/router-bridge-base.d.ts:
|
|
68
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:99
|
|
69
69
|
|
|
70
70
|
Connect the router bridge to the Actor.
|
|
71
71
|
|
|
@@ -88,7 +88,7 @@ starts watching router changes (framework-specific).
|
|
|
88
88
|
disconnect(): void;
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
Defined in: play-router/dist/router-bridge-base.d.ts:
|
|
91
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:105
|
|
92
92
|
|
|
93
93
|
Disconnect the router bridge from the Actor.
|
|
94
94
|
|
|
@@ -110,7 +110,7 @@ Stops signal watching and unregisters framework-specific router listener.
|
|
|
110
110
|
protected extractParams(pathname, stateId): Record<string, string>;
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
Defined in: play-router/dist/router-bridge-base.d.ts:
|
|
113
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:132
|
|
114
114
|
|
|
115
115
|
Extract path parameters from URL using the URLPattern API.
|
|
116
116
|
|
|
@@ -121,10 +121,10 @@ works, params will be empty).
|
|
|
121
121
|
|
|
122
122
|
#### Parameters
|
|
123
123
|
|
|
124
|
-
| Parameter | Type | Description
|
|
125
|
-
| ---------- | -------- |
|
|
126
|
-
| `pathname` | `string` | The actual URL path (e.g., '/profile/john')
|
|
127
|
-
| `stateId` | `string` | The matched state ID for looking up route pattern |
|
|
124
|
+
| Parameter | Type | Description |
|
|
125
|
+
| ---------- | -------- | ----------------------------------------------------- |
|
|
126
|
+
| `pathname` | `string` | The actual URL path (e.g., '/profile/john') |
|
|
127
|
+
| `stateId` | `string` | The matched state ID for looking up the route pattern |
|
|
128
128
|
|
|
129
129
|
#### Returns
|
|
130
130
|
|
|
@@ -144,7 +144,7 @@ Extracted path parameters, or empty object if URLPattern is unavailable or no ma
|
|
|
144
144
|
protected extractQuery(search): Record<string, string>;
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
-
Defined in: play-router/dist/router-bridge-base.d.ts:
|
|
147
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:139
|
|
148
148
|
|
|
149
149
|
Extract query parameters from URL search string.
|
|
150
150
|
|
|
@@ -172,7 +172,7 @@ Extracted query parameters or empty object
|
|
|
172
172
|
protected getInitialRouterPath(): string | null;
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
-
Defined in: [play-react-router/src/react-router-bridge.ts:49](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
175
|
+
Defined in: [play-react-router/src/react-router-bridge.ts:49](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-react-router/src/react-router-bridge.ts#L49)
|
|
176
176
|
|
|
177
177
|
Return the router's current pathname so connect() can sync the actor to
|
|
178
178
|
the URL on initial load. router.subscribe() only fires on future navigations
|
|
@@ -195,7 +195,7 @@ the page on /about would leave the actor in its default "home" state.
|
|
|
195
195
|
protected navigateRouter(path): void;
|
|
196
196
|
```
|
|
197
197
|
|
|
198
|
-
Defined in: [play-react-router/src/react-router-bridge.ts:39](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
198
|
+
Defined in: [play-react-router/src/react-router-bridge.ts:39](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-react-router/src/react-router-bridge.ts#L39)
|
|
199
199
|
|
|
200
200
|
Navigate the framework router to the given path.
|
|
201
201
|
|
|
@@ -224,7 +224,7 @@ Must trigger the framework router's navigation (e.g., router.navigate(path)).
|
|
|
224
224
|
protected syncActorFromRouter(pathname, search?): void;
|
|
225
225
|
```
|
|
226
226
|
|
|
227
|
-
Defined in: play-router/dist/router-bridge-base.d.ts:
|
|
227
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:119
|
|
228
228
|
|
|
229
229
|
Sync actor state when router location changes.
|
|
230
230
|
|
|
@@ -254,7 +254,7 @@ Prevents circular updates via isProcessingNavigation flag.
|
|
|
254
254
|
protected syncRouterFromActor(route): void;
|
|
255
255
|
```
|
|
256
256
|
|
|
257
|
-
Defined in: play-router/dist/router-bridge-base.d.ts:
|
|
257
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:112
|
|
258
258
|
|
|
259
259
|
Sync router location when actor route signal changes.
|
|
260
260
|
|
|
@@ -283,7 +283,7 @@ Prevents circular updates via isProcessingNavigation flag.
|
|
|
283
283
|
protected unwatchRouterChanges(): void;
|
|
284
284
|
```
|
|
285
285
|
|
|
286
|
-
Defined in: [play-react-router/src/react-router-bridge.ts:59](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
286
|
+
Defined in: [play-react-router/src/react-router-bridge.ts:59](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-react-router/src/react-router-bridge.ts#L59)
|
|
287
287
|
|
|
288
288
|
Stop watching for router location changes.
|
|
289
289
|
|
|
@@ -305,7 +305,7 @@ Called by disconnect(). Should clean up the framework-specific subscription.
|
|
|
305
305
|
protected watchRouterChanges(): void;
|
|
306
306
|
```
|
|
307
307
|
|
|
308
|
-
Defined in: [play-react-router/src/react-router-bridge.ts:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
308
|
+
Defined in: [play-react-router/src/react-router-bridge.ts:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-react-router/src/react-router-bridge.ts#L53)
|
|
309
309
|
|
|
310
310
|
Start watching for router location changes.
|
|
311
311
|
|
|
@@ -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.18/packages/play-react-router/src/route-map.ts#L54)
|
|
6
6
|
|
|
7
7
|
Bidirectional route mapper for React Router.
|
|
8
8
|
|
|
@@ -40,12 +40,12 @@ routeMap.getPathByStateId("home"); // "/"
|
|
|
40
40
|
new RouteMap(mappings): RouteMap;
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
Defined in: play-router/dist/base-route-map.d.ts:
|
|
43
|
+
Defined in: play-router/dist/base-route-map.d.ts:82
|
|
44
44
|
|
|
45
45
|
Build a route map from an array of state ID ↔ path mappings.
|
|
46
46
|
|
|
47
47
|
Static paths (no `:param`) are indexed in an O(1) `Map`.
|
|
48
|
-
Parameterized paths are compiled to `
|
|
48
|
+
Parameterized paths are compiled to `URLPattern` and grouped into first-segment
|
|
49
49
|
buckets for efficient candidate selection.
|
|
50
50
|
|
|
51
51
|
#### Parameters
|
|
@@ -70,7 +70,7 @@ buckets for efficient candidate selection.
|
|
|
70
70
|
getPathByStateId(stateId): string | null;
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
Defined in: play-router/dist/base-route-map.d.ts:
|
|
73
|
+
Defined in: play-router/dist/base-route-map.d.ts:112
|
|
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/dist/base-route-map.d.ts:
|
|
108
|
+
Defined in: play-router/dist/base-route-map.d.ts:99
|
|
109
109
|
|
|
110
110
|
Resolve a URL path to its mapped state ID.
|
|
111
111
|
|
|
@@ -3,16 +3,22 @@
|
|
|
3
3
|
# Function: PlayRouterProvider()
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
|
-
function PlayRouterProvider(__namedParameters): Element;
|
|
6
|
+
function PlayRouterProvider<TActor>(__namedParameters): Element;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-react-router/src/play-router-provider.tsx:
|
|
9
|
+
Defined in: [play-react-router/src/play-router-provider.tsx:21](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-react-router/src/play-router-provider.tsx#L21)
|
|
10
|
+
|
|
11
|
+
## Type Parameters
|
|
12
|
+
|
|
13
|
+
| Type Parameter |
|
|
14
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| `TActor` _extends_ [`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) & [`Viewable`](../../play-actor/interfaces/Viewable.md) |
|
|
10
16
|
|
|
11
17
|
## Parameters
|
|
12
18
|
|
|
13
|
-
| Parameter | Type
|
|
14
|
-
| ------------------- |
|
|
15
|
-
| `__namedParameters` | [`PlayRouterProviderProps`](../interfaces/PlayRouterProviderProps.md) |
|
|
19
|
+
| Parameter | Type |
|
|
20
|
+
| ------------------- | --------------------------------------------------------------------------------- |
|
|
21
|
+
| `__namedParameters` | [`PlayRouterProviderProps`](../interfaces/PlayRouterProviderProps.md)\<`TActor`\> |
|
|
16
22
|
|
|
17
23
|
## Returns
|
|
18
24
|
|
|
@@ -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.18/packages/play-react-router/src/route-map.ts#L73)
|
|
10
10
|
|
|
11
11
|
Create RouteMap from RouteTree
|
|
12
12
|
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
[Documentation](../../../README.md) / [@xmachines/play-react-router](../README.md) / PlayRouterProviderProps
|
|
2
2
|
|
|
3
|
-
# Interface: PlayRouterProviderProps
|
|
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.18/packages/play-react-router/src/play-router-provider.tsx#L10)
|
|
6
|
+
|
|
7
|
+
## Type Parameters
|
|
8
|
+
|
|
9
|
+
| Type Parameter | Default type |
|
|
10
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| `TActor` _extends_ [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic)\> & [`Routable`](../../play-actor/interfaces/Routable.md) & [`Viewable`](../../play-actor/interfaces/Viewable.md) | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic)\> & [`Routable`](../../play-actor/interfaces/Routable.md) & [`Viewable`](../../play-actor/interfaces/Viewable.md) |
|
|
6
12
|
|
|
7
13
|
## Properties
|
|
8
14
|
|
|
9
|
-
| Property | Type
|
|
10
|
-
| ----------------------------------------- |
|
|
11
|
-
| <a id="property-actor"></a> `actor` |
|
|
12
|
-
| <a id="property-renderer"></a> `renderer` | (`actor`, `router`) => `ReactNode`
|
|
13
|
-
| <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md)
|
|
14
|
-
| <a id="property-router"></a> `router` | `Router`
|
|
15
|
+
| Property | Type | Description | Defined in |
|
|
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/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.18/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.18/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.18/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.18/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.18/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.18/packages/play-react-router/src/route-map.ts#L24) |
|
|
@@ -14,6 +14,8 @@ It also exports `RouterBridgeBase`, the shared base class used by framework adap
|
|
|
14
14
|
|
|
15
15
|
`RouterBridgeBase` is the policy point; framework adapters are thin ports that implement only framework-specific navigate/subscribe/unsubscribe behavior.
|
|
16
16
|
|
|
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
|
+
|
|
17
19
|
Per [RFC Play v1](https://gitlab.com/xmachin-es/rfc/-/blob/main/src/play-v1.md), this package implements:
|
|
18
20
|
|
|
19
21
|
- **Actor Authority (INV-01):** Routes derive from machine definitions, not external configuration
|
|
@@ -180,6 +182,17 @@ Bridge teardown must be explicit and deterministic:
|
|
|
180
182
|
- `disconnect`/`dispose` must unwatch signal subscriptions and unhook router listeners.
|
|
181
183
|
- Do not rely on GC-only cleanup guidance.
|
|
182
184
|
- Infrastructure remains passive: bridges observe and forward intents, actors decide validity.
|
|
185
|
+
- `createBrowserHistory().destroy()` is idempotent and restores shared `window.history` patches only after the last wrapper for that window is removed.
|
|
186
|
+
|
|
187
|
+
## Diagnostics
|
|
188
|
+
|
|
189
|
+
Router infrastructure reports runtime failures through `PlayDiagnostics` from `@xmachines/play`.
|
|
190
|
+
|
|
191
|
+
- Default behavior uses `consoleDiagnostics`.
|
|
192
|
+
- Messages follow a stable `[scope:code] message` format.
|
|
193
|
+
- Example: `[RouterBridgeBase:PLAY_ROUTER_SYNC_FAILED] Failed to sync actor state from router location.`
|
|
194
|
+
|
|
195
|
+
This keeps router errors observable while letting applications swap in their own diagnostics implementation upstream.
|
|
183
196
|
|
|
184
197
|
## API Reference
|
|
185
198
|
|
|
@@ -428,6 +441,43 @@ meta: {
|
|
|
428
441
|
|
|
429
442
|
**Parameter substitution:** Values extracted from context or event params (handled by play-xstate adapter).
|
|
430
443
|
|
|
444
|
+
## Error Handling
|
|
445
|
+
|
|
446
|
+
All runtime errors thrown by this package extend `PlayError` from `@xmachines/play` and
|
|
447
|
+
are exported from the `./errors` subpath:
|
|
448
|
+
|
|
449
|
+
```typescript
|
|
450
|
+
import {
|
|
451
|
+
RouterSyncError,
|
|
452
|
+
URLPatternUnavailableError,
|
|
453
|
+
InvalidRoutePatternError,
|
|
454
|
+
} from "@xmachines/play-router/errors";
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
| Class | Code | When thrown |
|
|
458
|
+
| ---------------------------- | --------------------------------------- | -------------------------------------------------------------- |
|
|
459
|
+
| `RouterSyncError` | `PLAY_ROUTER_SYNC_FAILED` | `syncActorFromRouter()` fails to send a `play.route` event |
|
|
460
|
+
| `URLPatternUnavailableError` | `PLAY_ROUTE_MAP_URLPATTERN_UNAVAILABLE` | `createRouteMap()` called before URLPattern polyfill is loaded |
|
|
461
|
+
| `InvalidRoutePatternError` | `PLAY_ROUTE_MAP_INVALID_PATTERN` | A route pattern string is rejected by URLPattern constructor |
|
|
462
|
+
|
|
463
|
+
`InvalidRoutePatternError` carries a `pattern: string` field with the offending pattern.
|
|
464
|
+
|
|
465
|
+
```typescript
|
|
466
|
+
import { PlayError } from "@xmachines/play";
|
|
467
|
+
import { RouterSyncError } from "@xmachines/play-router/errors";
|
|
468
|
+
|
|
469
|
+
try {
|
|
470
|
+
bridge.connect();
|
|
471
|
+
} catch (err) {
|
|
472
|
+
if (err instanceof RouterSyncError) {
|
|
473
|
+
// err.cause — the original error that triggered the sync failure
|
|
474
|
+
monitoringService.record(err);
|
|
475
|
+
} else if (err instanceof PlayError) {
|
|
476
|
+
console.error(`[${err.scope}:${err.code}] ${err.message}`);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
```
|
|
480
|
+
|
|
431
481
|
## Architecture
|
|
432
482
|
|
|
433
483
|
This package enables **Actor Authority (INV-01)**:
|
|
@@ -475,6 +525,7 @@ For a copy, see <https://opensource.org/licenses/MIT>.
|
|
|
475
525
|
- [RouteObject](interfaces/RouteObject.md)
|
|
476
526
|
- [RouterBridge](interfaces/RouterBridge.md)
|
|
477
527
|
- [RouteTree](interfaces/RouteTree.md)
|
|
528
|
+
- [RouteWatcherHandle](interfaces/RouteWatcherHandle.md)
|
|
478
529
|
- [StateVisit](interfaces/StateVisit.md)
|
|
479
530
|
- [VanillaRouter](interfaces/VanillaRouter.md)
|
|
480
531
|
|
|
@@ -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:106](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-router/src/base-route-map.ts#L106)
|
|
6
6
|
|
|
7
7
|
Shared bidirectional route map base class.
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ own and inherit the full public API from here.
|
|
|
12
12
|
**Lookup strategy:**
|
|
13
13
|
|
|
14
14
|
- Static paths (no `:param`) → O(1) `Map` lookup
|
|
15
|
-
- Dynamic paths → O(k) bucket-indexed scan using `
|
|
15
|
+
- Dynamic paths → O(k) bucket-indexed scan using `URLPattern`, where `k` is the number
|
|
16
16
|
of routes sharing the same first path segment
|
|
17
17
|
- Results are cached after the first match
|
|
18
18
|
|
|
@@ -57,12 +57,12 @@ 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:125](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-router/src/base-route-map.ts#L125)
|
|
61
61
|
|
|
62
62
|
Build a route map from an array of state ID ↔ path mappings.
|
|
63
63
|
|
|
64
64
|
Static paths (no `:param`) are indexed in an O(1) `Map`.
|
|
65
|
-
Parameterized paths are compiled to `
|
|
65
|
+
Parameterized paths are compiled to `URLPattern` and grouped into first-segment
|
|
66
66
|
buckets for efficient candidate selection.
|
|
67
67
|
|
|
68
68
|
#### Parameters
|
|
@@ -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:210](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-router/src/base-route-map.ts#L210)
|
|
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:175](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-router/src/base-route-map.ts#L175)
|
|
118
118
|
|
|
119
119
|
Resolve a URL path to its mapped state ID.
|
|
120
120
|
|