@tanstack/router-core 1.130.6 → 1.130.8
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/router.cjs +9 -9
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/router.js +9 -9
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +9 -9
package/dist/cjs/router.cjs
CHANGED
|
@@ -543,7 +543,7 @@ class RouterCore {
|
|
|
543
543
|
pendingMatches,
|
|
544
544
|
// If a cached moved to pendingMatches, remove it from cachedMatches
|
|
545
545
|
cachedMatches: s.cachedMatches.filter(
|
|
546
|
-
(d) => !pendingMatches.
|
|
546
|
+
(d) => !pendingMatches.some((e) => e.id === d.id)
|
|
547
547
|
)
|
|
548
548
|
}));
|
|
549
549
|
};
|
|
@@ -589,13 +589,13 @@ class RouterCore {
|
|
|
589
589
|
const previousMatches = s.matches;
|
|
590
590
|
const newMatches = s.pendingMatches || s.matches;
|
|
591
591
|
exitingMatches = previousMatches.filter(
|
|
592
|
-
(match) => !newMatches.
|
|
592
|
+
(match) => !newMatches.some((d) => d.id === match.id)
|
|
593
593
|
);
|
|
594
594
|
enteringMatches = newMatches.filter(
|
|
595
|
-
(match) => !previousMatches.
|
|
595
|
+
(match) => !previousMatches.some((d) => d.id === match.id)
|
|
596
596
|
);
|
|
597
597
|
stayingMatches = previousMatches.filter(
|
|
598
|
-
(match) => newMatches.
|
|
598
|
+
(match) => newMatches.some((d) => d.id === match.id)
|
|
599
599
|
);
|
|
600
600
|
return {
|
|
601
601
|
...s,
|
|
@@ -724,9 +724,9 @@ class RouterCore {
|
|
|
724
724
|
}
|
|
725
725
|
};
|
|
726
726
|
const resolvePreload = (matchId) => {
|
|
727
|
-
return !!(allPreload && !this.state.matches.
|
|
727
|
+
return !!(allPreload && !this.state.matches.some((d) => d.id === matchId));
|
|
728
728
|
};
|
|
729
|
-
if (!this.isServer && this.state.matches.
|
|
729
|
+
if (!this.isServer && this.state.matches.some((d) => d._forcePending)) {
|
|
730
730
|
triggerOnReady();
|
|
731
731
|
}
|
|
732
732
|
const handleRedirectAndNotFound = (match, err) => {
|
|
@@ -1076,7 +1076,7 @@ class RouterCore {
|
|
|
1076
1076
|
updateMatch(matchId, (prev) => ({
|
|
1077
1077
|
...prev,
|
|
1078
1078
|
loaderPromise: utils.createControlledPromise(),
|
|
1079
|
-
preload: !!preload && !this.state.matches.
|
|
1079
|
+
preload: !!preload && !this.state.matches.some((d) => d.id === matchId)
|
|
1080
1080
|
}));
|
|
1081
1081
|
const runLoader = async () => {
|
|
1082
1082
|
var _a2, _b2, _c2, _d2;
|
|
@@ -1274,8 +1274,8 @@ class RouterCore {
|
|
|
1274
1274
|
const gcTime = (d.preload ? route.options.preloadGcTime ?? this.options.defaultPreloadGcTime : route.options.gcTime ?? this.options.defaultGcTime) ?? 5 * 60 * 1e3;
|
|
1275
1275
|
const isError = d.status === "error";
|
|
1276
1276
|
if (isError) return true;
|
|
1277
|
-
const
|
|
1278
|
-
return
|
|
1277
|
+
const gcEligible = Date.now() - d.updatedAt >= gcTime;
|
|
1278
|
+
return gcEligible;
|
|
1279
1279
|
};
|
|
1280
1280
|
this.clearCache({ filter });
|
|
1281
1281
|
};
|