@tanstack/router-core 1.134.18 → 1.135.2
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/Matches.cjs.map +1 -1
- package/dist/cjs/load-matches.cjs +18 -4
- package/dist/cjs/load-matches.cjs.map +1 -1
- package/dist/cjs/path.cjs +0 -13
- package/dist/cjs/path.cjs.map +1 -1
- package/dist/cjs/path.d.cts +1 -2
- package/dist/cjs/router.cjs +17 -15
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/Matches.js.map +1 -1
- package/dist/esm/load-matches.js +18 -4
- package/dist/esm/load-matches.js.map +1 -1
- package/dist/esm/path.d.ts +1 -2
- package/dist/esm/path.js +0 -13
- package/dist/esm/path.js.map +1 -1
- package/dist/esm/router.js +17 -15
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/Matches.ts +2 -0
- package/src/load-matches.ts +21 -4
- package/src/path.ts +0 -14
- package/src/router.ts +25 -23
package/dist/cjs/router.cjs
CHANGED
|
@@ -339,7 +339,6 @@ class RouterCore {
|
|
|
339
339
|
// This preserves the original parameter syntax including optional parameters
|
|
340
340
|
path: nextTo,
|
|
341
341
|
params: nextParams,
|
|
342
|
-
leaveWildcards: false,
|
|
343
342
|
leaveParams: opts.leaveParams,
|
|
344
343
|
decodeCharMap: this.pathParamsDecodeCharMap,
|
|
345
344
|
parseCache: this.parsePathnameCache
|
|
@@ -767,13 +766,17 @@ class RouterCore {
|
|
|
767
766
|
}
|
|
768
767
|
};
|
|
769
768
|
this.updateMatch = (id, updater) => {
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
769
|
+
this.startTransition(() => {
|
|
770
|
+
const matchesKey = this.state.pendingMatches?.some((d) => d.id === id) ? "pendingMatches" : this.state.matches.some((d) => d.id === id) ? "matches" : this.state.cachedMatches.some((d) => d.id === id) ? "cachedMatches" : "";
|
|
771
|
+
if (matchesKey) {
|
|
772
|
+
this.__store.setState((s) => ({
|
|
773
|
+
...s,
|
|
774
|
+
[matchesKey]: s[matchesKey]?.map(
|
|
775
|
+
(d) => d.id === id ? updater(d) : d
|
|
776
|
+
)
|
|
777
|
+
}));
|
|
778
|
+
}
|
|
779
|
+
});
|
|
777
780
|
};
|
|
778
781
|
this.getMatch = (matchId) => {
|
|
779
782
|
const findFn = (d) => d.id === matchId;
|
|
@@ -1051,13 +1054,12 @@ class RouterCore {
|
|
|
1051
1054
|
params: routeParams,
|
|
1052
1055
|
decodeCharMap: this.pathParamsDecodeCharMap
|
|
1053
1056
|
});
|
|
1054
|
-
const matchId =
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
}).interpolatedPath + loaderDepsHash;
|
|
1057
|
+
const matchId = (
|
|
1058
|
+
// route.id for disambiguation
|
|
1059
|
+
route.id + // interpolatedPath for param changes
|
|
1060
|
+
interpolatedPath + // explicit deps
|
|
1061
|
+
loaderDepsHash
|
|
1062
|
+
);
|
|
1061
1063
|
const existingMatch = this.getMatch(matchId);
|
|
1062
1064
|
const previousMatch = this.state.matches.find(
|
|
1063
1065
|
(d) => d.routeId === route.id
|