@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/esm/router.js
CHANGED
|
@@ -337,7 +337,6 @@ class RouterCore {
|
|
|
337
337
|
// This preserves the original parameter syntax including optional parameters
|
|
338
338
|
path: nextTo,
|
|
339
339
|
params: nextParams,
|
|
340
|
-
leaveWildcards: false,
|
|
341
340
|
leaveParams: opts.leaveParams,
|
|
342
341
|
decodeCharMap: this.pathParamsDecodeCharMap,
|
|
343
342
|
parseCache: this.parsePathnameCache
|
|
@@ -765,13 +764,17 @@ class RouterCore {
|
|
|
765
764
|
}
|
|
766
765
|
};
|
|
767
766
|
this.updateMatch = (id, updater) => {
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
767
|
+
this.startTransition(() => {
|
|
768
|
+
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" : "";
|
|
769
|
+
if (matchesKey) {
|
|
770
|
+
this.__store.setState((s) => ({
|
|
771
|
+
...s,
|
|
772
|
+
[matchesKey]: s[matchesKey]?.map(
|
|
773
|
+
(d) => d.id === id ? updater(d) : d
|
|
774
|
+
)
|
|
775
|
+
}));
|
|
776
|
+
}
|
|
777
|
+
});
|
|
775
778
|
};
|
|
776
779
|
this.getMatch = (matchId) => {
|
|
777
780
|
const findFn = (d) => d.id === matchId;
|
|
@@ -1049,13 +1052,12 @@ class RouterCore {
|
|
|
1049
1052
|
params: routeParams,
|
|
1050
1053
|
decodeCharMap: this.pathParamsDecodeCharMap
|
|
1051
1054
|
});
|
|
1052
|
-
const matchId =
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
}).interpolatedPath + loaderDepsHash;
|
|
1055
|
+
const matchId = (
|
|
1056
|
+
// route.id for disambiguation
|
|
1057
|
+
route.id + // interpolatedPath for param changes
|
|
1058
|
+
interpolatedPath + // explicit deps
|
|
1059
|
+
loaderDepsHash
|
|
1060
|
+
);
|
|
1059
1061
|
const existingMatch = this.getMatch(matchId);
|
|
1060
1062
|
const previousMatch = this.state.matches.find(
|
|
1061
1063
|
(d) => d.routeId === route.id
|