@xmachines/play-tanstack-react-router 1.0.0-beta.8 → 1.0.0-beta.9

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 CHANGED
@@ -29,25 +29,15 @@ npm install @xmachines/play-tanstack-react-router @xmachines/play-router @xmachi
29
29
 
30
30
  Peer dependencies:
31
31
 
32
- - `@tanstack/react-router` `^1.0.0`
32
+ - `@tanstack/react-router` `^1.166.7`
33
33
  - `react` `^18 || ^19`
34
+ - `xstate` `^5.0.0`
34
35
 
35
- ## Browser Support
36
+ ## URLPattern Support
36
37
 
37
- This package uses the [URLPattern API](https://developer.mozilla.org/en-US/docs/Web/API/URLPattern) for route pattern matching.
38
+ This package uses the [URLPattern API](https://developer.mozilla.org/en-US/docs/Web/API/URLPattern) for route pattern matching via `@xmachines/play-router`.
38
39
 
39
- Native support includes current Chrome, Firefox, and Safari 17.4+.
40
- For Node.js test environments or older browsers, install `urlpattern-polyfill`.
41
-
42
- ```bash
43
- npm install urlpattern-polyfill
44
- ```
45
-
46
- ```ts
47
- if (!globalThis.URLPattern) {
48
- await import("urlpattern-polyfill");
49
- }
50
- ```
40
+ URLPattern is available natively on Node.js 24+ and modern browsers (Chrome 95+, Firefox 117+, Safari 16.4+). On older environments, load a polyfill **before** importing this package — see [`@xmachines/play-router` installation](../play-router/README.md#installation) for details.
51
41
 
52
42
  ## Quick Start
53
43
 
@@ -112,16 +102,35 @@ class TanStackReactRouterBridge implements RouterBridge {
112
102
 
113
103
  ### `RouteMap` and `createRouteMapFromTree`
114
104
 
115
- Map state IDs to URL paths and resolve URLs back to state IDs:
105
+ Map state IDs to URL paths and resolve URLs back to state IDs.
106
+
107
+ `RouteMap` extends `BaseRouteMap` from `@xmachines/play-router`, inheriting bucket-indexed
108
+ bidirectional route matching. No routing logic lives in the adapter itself.
116
109
 
117
110
  ```ts
118
- class RouteMap {
119
- constructor(routes: Array<{ stateId: string; path: string }>);
120
- getStateIdByPath(path: string): string | undefined;
121
- getPathByStateId(stateId: string): string | undefined;
122
- }
111
+ // RouteMap is a thin subclass of BaseRouteMap — no extra methods
112
+ class RouteMap extends BaseRouteMap {}
123
113
 
124
- function createRouteMapFromTree(routeTree: RouteTree): RouteMap;
114
+ // Inherited API:
115
+ routeMap.getStateIdByPath(path: string): string | null
116
+ routeMap.getPathByStateId(stateId: string): string | null
117
+
118
+ // Factory from a machine route tree:
119
+ function createRouteMapFromTree(routeTree: RouteTree): RouteMap
120
+ ```
121
+
122
+ `getStateIdByPath` returns `null` (not `undefined`) for unmatched paths.
123
+
124
+ ```ts
125
+ const routeMap = new RouteMap([
126
+ { stateId: "home", path: "/" },
127
+ { stateId: "profile", path: "/profile/:userId" },
128
+ { stateId: "settings", path: "/settings/:section?" },
129
+ ]);
130
+
131
+ routeMap.getStateIdByPath("/profile/123"); // "profile"
132
+ routeMap.getPathByStateId("home"); // "/"
133
+ routeMap.getStateIdByPath("/unknown"); // null
125
134
  ```
126
135
 
127
136
  ### `PlayRouterProvider`
@@ -10,78 +10,45 @@
10
10
  * @packageDocumentation
11
11
  */
12
12
  import type { RouteTree } from "@xmachines/play-router";
13
+ import { BaseRouteMap } from "@xmachines/play-router";
13
14
  /**
14
- * Mapping between state machine state ID and router path
15
+ * Mapping between state machine state ID and router path.
16
+ *
17
+ * Structurally compatible with `BaseRouteMapping` from `@xmachines/play-router`.
18
+ * Fields are `readonly` — entries are immutable once passed to `RouteMap`.
15
19
  */
16
20
  export interface RouteMapping {
17
- /** State ID from state machine (e.g., "settings.profile") */
18
- stateId: string;
19
- /** Router path with optional parameters (e.g., "/settings/:section?") */
20
- path: string;
21
+ /** State ID from state machine (e.g., `"home"`, `"settings.profile"`) */
22
+ readonly stateId: string;
23
+ /** Router path with optional parameters (e.g., `"/settings/:section?"`) */
24
+ readonly path: string;
21
25
  }
22
26
  /**
23
- * Bidirectional route mapper with pattern matching support
27
+ * Bidirectional route mapper for TanStack React Router.
28
+ *
29
+ * Extends {@link BaseRouteMap} — all matching logic lives there.
30
+ * This class exists to provide a TanStack React Router-specific type name and to
31
+ * allow future adapter-specific extensions without breaking the shared base.
24
32
  *
25
- * Maps between state IDs (XMachines actor) and paths (router).
26
- * Handles both exact matches (static paths) and pattern matches (parameterized paths).
33
+ * **Inherited API:**
34
+ * - `getStateIdByPath(path): string | null` path state ID
35
+ * - `getPathByStateId(stateId): string | null` — state ID → path pattern
36
+ *
37
+ * @extends BaseRouteMap
27
38
  *
28
39
  * @example
29
40
  * ```typescript
30
- * const routes: RouteMapping[] = [
31
- * { stateId: "home", path: "/" },
32
- * { stateId: "profile", path: "/profile/:userId" },
33
- * { stateId: "settings", path: "/settings/:section?" }
34
- * ];
35
- *
36
- * const routeMap = new RouteMap(routes);
41
+ * const routeMap = new RouteMap([
42
+ * { stateId: "home", path: "/" },
43
+ * { stateId: "profile", path: "/profile/:userId" },
44
+ * { stateId: "settings", path: "/settings/:section?" },
45
+ * ]);
37
46
  *
38
47
  * routeMap.getStateIdByPath("/profile/123"); // "profile"
39
- * routeMap.getPathByStateId("home"); // "/"
48
+ * routeMap.getPathByStateId("home"); // "/"
40
49
  * ```
41
50
  */
42
- export declare class RouteMap {
43
- private stateIdToPath;
44
- private pathToStateId;
45
- private patternBuckets;
46
- private pathMatchCache;
47
- /**
48
- * Create RouteMap from route mappings
49
- *
50
- * @param routes - Array of state ID → path mappings
51
- */
52
- constructor(routes: RouteMapping[]);
53
- /**
54
- * Get state ID from router path
55
- *
56
- * Tries exact match first, then pattern match for parameterized paths.
57
- *
58
- * @param path - Router path (e.g., "/profile/123")
59
- * @returns State ID or null if no match
60
- *
61
- * @example
62
- * ```typescript
63
- * routeMap.getStateIdByPath("/"); // "home" (exact match)
64
- * routeMap.getStateIdByPath("/profile/123"); // "profile" (pattern match)
65
- * ```
66
- */
67
- getStateIdByPath(path: string): string | null;
68
- private getIndexKey;
69
- private getCandidates;
70
- /**
71
- * Get router path from state ID
72
- *
73
- * Returns the route pattern with parameter placeholders (not substituted).
74
- *
75
- * @param stateId - State machine state ID
76
- * @returns Router path or null if no match
77
- *
78
- * @example
79
- * ```typescript
80
- * routeMap.getPathByStateId("home"); // "/"
81
- * routeMap.getPathByStateId("profile"); // "/profile/:userId"
82
- * ```
83
- */
84
- getPathByStateId(stateId: string): string | null;
51
+ export declare class RouteMap extends BaseRouteMap {
85
52
  }
86
53
  /**
87
54
  * Create RouteMap from RouteTree
@@ -1 +1 @@
1
- {"version":3,"file":"route-map.d.ts","sourceRoot":"","sources":["../src/route-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,wBAAwB,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,QAAQ;IACpB,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,cAAc,CAA0E;IAChG,OAAO,CAAC,cAAc,CAA6B;IAEnD;;;;OAIG;gBACS,MAAM,EAAE,YAAY,EAAE;IA+BlC;;;;;;;;;;;;;OAaG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAwB7C,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,aAAa;IAyCrB;;;;;;;;;;;;;OAaG;IACH,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAGhD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,SAAS,GAAG,QAAQ,CAcrE"}
1
+ {"version":3,"file":"route-map.d.ts","sourceRoot":"","sources":["../src/route-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC5B,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,2EAA2E;IAC3E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,QAAS,SAAQ,YAAY;CAAG;AAE7C;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,SAAS,GAAG,QAAQ,CAcrE"}
package/dist/route-map.js CHANGED
@@ -9,160 +9,33 @@
9
9
  *
10
10
  * @packageDocumentation
11
11
  */
12
+ import { BaseRouteMap } from "@xmachines/play-router";
12
13
  /**
13
- * Bidirectional route mapper with pattern matching support
14
+ * Bidirectional route mapper for TanStack React Router.
14
15
  *
15
- * Maps between state IDs (XMachines actor) and paths (router).
16
- * Handles both exact matches (static paths) and pattern matches (parameterized paths).
16
+ * Extends {@link BaseRouteMap} all matching logic lives there.
17
+ * This class exists to provide a TanStack React Router-specific type name and to
18
+ * allow future adapter-specific extensions without breaking the shared base.
19
+ *
20
+ * **Inherited API:**
21
+ * - `getStateIdByPath(path): string | null` — path → state ID
22
+ * - `getPathByStateId(stateId): string | null` — state ID → path pattern
23
+ *
24
+ * @extends BaseRouteMap
17
25
  *
18
26
  * @example
19
27
  * ```typescript
20
- * const routes: RouteMapping[] = [
21
- * { stateId: "home", path: "/" },
22
- * { stateId: "profile", path: "/profile/:userId" },
23
- * { stateId: "settings", path: "/settings/:section?" }
24
- * ];
25
- *
26
- * const routeMap = new RouteMap(routes);
28
+ * const routeMap = new RouteMap([
29
+ * { stateId: "home", path: "/" },
30
+ * { stateId: "profile", path: "/profile/:userId" },
31
+ * { stateId: "settings", path: "/settings/:section?" },
32
+ * ]);
27
33
  *
28
34
  * routeMap.getStateIdByPath("/profile/123"); // "profile"
29
- * routeMap.getPathByStateId("home"); // "/"
35
+ * routeMap.getPathByStateId("home"); // "/"
30
36
  * ```
31
37
  */
32
- export class RouteMap {
33
- stateIdToPath;
34
- pathToStateId;
35
- patternBuckets;
36
- pathMatchCache;
37
- /**
38
- * Create RouteMap from route mappings
39
- *
40
- * @param routes - Array of state ID → path mappings
41
- */
42
- constructor(routes) {
43
- this.stateIdToPath = new Map();
44
- this.pathToStateId = new Map();
45
- this.patternBuckets = new Map();
46
- this.pathMatchCache = new Map();
47
- let patternOrder = 0;
48
- for (const { stateId, path } of routes) {
49
- this.stateIdToPath.set(stateId, path);
50
- // Check if path has parameters
51
- if (path.includes(":")) {
52
- // Convert :param and :param? to regex
53
- const pattern = path
54
- .replace(/\/:[^/]+\?/g, "(?:/([^/]+))?") // Optional params with optional slash
55
- .replace(/:[^/]+/g, "([^/]+)"); // Required params
56
- const bucketKey = this.getIndexKey(path);
57
- const bucket = this.patternBuckets.get(bucketKey) ?? [];
58
- bucket.push({
59
- pattern: new RegExp(`^${pattern}$`),
60
- stateId,
61
- order: patternOrder++,
62
- });
63
- this.patternBuckets.set(bucketKey, bucket);
64
- }
65
- else {
66
- // Exact match for static paths
67
- this.pathToStateId.set(path, stateId);
68
- }
69
- }
70
- }
71
- /**
72
- * Get state ID from router path
73
- *
74
- * Tries exact match first, then pattern match for parameterized paths.
75
- *
76
- * @param path - Router path (e.g., "/profile/123")
77
- * @returns State ID or null if no match
78
- *
79
- * @example
80
- * ```typescript
81
- * routeMap.getStateIdByPath("/"); // "home" (exact match)
82
- * routeMap.getStateIdByPath("/profile/123"); // "profile" (pattern match)
83
- * ```
84
- */
85
- getStateIdByPath(path) {
86
- // Try exact match first
87
- const exactMatch = this.pathToStateId.get(path);
88
- if (exactMatch)
89
- return exactMatch;
90
- const cachedMatch = this.pathMatchCache.get(path);
91
- if (cachedMatch !== undefined) {
92
- return cachedMatch;
93
- }
94
- // Try pattern match
95
- const firstSegment = this.getIndexKey(path);
96
- const candidates = this.getCandidates(firstSegment);
97
- for (const { pattern, stateId } of candidates) {
98
- if (pattern.test(path)) {
99
- this.pathMatchCache.set(path, stateId);
100
- return stateId;
101
- }
102
- }
103
- this.pathMatchCache.set(path, null);
104
- return null;
105
- }
106
- getIndexKey(path) {
107
- const trimmed = path.startsWith("/") ? path.slice(1) : path;
108
- if (trimmed.length === 0) {
109
- return "/";
110
- }
111
- const segment = trimmed.split("/")[0];
112
- if (segment.startsWith(":")) {
113
- return "*";
114
- }
115
- return segment;
116
- }
117
- getCandidates(indexKey) {
118
- const bucket = this.patternBuckets.get(indexKey) ?? [];
119
- const wildcardBucket = this.patternBuckets.get("*") ?? [];
120
- if (bucket.length === 0) {
121
- return wildcardBucket;
122
- }
123
- if (wildcardBucket.length === 0) {
124
- return bucket;
125
- }
126
- const merged = [];
127
- let bucketIndex = 0;
128
- let wildcardIndex = 0;
129
- while (bucketIndex < bucket.length && wildcardIndex < wildcardBucket.length) {
130
- if (bucket[bucketIndex].order < wildcardBucket[wildcardIndex].order) {
131
- merged.push(bucket[bucketIndex]);
132
- bucketIndex += 1;
133
- }
134
- else {
135
- merged.push(wildcardBucket[wildcardIndex]);
136
- wildcardIndex += 1;
137
- }
138
- }
139
- while (bucketIndex < bucket.length) {
140
- merged.push(bucket[bucketIndex]);
141
- bucketIndex += 1;
142
- }
143
- while (wildcardIndex < wildcardBucket.length) {
144
- merged.push(wildcardBucket[wildcardIndex]);
145
- wildcardIndex += 1;
146
- }
147
- return merged;
148
- }
149
- /**
150
- * Get router path from state ID
151
- *
152
- * Returns the route pattern with parameter placeholders (not substituted).
153
- *
154
- * @param stateId - State machine state ID
155
- * @returns Router path or null if no match
156
- *
157
- * @example
158
- * ```typescript
159
- * routeMap.getPathByStateId("home"); // "/"
160
- * routeMap.getPathByStateId("profile"); // "/profile/:userId"
161
- * ```
162
- */
163
- getPathByStateId(stateId) {
164
- return this.stateIdToPath.get(stateId) || null;
165
- }
38
+ export class RouteMap extends BaseRouteMap {
166
39
  }
167
40
  /**
168
41
  * Create RouteMap from RouteTree
@@ -1 +1 @@
1
- {"version":3,"file":"route-map.js","sourceRoot":"","sources":["../src/route-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAcH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,QAAQ;IACZ,aAAa,CAAsB;IACnC,aAAa,CAAsB;IACnC,cAAc,CAA0E;IACxF,cAAc,CAA6B;IAEnD;;;;OAIG;IACH,YAAY,MAAsB;QACjC,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;QAChC,IAAI,CAAC,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;QAChC,IAAI,YAAY,GAAG,CAAC,CAAC;QAErB,KAAK,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,MAAM,EAAE,CAAC;YACxC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAEtC,+BAA+B;YAC/B,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBACxB,sCAAsC;gBACtC,MAAM,OAAO,GAAG,IAAI;qBAClB,OAAO,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC,sCAAsC;qBAC9E,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,kBAAkB;gBACnD,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBACzC,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;gBACxD,MAAM,CAAC,IAAI,CAAC;oBACX,OAAO,EAAE,IAAI,MAAM,CAAC,IAAI,OAAO,GAAG,CAAC;oBACn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AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAetD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,OAAO,QAAS,SAAQ,YAAY;CAAG;AAE7C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,sBAAsB,CAAC,SAAoB;IAC1D,MAAM,MAAM,GAAmB,EAAE,CAAC;IAElC,SAAS,QAAQ,CAAC,IAAe;QAChC,IAAI,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YAC1B,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACpD,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;IACF,CAAC;IAED,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACzB,OAAO,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC7B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmachines/play-tanstack-react-router",
3
- "version": "1.0.0-beta.8",
3
+ "version": "1.0.0-beta.9",
4
4
  "description": "TanStack React Router adapter for XMachines Play - synchronizes browser URL with actor state through passive infrastructure",
5
5
  "keywords": [
6
6
  "routing",
@@ -37,22 +37,22 @@
37
37
  "prepublishOnly": "npm run build"
38
38
  },
39
39
  "dependencies": {
40
- "@xmachines/play-actor": "1.0.0-beta.8",
41
- "@xmachines/play-router": "1.0.0-beta.8",
42
- "@xmachines/play-signals": "1.0.0-beta.8",
43
- "xstate": "^5.28.0"
40
+ "@xmachines/play-actor": "1.0.0-beta.9",
41
+ "@xmachines/play-router": "1.0.0-beta.9",
42
+ "@xmachines/play-signals": "1.0.0-beta.9",
43
+ "xstate": "^5.0.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@tanstack/react-router": "^1.167.5",
47
47
  "@types/node": "^25.5.0",
48
- "@xmachines/shared": "1.0.0-beta.8",
48
+ "@xmachines/shared": "1.0.0-beta.9",
49
49
  "typescript": "^5.9.3",
50
50
  "vitest": "^4.1.0"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@tanstack/react-router": "^1.166.7",
54
- "react": "^18.2.0 || ^19.0.0",
55
- "react-dom": "^18.2.0 || ^19.0.0",
56
- "xstate": "^5.28.0"
54
+ "react": "^18.0.0 || ^19.0.0",
55
+ "react-dom": "^18.0.0 || ^19.0.0",
56
+ "xstate": "^5.0.0"
57
57
  }
58
58
  }