@tanstack/router-core 1.154.14 → 1.155.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/dist/cjs/new-process-route-tree.cjs +47 -42
- package/dist/cjs/new-process-route-tree.cjs.map +1 -1
- package/dist/cjs/path.cjs +18 -14
- package/dist/cjs/path.cjs.map +1 -1
- package/dist/cjs/path.d.cts +11 -2
- package/dist/cjs/router.cjs +6 -8
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/router.d.cts +1 -1
- package/dist/esm/new-process-route-tree.js +47 -42
- package/dist/esm/new-process-route-tree.js.map +1 -1
- package/dist/esm/path.d.ts +11 -2
- package/dist/esm/path.js +18 -14
- package/dist/esm/path.js.map +1 -1
- package/dist/esm/router.d.ts +1 -1
- package/dist/esm/router.js +7 -9
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/new-process-route-tree.ts +66 -46
- package/src/path.ts +36 -16
- package/src/router.ts +8 -11
package/dist/esm/router.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Store, batch } from "@tanstack/store";
|
|
|
2
2
|
import { createBrowserHistory, parseHref } from "@tanstack/history";
|
|
3
3
|
import { createControlledPromise, isDangerousProtocol, deepEqual, replaceEqualDeep, decodePath, functionalUpdate, last, findLast } from "./utils.js";
|
|
4
4
|
import { processRouteTree, processRouteMasks, findSingleMatch, findRouteMatch, findFlatMatch } from "./new-process-route-tree.js";
|
|
5
|
-
import { trimPath, resolvePath, cleanPath, trimPathRight, interpolatePath } from "./path.js";
|
|
5
|
+
import { compileDecodeCharMap, trimPath, resolvePath, cleanPath, trimPathRight, interpolatePath } from "./path.js";
|
|
6
6
|
import { createLRUCache } from "./lru-cache.js";
|
|
7
7
|
import { isNotFound } from "./not-found.js";
|
|
8
8
|
import { setupScrollRestoration } from "./scroll-restoration.js";
|
|
@@ -69,12 +69,10 @@ class RouterCore {
|
|
|
69
69
|
...newOptions
|
|
70
70
|
};
|
|
71
71
|
this.isServer = this.options.isServer ?? typeof document === "undefined";
|
|
72
|
-
|
|
73
|
-
this.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
])
|
|
77
|
-
) : void 0;
|
|
72
|
+
if (this.options.pathParamsAllowedCharacters)
|
|
73
|
+
this.pathParamsDecoder = compileDecodeCharMap(
|
|
74
|
+
this.options.pathParamsAllowedCharacters
|
|
75
|
+
);
|
|
78
76
|
if (!this.history || this.options.history && this.options.history !== this.history) {
|
|
79
77
|
if (!this.options.history) {
|
|
80
78
|
if (!this.isServer) {
|
|
@@ -344,7 +342,7 @@ class RouterCore {
|
|
|
344
342
|
interpolatePath({
|
|
345
343
|
path: nextTo,
|
|
346
344
|
params: nextParams,
|
|
347
|
-
|
|
345
|
+
decoder: this.pathParamsDecoder
|
|
348
346
|
}).interpolatedPath
|
|
349
347
|
);
|
|
350
348
|
let nextSearch = fromSearch;
|
|
@@ -1097,7 +1095,7 @@ class RouterCore {
|
|
|
1097
1095
|
const { interpolatedPath, usedParams } = interpolatePath({
|
|
1098
1096
|
path: route.fullPath,
|
|
1099
1097
|
params: routeParams,
|
|
1100
|
-
|
|
1098
|
+
decoder: this.pathParamsDecoder
|
|
1101
1099
|
});
|
|
1102
1100
|
const matchId = (
|
|
1103
1101
|
// route.id for disambiguation
|