@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.
@@ -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
- 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((d) => d.id === id ? updater(d) : d)
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 = interpolatePath({
1053
- path: route.id,
1054
- params: routeParams,
1055
- leaveWildcards: true,
1056
- decodeCharMap: this.pathParamsDecodeCharMap,
1057
- parseCache: this.parsePathnameCache
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