@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/package.json
CHANGED
package/src/router.ts
CHANGED
|
@@ -346,6 +346,11 @@ export interface RouterOptions<
|
|
|
346
346
|
*/
|
|
347
347
|
isShell?: boolean
|
|
348
348
|
|
|
349
|
+
/**
|
|
350
|
+
* @default false
|
|
351
|
+
*/
|
|
352
|
+
isPrerendering?: boolean
|
|
353
|
+
|
|
349
354
|
/**
|
|
350
355
|
* The default `ssr` a route should use if no `ssr` is provided.
|
|
351
356
|
*
|
|
@@ -833,7 +838,11 @@ export class RouterCore<
|
|
|
833
838
|
startTransition: StartTransitionFn = (fn) => fn()
|
|
834
839
|
|
|
835
840
|
isShell() {
|
|
836
|
-
return this.options.isShell
|
|
841
|
+
return !!this.options.isShell
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
isPrerendering() {
|
|
845
|
+
return !!this.options.isPrerendering
|
|
837
846
|
}
|
|
838
847
|
|
|
839
848
|
update: UpdateFn<
|
|
@@ -2069,11 +2078,12 @@ export class RouterCore<
|
|
|
2069
2078
|
}
|
|
2070
2079
|
|
|
2071
2080
|
getMatch: GetMatchFn = (matchId: string) => {
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2081
|
+
const findFn = (d: { id: string }) => d.id === matchId
|
|
2082
|
+
return (
|
|
2083
|
+
this.state.cachedMatches.find(findFn) ??
|
|
2084
|
+
this.state.pendingMatches?.find(findFn) ??
|
|
2085
|
+
this.state.matches.find(findFn)
|
|
2086
|
+
)
|
|
2077
2087
|
}
|
|
2078
2088
|
|
|
2079
2089
|
loadMatches = async ({
|
|
@@ -2858,7 +2868,11 @@ export class RouterCore<
|
|
|
2858
2868
|
: (route.options.gcTime ?? this.options.defaultGcTime)) ??
|
|
2859
2869
|
5 * 60 * 1000
|
|
2860
2870
|
|
|
2861
|
-
|
|
2871
|
+
const isError = d.status === 'error'
|
|
2872
|
+
if (isError) return true
|
|
2873
|
+
|
|
2874
|
+
const isStale = Date.now() - d.updatedAt >= gcTime
|
|
2875
|
+
return isStale
|
|
2862
2876
|
}
|
|
2863
2877
|
this.clearCache({ filter })
|
|
2864
2878
|
}
|