@tanstack/router-core 1.171.20 → 1.171.22
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/link.cjs.map +1 -1
- package/dist/cjs/link.d.cts +3 -3
- package/dist/cjs/load-client.cjs +2 -2
- package/dist/cjs/load-client.cjs.map +1 -1
- package/dist/cjs/path.cjs +3 -2
- package/dist/cjs/path.cjs.map +1 -1
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/router.d.cts +2 -1
- package/dist/esm/link.d.ts +3 -3
- package/dist/esm/link.js.map +1 -1
- package/dist/esm/load-client.js +2 -2
- package/dist/esm/load-client.js.map +1 -1
- package/dist/esm/path.js +3 -2
- package/dist/esm/path.js.map +1 -1
- package/dist/esm/router.d.ts +2 -1
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/link.ts +3 -3
- package/src/load-client.ts +9 -3
- package/src/path.ts +6 -2
- package/src/router.ts +2 -1
package/src/link.ts
CHANGED
|
@@ -677,9 +677,9 @@ export interface LinkOptionsProps {
|
|
|
677
677
|
*/
|
|
678
678
|
preload?: false | 'intent' | 'viewport' | 'render'
|
|
679
679
|
/**
|
|
680
|
-
*
|
|
681
|
-
*
|
|
682
|
-
*
|
|
680
|
+
* Delays focus, hover, and viewport preloading by this many milliseconds.
|
|
681
|
+
* Touch intent preloads immediately. If focus or hover ends, or the link
|
|
682
|
+
* leaves the viewport before this delay, the preload will be cancelled.
|
|
683
683
|
*/
|
|
684
684
|
preloadDelay?: number
|
|
685
685
|
/**
|
package/src/load-client.ts
CHANGED
|
@@ -750,7 +750,7 @@ function createLoaderTask(
|
|
|
750
750
|
const match = lane[1 /* matches */][index]!
|
|
751
751
|
const route = getRoute(router, match)
|
|
752
752
|
const preload = !!options[4 /* preload */]
|
|
753
|
-
const plannedCacheMatch =
|
|
753
|
+
const plannedCacheMatch = router._cache.get(match.id)
|
|
754
754
|
let configured
|
|
755
755
|
let reload = false
|
|
756
756
|
let reloadFailure: LoaderOutcome | undefined
|
|
@@ -878,10 +878,16 @@ function createLoaderTask(
|
|
|
878
878
|
if (blocking) {
|
|
879
879
|
settleInto(match, result, preload)
|
|
880
880
|
if (result[0 /* kind */] === SUCCESS) {
|
|
881
|
+
// A settled generation can outlive its lane without keeping unresolved
|
|
882
|
+
// navigation work alive. Refresh generations remain private for rollback.
|
|
881
883
|
if (
|
|
882
|
-
preload &&
|
|
883
884
|
routeLoader &&
|
|
884
|
-
!options[0 /* controller */].signal.aborted
|
|
885
|
+
!options[0 /* controller */].signal.aborted &&
|
|
886
|
+
!(
|
|
887
|
+
process.env.NODE_ENV !== 'production' &&
|
|
888
|
+
!preload &&
|
|
889
|
+
router._tx?.[6 /* refresh */]
|
|
890
|
+
)
|
|
885
891
|
) {
|
|
886
892
|
cacheLoaderMatch(router, match, plannedCacheMatch)
|
|
887
893
|
}
|
package/src/path.ts
CHANGED
|
@@ -112,8 +112,8 @@ export function resolvePath({
|
|
|
112
112
|
trailingSlash = 'never',
|
|
113
113
|
cache,
|
|
114
114
|
}: ResolvePathOptions) {
|
|
115
|
+
const isBase = to === '.'
|
|
115
116
|
const isAbsolute = to.startsWith('/')
|
|
116
|
-
const isBase = !isAbsolute && to === '.'
|
|
117
117
|
|
|
118
118
|
let key
|
|
119
119
|
if (cache) {
|
|
@@ -148,7 +148,11 @@ export function resolvePath({
|
|
|
148
148
|
// ignore inter-slashes
|
|
149
149
|
}
|
|
150
150
|
} else if (value === '..') {
|
|
151
|
-
baseSegments.
|
|
151
|
+
if (baseSegments.length > 1) {
|
|
152
|
+
baseSegments.pop()
|
|
153
|
+
} else {
|
|
154
|
+
baseSegments = ['']
|
|
155
|
+
}
|
|
152
156
|
} else if (value === '.') {
|
|
153
157
|
// ignore
|
|
154
158
|
} else {
|
package/src/router.ts
CHANGED
|
@@ -213,7 +213,8 @@ export interface RouterOptions<
|
|
|
213
213
|
*/
|
|
214
214
|
defaultPreload?: false | 'intent' | 'viewport' | 'render'
|
|
215
215
|
/**
|
|
216
|
-
* The delay in milliseconds
|
|
216
|
+
* The delay in milliseconds before intent focus/hover and viewport preloading.
|
|
217
|
+
* Touch intent preloads immediately.
|
|
217
218
|
*
|
|
218
219
|
* @default 50
|
|
219
220
|
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreloaddelay-property)
|