@xmachines/play-router 5.0.2 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -20
- package/dist/base-route-map.d.ts +1 -2
- package/dist/base-route-map.d.ts.map +1 -1
- package/dist/base-route-map.js +5 -7
- package/dist/base-route-map.js.map +1 -1
- package/dist/find-route.d.ts +2 -2
- package/dist/find-route.js +2 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -6
- package/dist/index.js.map +1 -1
- package/dist/provider-lifecycle.d.ts +5 -11
- package/dist/provider-lifecycle.d.ts.map +1 -1
- package/dist/provider-lifecycle.js +1 -15
- package/dist/provider-lifecycle.js.map +1 -1
- package/dist/router-bridge-base.d.ts +1 -1
- package/dist/router-bridge-base.js +1 -1
- package/dist/router-sync.d.ts.map +1 -1
- package/dist/router-sync.js +3 -2
- package/dist/router-sync.js.map +1 -1
- package/dist/types.d.ts +25 -25
- package/dist/types.d.ts.map +1 -1
- package/package.json +9 -7
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Route tree extraction from XState v5 state machines. Part of [@xmachines/play](../play/README.md) Universal Player Architecture.
|
|
4
4
|
|
|
5
|
-
[](https://opensource.org/licenses/MIT) [](https://opensource.org/licenses/MIT) [](https://www.npmjs.com/package/@xmachines/play-router)
|
|
6
6
|
|
|
7
7
|
This package extracts the routes from a machine graph and looks them up in both directions. The Actor therefore keeps the authority over the navigation.
|
|
8
8
|
|
|
@@ -14,12 +14,13 @@ This package extracts the routes from a machine graph and looks them up in both
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
pnpm add @xmachines/play-router @xmachines/play @xmachines/play-atom
|
|
17
|
+
pnpm add @xmachines/play-router @xmachines/core @xmachines/play @xmachines/play-atom
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
**Peer dependencies.** Install them with the package:
|
|
21
21
|
|
|
22
|
-
- [`@xmachines/
|
|
22
|
+
- [`@xmachines/core`](../core/README.md) — the base package. This package reads the helpers of its `utils` subpath.
|
|
23
|
+
- [`@xmachines/play`](../play/README.md) — the core protocol. This package reads the error classes from its `errors` subpath.
|
|
23
24
|
- [`@xmachines/play-atom`](../play-atom/README.md) — the atom primitives. The bridge reads the route of the actor with `watchAtom`.
|
|
24
25
|
|
|
25
26
|
**Optional peers.** The `@xmachines/play-router/xstate` subpath alone reads them. Install them when you read that subpath, and not before:
|
|
@@ -479,16 +480,16 @@ about fifteen lines that bind that lifecycle to the effects of the framework. Th
|
|
|
479
480
|
package holds the lifecycle, and it holds every decision in it. An adapter keeps its
|
|
480
481
|
own effects and nothing else.
|
|
481
482
|
|
|
482
|
-
| Export | Description
|
|
483
|
-
| ----------------------------------------------------- |
|
|
484
|
-
| `PlayRouterProviderBaseProps<TRouter, TActor, TNode>` | The documented props. `TNode` is what the framework renders
|
|
485
|
-
| `PlayRouterBridgeConstructor<TRouter>` | The constructor shape a bridge class must satisfy
|
|
486
|
-
| `openProviderBridge(BridgeCtor, args)` | Builds the bridge, connects it, and returns it with a `close`
|
|
487
|
-
| `repointProviderBridge(bridge, basePath, params?)` | Moves the mount of a live bridge. A `null` bridge and a bridge with no mount API are no-ops
|
|
488
|
-
| `mountKey(basePath, params?)` | A key that changes when the mount changes, compared BY VALUE
|
|
489
|
-
| `isMountableBridge(bridge)` | The run-time probe for a bridge that can move its mount
|
|
490
|
-
| `createRouterConnection(bridge)` | Wraps a live bridge in the callable `RouterConnection` that `connectRouter` returns
|
|
491
|
-
| `RouterConnection` | The callable handle: `disconnect()`, the mount to read and to move
|
|
483
|
+
| Export | Description |
|
|
484
|
+
| ----------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
|
485
|
+
| `PlayRouterProviderBaseProps<TRouter, TActor, TNode>` | The documented props. `TNode` is what the framework renders |
|
|
486
|
+
| `PlayRouterBridgeConstructor<TRouter>` | The constructor shape a bridge class must satisfy |
|
|
487
|
+
| `openProviderBridge(BridgeCtor, args)` | Builds the bridge, connects it, and returns it with a `close` |
|
|
488
|
+
| `repointProviderBridge(bridge, basePath, params?)` | Moves the mount of a live bridge. A `null` bridge and a bridge with no mount API are no-ops |
|
|
489
|
+
| `mountKey(basePath, params?)` | A key that changes when the mount changes, compared BY VALUE |
|
|
490
|
+
| `isMountableBridge(bridge)` | The run-time probe for a bridge that can move its mount |
|
|
491
|
+
| `createRouterConnection(bridge)` | Wraps a live bridge in the callable `RouterConnection` that `connectRouter` returns |
|
|
492
|
+
| `RouterConnection` | The callable handle: `disconnect()`, and the mount to read and to move. It is its own release |
|
|
492
493
|
|
|
493
494
|
Nothing here imports a framework, so this package keeps no framework dependency —
|
|
494
495
|
`tests/provider-factory-parity.test.ts` holds that. `TNode` is the only thing in the
|
|
@@ -587,18 +588,17 @@ breadcrumb. It also carries three fields that the routing layer reads:
|
|
|
587
588
|
| --------- | -------- | ------------------------------------------------------------------------------- |
|
|
588
589
|
| `path` | required | The template of the route path |
|
|
589
590
|
| `handler` | `"root"` | Where the generated `play.route` transition sits: `"root"`, `"local"`, `"both"` |
|
|
590
|
-
| `reenter` | `false` | Whether the transition re-enters its
|
|
591
|
+
| `reenter` | `false` | Whether the transition re-enters its domain |
|
|
591
592
|
| `data` | none | The extra data of the route: a literal value, or a function of the event |
|
|
592
593
|
|
|
593
594
|
[`@xmachines/play-xstate`](../play-xstate/README.md) reads `handler`, `reenter`, and `data` when it generates the
|
|
594
595
|
transitions. See the README of that package for what each value does.
|
|
595
596
|
|
|
596
|
-
**The four names are RESERVED
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
Give such a field another name.
|
|
597
|
+
**The four names are RESERVED.** The routing layer reads each of them, so a field of
|
|
598
|
+
your own under one of these names changes the machine. An unknown `handler` value throws
|
|
599
|
+
an `InvalidRouteHandlerError` at the format time, and the machine builds never. A `data`
|
|
600
|
+
value goes to `context.data`, where the `/context` projection of every view reads it.
|
|
601
|
+
Give a field of your own another name.
|
|
602
602
|
|
|
603
603
|
### Relative vs absolute paths
|
|
604
604
|
|
package/dist/base-route-map.d.ts
CHANGED
|
@@ -44,8 +44,7 @@ export interface RouteMapping {
|
|
|
44
44
|
* - A dynamic path → a scan of the bucket index in O(k), with `URLPattern`, where
|
|
45
45
|
* `k` is the number of the routes with the same first path segment
|
|
46
46
|
* - The class keeps each result of a first match in an LRU cache. The default cache
|
|
47
|
-
* holds
|
|
48
|
-
* replaces it
|
|
47
|
+
* holds 1001 entries at most, and the `pathCache` constructor option replaces it
|
|
49
48
|
*
|
|
50
49
|
* **The syntax of a pattern:** the whole URLPattern pathname grammar. The forms used most
|
|
51
50
|
* often are:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-route-map.d.ts","sourceRoot":"","sources":["../src/base-route-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAeH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAelD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,YAAY;IAC5B,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,uGAAuG;IACvG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB;AA+DD
|
|
1
|
+
{"version":3,"file":"base-route-map.d.ts","sourceRoot":"","sources":["../src/base-route-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAeH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAelD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,YAAY;IAC5B,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,uGAAuG;IACvG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB;AA+DD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,qBAAa,QAAQ;IACpB,8EAA8E;IAC9E,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,cAAc,CAGpB;IACF,OAAO,CAAC,cAAc,CAA+B;IACrD,iGAAiG;IACjG,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA2B;IACxD;;;;;;OAMG;IACH,OAAO,CAAC,cAAc,CAAiB;IAEvC;;;;;;;;;;;;OAYG;gBACS,QAAQ,EAAE,YAAY,EAAE,EAAE,OAAO,GAAE,eAAoB;IAoDnE;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IA4B7C;;;;;;;;;;;;;;;;OAgBG;IACH,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAGhD"}
|
package/dist/base-route-map.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* segment, and that number is much smaller than the number of all the routes. The
|
|
11
11
|
* class matches a parameterized route with URLPattern.
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
13
|
+
import { createLruCache, getCandidates, getCompiledPattern, getIndexKey, parsePattern, splitLocation, } from "@xmachines/play-url";
|
|
14
14
|
import { InvalidRoutePatternError } from "./errors.js";
|
|
15
15
|
/**
|
|
16
16
|
* The canonical key of a stateId: the bare form, without a `#` at its start.
|
|
@@ -27,8 +27,8 @@ function canonicalStateIdKey(stateId) {
|
|
|
27
27
|
/**
|
|
28
28
|
* The bound of the path cache that a map builds for itself.
|
|
29
29
|
*
|
|
30
|
-
* `
|
|
31
|
-
*
|
|
30
|
+
* `createLruCache` keeps two generations, so the cache holds twice this number and one
|
|
31
|
+
* more at most. A caller that wants another bound passes a cache: `createLruCache(5000)`
|
|
32
32
|
* builds one. A separate size option would configure THIS cache alone and say so nowhere,
|
|
33
33
|
* and it would do nothing at all beside a cache that the caller passed.
|
|
34
34
|
*/
|
|
@@ -94,8 +94,7 @@ function routeTableId(mappings) {
|
|
|
94
94
|
* - A dynamic path → a scan of the bucket index in O(k), with `URLPattern`, where
|
|
95
95
|
* `k` is the number of the routes with the same first path segment
|
|
96
96
|
* - The class keeps each result of a first match in an LRU cache. The default cache
|
|
97
|
-
* holds
|
|
98
|
-
* replaces it
|
|
97
|
+
* holds 1001 entries at most, and the `pathCache` constructor option replaces it
|
|
99
98
|
*
|
|
100
99
|
* **The syntax of a pattern:** the whole URLPattern pathname grammar. The forms used most
|
|
101
100
|
* often are:
|
|
@@ -169,8 +168,7 @@ export class RouteMap {
|
|
|
169
168
|
this.stateIdToPath = new Map();
|
|
170
169
|
this.pathToStateId = new Map();
|
|
171
170
|
this.patternBuckets = new Map();
|
|
172
|
-
this.pathMatchCache =
|
|
173
|
-
pathCache ?? createPatternCache(DEFAULT_PATH_CACHE_SIZE);
|
|
171
|
+
this.pathMatchCache = pathCache ?? createLruCache(DEFAULT_PATH_CACHE_SIZE);
|
|
174
172
|
// A map that BUILDS its own cache owns every key in it, and a prefix would only make
|
|
175
173
|
// each key longer. A map that RECEIVES one shares it, so its keys carry the prefix.
|
|
176
174
|
if (pathCache === undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-route-map.js","sourceRoot":"","sources":["../src/base-route-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACN,
|
|
1
|
+
{"version":3,"file":"base-route-map.js","sourceRoot":"","sources":["../src/base-route-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACN,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,aAAa,GAIb,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAGvD;;;;;;;;GAQG;AACH,SAAS,mBAAmB,CAAC,OAAe;IAC3C,OAAO,OAAO,CAAC,UAAU,CAAC,GAA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GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtD,IAAI,WAAW,KAAK,SAAS;YAAE,OAAO,WAAW,CAAC;QAElD,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC;QAC9E,KAAK,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,UAAU,EAAE,CAAC;YAC/C,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;YACpD,IAAI,KAAK,EAAE,CAAC;gBACX,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;gBAC3C,OAAO,OAAO,CAAC;YAChB,CAAC;QACF,CAAC;QAED,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,gBAAgB,CAAC,OAAe;QAC/B,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC;IACrE,CAAC;CACD"}
|
package/dist/find-route.d.ts
CHANGED
|
@@ -50,8 +50,8 @@ export declare const findRouteById: (tree: RouteTree, id: string) => RouteNode |
|
|
|
50
50
|
*
|
|
51
51
|
* // With a cache that one request owns and drops
|
|
52
52
|
* const node = findRouteByPath(tree, '/dashboard', {
|
|
53
|
-
* patternCache:
|
|
54
|
-
* compiledCache:
|
|
53
|
+
* patternCache: createLruCache(),
|
|
54
|
+
* compiledCache: createLruCache(),
|
|
55
55
|
* });
|
|
56
56
|
* ```
|
|
57
57
|
*/
|
package/dist/find-route.js
CHANGED
|
@@ -84,8 +84,8 @@ export const findRouteById = (tree, id) => {
|
|
|
84
84
|
*
|
|
85
85
|
* // With a cache that one request owns and drops
|
|
86
86
|
* const node = findRouteByPath(tree, '/dashboard', {
|
|
87
|
-
* patternCache:
|
|
88
|
-
* compiledCache:
|
|
87
|
+
* patternCache: createLruCache(),
|
|
88
|
+
* compiledCache: createLruCache(),
|
|
89
89
|
* });
|
|
90
90
|
* ```
|
|
91
91
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -6,14 +6,13 @@ export { validateRouteFormat, validateStateExists, detectDuplicateRoutes, } from
|
|
|
6
6
|
export type { ResolvedRoutePath } from "./validate-routes.js";
|
|
7
7
|
export { normalizeBasePath, resolveBasePath, stripBasePath, joinBasePath, NO_BASE_PATH, } from "@xmachines/play-url";
|
|
8
8
|
export type { BasePathOptions, ResolvedBasePath } from "@xmachines/play-url";
|
|
9
|
-
export { cleanFrameworkParams,
|
|
9
|
+
export { cleanFrameworkParams, createLruCache, parsePattern, pickOwnParams, resolveFrameworkParams, sanitizePathname, splitLocation, type CompileOptions, type ParseOptions, type FrameworkParamsSource, type KeyValueCache, type ParsedPattern, type SplitLocation, type URLPatternLike, } from "@xmachines/play-url";
|
|
10
10
|
export { isMountableBridge, mountKey, createRouterConnection, openProviderBridge, repointProviderBridge, } from "./provider-lifecycle.js";
|
|
11
11
|
export type { OpenProviderBridgeArgs, PlayRouterBridgeConstructor, PlayRouterProviderBaseProps, RouterConnection, } from "./provider-lifecycle.js";
|
|
12
12
|
export type { RouteInfo, RouteNode, RouteTree, RouteObject, RouteMetadata, RouteData, RouteDataResolver, PlayRouteEvent, Routable, RoutableActor, RouterBridge, MountableRouterBridge, WindowLike, LocationLike, } from "./types.js";
|
|
13
13
|
export { RouteMap, type RouteMapping } from "./base-route-map.js";
|
|
14
14
|
export { createRouteMapFromTree } from "./create-route-map-from-tree.js";
|
|
15
15
|
export { findRouteById, findRouteByPath } from "./find-route.js";
|
|
16
|
-
export { DISPOSE } from "@xmachines/play";
|
|
17
16
|
export { buildRouteTree, ROOT_NODE_ID } from "./build-tree.js";
|
|
18
17
|
export type { RouteMapOptions } from "./types.js";
|
|
19
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAGvF,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACzF,YAAY,EAAE,UAAU,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAG/E,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAM9D,OAAO,EACN,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,YAAY,EACZ,YAAY,GACZ,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG7E,OAAO,EACN,oBAAoB,EACpB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAGvF,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACzF,YAAY,EAAE,UAAU,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAG/E,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,iBAAiB,EAAE,M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
|
|
11
11
|
export { normalizeBasePath, resolveBasePath, stripBasePath, joinBasePath, NO_BASE_PATH, } from "@xmachines/play-url";
|
|
12
12
|
// The params of a framework router, reconciled with the pattern of the machine. A
|
|
13
13
|
// bridge whose framework parses the params itself calls this, and it keeps that parse.
|
|
14
|
-
export { cleanFrameworkParams,
|
|
14
|
+
export { cleanFrameworkParams, createLruCache, parsePattern, pickOwnParams, resolveFrameworkParams, sanitizePathname, splitLocation, } from "@xmachines/play-url";
|
|
15
15
|
// The framework-free half of a PlayRouterProvider: the props, the constructor shape,
|
|
16
16
|
// and the lifecycle of the bridge. A provider of a framework adds its own effects and
|
|
17
17
|
// nothing else. This entry stays framework-agnostic — nothing here imports one.
|
|
@@ -22,11 +22,6 @@ export { RouteMap } from "./base-route-map.js";
|
|
|
22
22
|
export { createRouteMapFromTree } from "./create-route-map-from-tree.js";
|
|
23
23
|
// The helpers of a route lookup. matchesPattern stays private inside find-route.ts
|
|
24
24
|
export { findRouteById, findRouteByPath } from "./find-route.js";
|
|
25
|
-
// The release protocol of @xmachines/play. This package's own published `.d.ts` names
|
|
26
|
-
// exactly these, so a consumer reads them from here and needs no second manifest
|
|
27
|
-
// entry. It names `asCleanup` nowhere: a consumer of this package RECEIVES a
|
|
28
|
-
// release, and builds one only with @xmachines/play itself.
|
|
29
|
-
export { DISPOSE } from "@xmachines/play";
|
|
30
25
|
// The tree builder and its options. `@xmachines/play-router/xstate` reads both: it walks
|
|
31
26
|
// a machine, and it hands the routes here to become a tree and then a route map.
|
|
32
27
|
export { buildRouteTree, ROOT_NODE_ID } from "./build-tree.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,wHAAwH;AACxH,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,kBAAk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,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,mFAAmF;AACnF,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEjE,yFAAyF;AACzF,iFAAiF;AACjF,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { type BasePathOptions, type CompileOptions } from "@xmachines/play-url";
|
|
21
21
|
import type { RouterBridgeOptions } from "./router-bridge-base.js";
|
|
22
|
-
import { DISPOSE } from "@xmachines/play";
|
|
23
22
|
import type { MountableRouterBridge, RoutableActor, RouterBridge } from "./types.js";
|
|
24
23
|
import type { RouteMap } from "./base-route-map.js";
|
|
25
24
|
/**
|
|
@@ -174,25 +173,20 @@ export declare function repointProviderBridge(bridge: RouterBridge | null | unde
|
|
|
174
173
|
export interface RouterConnection {
|
|
175
174
|
/** Stops the synchronization. The same call as {@link RouterConnection.disconnect}. */
|
|
176
175
|
(): void;
|
|
177
|
-
/** Stops the synchronization. */
|
|
178
|
-
disconnect(): void;
|
|
179
176
|
/**
|
|
180
|
-
* Stops the synchronization
|
|
177
|
+
* Stops the synchronization. It is idempotent.
|
|
181
178
|
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
* ecosystem:
|
|
179
|
+
* A scope can own the connection: the connection is its own release, so
|
|
180
|
+
* `asDisposable` of `@xmachines/core/utils` publishes it with no second argument.
|
|
185
181
|
*
|
|
186
182
|
* ```ts
|
|
187
183
|
* {
|
|
188
|
-
* using connection = connectRouter({ actor, router, routeMap });
|
|
184
|
+
* using connection = asDisposable(connectRouter({ actor, router, routeMap }));
|
|
189
185
|
* // disconnect() runs at the end of the scope, and after an exception too
|
|
190
186
|
* }
|
|
191
187
|
* ```
|
|
192
|
-
*
|
|
193
|
-
* The release is {@link RouterConnection.disconnect}, which is idempotent.
|
|
194
188
|
*/
|
|
195
|
-
|
|
189
|
+
disconnect(): void;
|
|
196
190
|
/** The resolved prefix of the mount, or `""` when the machine owns the whole router. */
|
|
197
191
|
readonly basePath: string;
|
|
198
192
|
/** The values of the `:param` segments of the mount. They travel in no event. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-lifecycle.d.ts","sourceRoot":"","sources":["../src/provider-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAqB,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACnG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"provider-lifecycle.d.ts","sourceRoot":"","sources":["../src/provider-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAqB,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACnG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;;;GASG;AACH,MAAM,WAAW,2BAA2B,CAC3C,OAAO,EACP,MAAM,SAAS,aAAa,EAC5B,KAAK,CACJ,SAAQ,cAAc;IACvB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,uGAAuG;IACvG,MAAM,EAAE,OAAO,CAAC;IAChB;;;;;;;;;;;OAWG;IACH,QAAQ,EAAE,QAAQ,CAAC;IACnB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,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AI,GAAG,SAAS,EACvC,QAAQ,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,EACtC,cAAc,CAAC,EAAE,eAAe,CAAC,gBAAgB,CAAC,GAChD,IAAI,CAEN;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,gBAAgB;IAChC,uFAAuF;IACvF,IAAI,IAAI,CAAC;IACT;;;;;;;;;;;;OAYG;IACH,UAAU,IAAI,IAAI,CAAC;IACnB,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1D,4DAA4D;IAC5D,WAAW,CACV,QAAQ,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,EACtC,cAAc,CAAC,EAAE,eAAe,CAAC,gBAAgB,CAAC,GAChD,IAAI,CAAC;CACR;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,qBAAqB,GAAG,gBAAgB,CAiBtF"}
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
* @see [Multi-router integration](../../docs/examples/multi-router-integration.md)
|
|
19
19
|
*/
|
|
20
20
|
import { normalizeBasePath } from "@xmachines/play-url";
|
|
21
|
-
import { asCleanup, DISPOSE } from "@xmachines/play";
|
|
22
21
|
/**
|
|
23
22
|
* Tells you whether a bridge can move its mount.
|
|
24
23
|
*
|
|
@@ -146,20 +145,7 @@ export function createRouterConnection(bridge) {
|
|
|
146
145
|
const disconnect = () => {
|
|
147
146
|
bridge.disconnect();
|
|
148
147
|
};
|
|
149
|
-
|
|
150
|
-
// connection. It is the ONE place that knows how for a release that is a FUNCTION: it
|
|
151
|
-
// writes `DISPOSE` and, where a polyfill of Explicit Resource Management installed the
|
|
152
|
-
// well-known symbol after this module evaluated, `Symbol.dispose` beside it, and it
|
|
153
|
-
// gives both keys a descriptor that a test double, a wrapper, and a later `asCleanup`
|
|
154
|
-
// can still redefine. A second copy of that rule here would be a second chance to
|
|
155
|
-
// disagree with it.
|
|
156
|
-
//
|
|
157
|
-
// An object LITERAL writes the key itself — `createRouter` and `createBrowserHistory`
|
|
158
|
-
// of play-dom-router each do. `asCleanup` takes a callable, and those two values are
|
|
159
|
-
// no callables, so the note of `packages/play/src/disposable.ts` covers them instead:
|
|
160
|
-
// a literal carries the key that existed when it was defined, so a polyfill belongs
|
|
161
|
-
// before the first import of `@xmachines/play`.
|
|
162
|
-
return Object.defineProperties(asCleanup(disconnect), {
|
|
148
|
+
return Object.defineProperties(disconnect, {
|
|
163
149
|
disconnect: { value: disconnect, enumerable: true },
|
|
164
150
|
basePath: { get: () => bridge.basePath, enumerable: true },
|
|
165
151
|
basePathParams: { get: () => bridge.basePathParams, enumerable: true },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-lifecycle.js","sourceRoot":"","sources":["../src/provider-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,iBAAiB,EAA6C,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"provider-lifecycle.js","sourceRoot":"","sources":["../src/provider-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,iBAAiB,EAA6C,MAAM,qBAAqB,CAAC;AA4GnG;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAChC,MAAuC;IAEvC,oFAAoF;IACpF,uFAAuF;IACvF,sCAAsC;IACtC,OAAO,MAAM,IAAI,IAAI,IAAI,OAAQ,MAAgC,CAAC,WAAW,KAAK,UAAU,CAAC;AAC9F,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ,CACvB,QAAsC,EACtC,cAAkD;IAElD,sFAAsF;IACtF,mFAAmF;IACnF,qFAAqF;IACrF,gEAAgE;IAChE,EAAE;IACF,qFAAqF;I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E;YACZ,KAAK,EAAE,CACN,QAAsC,EACtC,cAAkD,EACjD,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,cAAc,CAAC;YACjD,UAAU,EAAE,IAAI;SAChB;KACD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -487,7 +487,7 @@ export declare abstract class RouterBridgeBase implements MountableRouterBridge
|
|
|
487
487
|
/**
|
|
488
488
|
* Reads the path parameters of a URL, with the URLPattern API.
|
|
489
489
|
*
|
|
490
|
-
* The API is always present: `@xmachines/play-
|
|
490
|
+
* The API is always present: `@xmachines/play-url` uses the native URLPattern of the
|
|
491
491
|
* runtime, and it falls back to `urlpattern-polyfill`, which it carries as an ordinary
|
|
492
492
|
* dependency. A consumer therefore loads nothing, whatever the runtime.
|
|
493
493
|
*
|
|
@@ -1176,7 +1176,7 @@ export class RouterBridgeBase {
|
|
|
1176
1176
|
/**
|
|
1177
1177
|
* Reads the path parameters of a URL, with the URLPattern API.
|
|
1178
1178
|
*
|
|
1179
|
-
* The API is always present: `@xmachines/play-
|
|
1179
|
+
* The API is always present: `@xmachines/play-url` uses the native URLPattern of the
|
|
1180
1180
|
* runtime, and it falls back to `urlpattern-polyfill`, which it carries as an ordinary
|
|
1181
1181
|
* dependency. A consumer therefore loads nothing, whatever the runtime.
|
|
1182
1182
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-sync.d.ts","sourceRoot":"","sources":["../src/router-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,cAAc,EAEnB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"router-sync.d.ts","sourceRoot":"","sources":["../src/router-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,cAAc,EAEnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,WAAW,UAAU;IAC1B,EAAE,EAAE,MAAM,GAA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Pattern, parsePattern, sanitizePathname, } from "@xmachines/play-url";
|
|
2
|
+
import { createNullRecord } from "@xmachines/core/utils";
|
|
2
3
|
/**
|
|
3
4
|
* Matches a clean pathname against a route map, and reads each param of the match.
|
|
4
5
|
*
|
|
@@ -71,7 +72,7 @@ export function extractRouteParams(pathname, pattern, options) {
|
|
|
71
72
|
// drops the value in silence. A machine that declares `/:__proto__` then received `{}`
|
|
72
73
|
// from this extraction while the parse of Vue Router or SolidJS Router carried the
|
|
73
74
|
// value, so the two sources of the same params disagreed.
|
|
74
|
-
const params =
|
|
75
|
+
const params = createNullRecord();
|
|
75
76
|
for (const [key, value] of Object.entries(match.pathname.groups)) {
|
|
76
77
|
if (value !== undefined) {
|
|
77
78
|
params[nameMap.get(key) ?? key] = decodeParamValue(value); // nosemgrep: gitlab.eslint.detect-object-injection
|
|
@@ -107,7 +108,7 @@ export function extractQuery(search) {
|
|
|
107
108
|
// the value in silence — so a location of `?__proto__=nav` reached the machine with
|
|
108
109
|
// an EMPTY query, while the same name in the path reached it as a param. The two
|
|
109
110
|
// halves of one `play.route` event answered one name differently.
|
|
110
|
-
const params =
|
|
111
|
+
const params = createNullRecord();
|
|
111
112
|
new URLSearchParams(search).forEach((value, key) => {
|
|
112
113
|
params[key] = value; // nosemgrep: gitlab.eslint.detect-object-injection
|
|
113
114
|
});
|
package/dist/router-sync.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-sync.js","sourceRoot":"","sources":["../src/router-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,GAGhB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"router-sync.js","sourceRoot":"","sources":["../src/router-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,GAGhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB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C,IAAI,CAAC,KAAK,CAAC,EAAE;QAAE,OAAO,IAAI,CAAC;IAE3B,iFAAiF;IACjF,6EAA6E;IAC7E,8EAA8E;IAC9E,8EAA8E;IAC9E,MAAM;IACN,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,EAAE,EAAE,CAAC;IAChE,OAAO;QACN,QAAQ;QACR,KAAK,EAAE;YACN,IAAI,EAAE,YAAY;YAClB,EAAE;YACF,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,EAAE;YAC1B,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC;SACzC;KACD,CAAC;AACH,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BasePathOptions, CompileOptions,
|
|
1
|
+
import type { BasePathOptions, CompileOptions, KeyValueCache } from "@xmachines/play-url";
|
|
2
2
|
import type { ReadonlyAtom } from "@xmachines/play-atom";
|
|
3
3
|
/**
|
|
4
4
|
* The type definitions of the routing protocol of @xmachines/play-router
|
|
@@ -45,18 +45,21 @@ export interface RouteObject {
|
|
|
45
45
|
* two siblings therefore still runs the `entry` action of their shared parent.
|
|
46
46
|
*
|
|
47
47
|
* {@link RouteObject.handler} is the field that spares those intermediate ancestors:
|
|
48
|
-
* `"local"` and `"both"` move the domain down to the parent of the state
|
|
49
|
-
* two fields together where an `entry` action must run one
|
|
50
|
-
* the actor really enters.
|
|
48
|
+
* `"local"` and `"both"` move the domain down to the parent of the state, while the
|
|
49
|
+
* parent is active. Use the two fields together where an `entry` action must run one
|
|
50
|
+
* time for each state that the actor really enters. The target itself re-enters
|
|
51
|
+
* under both settings, so a route to the state that the actor already holds runs the
|
|
52
|
+
* `exit` and `entry` actions of that state again. The ROOT of the machine is the one
|
|
53
|
+
* exception: a route to the root has the root as its domain, so the flag decides.
|
|
51
54
|
*
|
|
52
55
|
* Set the field to `true` where the domain must run its `entry` actions again on
|
|
53
|
-
*
|
|
56
|
+
* each route to this state. The flag of a state applies to the routes to that state
|
|
57
|
+
* alone, and not to the routes to its descendants.
|
|
54
58
|
*
|
|
55
59
|
* The flag does not decide the destination. The value of the machine after a route
|
|
56
60
|
* is identical under both settings. A route to a state that has children still
|
|
57
|
-
* enters the `initial` child of that state, because the
|
|
58
|
-
*
|
|
59
|
-
* both settings.
|
|
61
|
+
* enters the `initial` child of that state, because XState enters the initial child
|
|
62
|
+
* of a compound target under both settings.
|
|
60
63
|
*
|
|
61
64
|
* @see [Play RFC](../../docs/rfc/play.md)
|
|
62
65
|
*/
|
|
@@ -73,8 +76,8 @@ export interface RouteObject {
|
|
|
73
76
|
*
|
|
74
77
|
* `"local"` installs the transition on the PARENT of this state instead, and it
|
|
75
78
|
* targets this state relatively. XState offers the transitions of the deepest active
|
|
76
|
-
* state node first, so the parent answers the event itself
|
|
77
|
-
* its `entry` actions
|
|
79
|
+
* state node first, so the parent answers the event itself. The parent then runs its
|
|
80
|
+
* `exit` and its `entry` actions again only where the state declares `reenter: true`.
|
|
78
81
|
*
|
|
79
82
|
* `"both"` installs one transition in each place. The local one answers while the
|
|
80
83
|
* parent is active, and the root one answers a route that arrives from outside the
|
|
@@ -132,14 +135,11 @@ export interface RouteObject {
|
|
|
132
135
|
* The additional metadata of the route: a title, a breadcrumb, and so on.
|
|
133
136
|
*
|
|
134
137
|
* CAUTION: `path`, `handler`, `reenter` and `data` are RESERVED. The routing layer
|
|
135
|
-
* reads those four names
|
|
136
|
-
*
|
|
137
|
-
* `
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
* generated transition, and the literal `true` alone turns the reentry on: the
|
|
141
|
-
* default is `false`, and a release before this one generated every transition with
|
|
142
|
-
* `reenter: true`. Give such a field another name.
|
|
138
|
+
* reads those four names. An unknown `handler` value throws an
|
|
139
|
+
* `InvalidRouteHandlerError` from `formatPlayRouteTransitions`, so the machine builds
|
|
140
|
+
* never. A `data` value goes to `context.data`, where the `/context` projection of
|
|
141
|
+
* every view reads it. A `reenter` value is the FLAG of the generated transition, and
|
|
142
|
+
* the literal `true` alone turns the reentry on. Give a field of your own another name.
|
|
143
143
|
*/
|
|
144
144
|
[key: string]: unknown;
|
|
145
145
|
}
|
|
@@ -402,10 +402,10 @@ export interface RoutableActor extends Routable {
|
|
|
402
402
|
* The implementation of a framework router bridge
|
|
403
403
|
* ```typescript
|
|
404
404
|
* import type { RouterBridge } from "@xmachines/play-router";
|
|
405
|
-
* import { watchAtom
|
|
405
|
+
* import { watchAtom } from "@xmachines/play-atom";
|
|
406
406
|
*
|
|
407
407
|
* class MyRouterBridge implements RouterBridge {
|
|
408
|
-
* private stop:
|
|
408
|
+
* private stop: (() => void) | null = null;
|
|
409
409
|
*
|
|
410
410
|
* async connect(): Promise<void> {
|
|
411
411
|
* // Start the observation of the actor.currentRoute atom
|
|
@@ -550,10 +550,10 @@ export interface RouteMapOptions extends CompileOptions {
|
|
|
550
550
|
* The cache of the state that a VISITED PATH resolves to, or `null` for a path that
|
|
551
551
|
* resolves to none.
|
|
552
552
|
*
|
|
553
|
-
* The default is a cache of this map alone
|
|
554
|
-
* Pass one to raise that bound, to share the resolution across maps,
|
|
555
|
-
* eviction policy of your own: `
|
|
556
|
-
* object with a `get` and a `set`.
|
|
553
|
+
* The default is a cache of this map alone. It keeps two generations, and it holds 1001
|
|
554
|
+
* entries at most. Pass one to raise that bound, to share the resolution across maps,
|
|
555
|
+
* or to give it an eviction policy of your own: `createLruCache(5000)` builds one, and
|
|
556
|
+
* so does any object with a `get` and a `set`.
|
|
557
557
|
*
|
|
558
558
|
* A cache that a caller passes is keyed by the ROUTE TABLE. Two maps built from the
|
|
559
559
|
* same mappings, in the same order, therefore read each other's answers — which is
|
|
@@ -564,6 +564,6 @@ export interface RouteMapOptions extends CompileOptions {
|
|
|
564
564
|
* The keys are the paths that a visitor reaches, so the key space is unbounded: a
|
|
565
565
|
* cache with no bound of its own grows for the life of the process.
|
|
566
566
|
*/
|
|
567
|
-
pathCache?:
|
|
567
|
+
pathCache?: KeyValueCache<string | null>;
|
|
568
568
|
}
|
|
569
569
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC1F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,cAAc,CAAA;CAAE,KAAK,SAAS,CAAC;AAEjG;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,iBAAiB,CAAC;IACrC;;;;;;;;;OASG;IACH,CAAC,GAAG,EAAE,MAAM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AAQ,EAAE,MAAM,CAAC;IAC1B;;;;;;;;OAQG;IACH,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1D;;;;;;OAMG;IACH,WAAW,CACV,QAAQ,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,EACtC,cAAc,CAAC,EAAE,eAAe,CAAC,gBAAgB,CAAC,GAChD,IAAI,CAAC;CACR;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,UAAU;IAC1B,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI,CAAC;IACvE,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI,CAAC;CAC1E;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACtD;;;;;;;;;;;;;;;;;OAiBG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACzC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmachines/play-router",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "Route maps, the router bridge base and the Routable capability of @xmachines/play. It names no state machine; the machine half is the ./xstate subpath.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"routing",
|
|
@@ -53,16 +53,17 @@
|
|
|
53
53
|
"test:coverage": "vitest run --coverage"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@xmachines/play-url": "
|
|
56
|
+
"@xmachines/play-url": "6.1.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@statelyai/graph": "^2.4.0",
|
|
60
60
|
"@testing-library/jest-dom": "^7.0.1",
|
|
61
61
|
"@types/node": "^26.6.2",
|
|
62
62
|
"@vitest/browser-playwright": "^5.0.1",
|
|
63
|
-
"@xmachines/
|
|
64
|
-
"@xmachines/play
|
|
65
|
-
"@xmachines/play-
|
|
63
|
+
"@xmachines/core": "6.1.0",
|
|
64
|
+
"@xmachines/play": "6.1.0",
|
|
65
|
+
"@xmachines/play-atom": "6.1.0",
|
|
66
|
+
"@xmachines/play-view": "6.1.0",
|
|
66
67
|
"oxfmt": "^0.70.0",
|
|
67
68
|
"oxlint": "^1.85.0",
|
|
68
69
|
"typescript": "^5.9.3 || ^6.0.3",
|
|
@@ -72,8 +73,9 @@
|
|
|
72
73
|
},
|
|
73
74
|
"peerDependencies": {
|
|
74
75
|
"@statelyai/graph": "^2.4.0",
|
|
75
|
-
"@xmachines/
|
|
76
|
-
"@xmachines/play
|
|
76
|
+
"@xmachines/core": "6.1.0",
|
|
77
|
+
"@xmachines/play": "6.1.0",
|
|
78
|
+
"@xmachines/play-atom": "6.1.0",
|
|
77
79
|
"xstate": "^5.33.0"
|
|
78
80
|
},
|
|
79
81
|
"peerDependenciesMeta": {
|