@tanstack/router-core 1.130.1 → 1.130.5
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 +11 -7
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/router.d.cts +6 -1
- package/dist/esm/router.d.ts +6 -1
- package/dist/esm/router.js +11 -7
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +21 -7
package/dist/cjs/router.cjs
CHANGED
|
@@ -710,11 +710,9 @@ class RouterCore {
|
|
|
710
710
|
return updated;
|
|
711
711
|
};
|
|
712
712
|
this.getMatch = (matchId) => {
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
...this.state.matches
|
|
717
|
-
].find((d) => d.id === matchId);
|
|
713
|
+
var _a;
|
|
714
|
+
const findFn = (d) => d.id === matchId;
|
|
715
|
+
return this.state.cachedMatches.find(findFn) ?? ((_a = this.state.pendingMatches) == null ? void 0 : _a.find(findFn)) ?? this.state.matches.find(findFn);
|
|
718
716
|
};
|
|
719
717
|
this.loadMatches = async ({
|
|
720
718
|
location,
|
|
@@ -1281,7 +1279,10 @@ class RouterCore {
|
|
|
1281
1279
|
return true;
|
|
1282
1280
|
}
|
|
1283
1281
|
const gcTime = (d.preload ? route.options.preloadGcTime ?? this.options.defaultPreloadGcTime : route.options.gcTime ?? this.options.defaultGcTime) ?? 5 * 60 * 1e3;
|
|
1284
|
-
|
|
1282
|
+
const isError = d.status === "error";
|
|
1283
|
+
if (isError) return true;
|
|
1284
|
+
const isStale = Date.now() - d.updatedAt >= gcTime;
|
|
1285
|
+
return isStale;
|
|
1285
1286
|
};
|
|
1286
1287
|
this.clearCache({ filter });
|
|
1287
1288
|
};
|
|
@@ -1459,7 +1460,10 @@ class RouterCore {
|
|
|
1459
1460
|
}
|
|
1460
1461
|
}
|
|
1461
1462
|
isShell() {
|
|
1462
|
-
return this.options.isShell;
|
|
1463
|
+
return !!this.options.isShell;
|
|
1464
|
+
}
|
|
1465
|
+
isPrerendering() {
|
|
1466
|
+
return !!this.options.isPrerendering;
|
|
1463
1467
|
}
|
|
1464
1468
|
get state() {
|
|
1465
1469
|
return this.__store.state;
|