@tanstack/router-core 1.134.15 → 1.134.18
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 -2
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/router.d.cts +1 -0
- package/dist/esm/router.d.ts +1 -0
- package/dist/esm/router.js +9 -2
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +18 -2
package/src/router.ts
CHANGED
|
@@ -896,6 +896,7 @@ export class RouterCore<
|
|
|
896
896
|
rewrite?: LocationRewrite
|
|
897
897
|
origin?: string
|
|
898
898
|
latestLocation!: ParsedLocation<FullSearchSchema<TRouteTree>>
|
|
899
|
+
pendingBuiltLocation?: ParsedLocation<FullSearchSchema<TRouteTree>>
|
|
899
900
|
basepath!: string
|
|
900
901
|
routeTree!: TRouteTree
|
|
901
902
|
routesById!: RoutesById<TRouteTree>
|
|
@@ -1593,7 +1594,8 @@ export class RouterCore<
|
|
|
1593
1594
|
} = {},
|
|
1594
1595
|
): ParsedLocation => {
|
|
1595
1596
|
// We allow the caller to override the current location
|
|
1596
|
-
const currentLocation =
|
|
1597
|
+
const currentLocation =
|
|
1598
|
+
dest._fromLocation || this.pendingBuiltLocation || this.latestLocation
|
|
1597
1599
|
|
|
1598
1600
|
const allCurrentLocationMatches = this.matchRoutes(currentLocation, {
|
|
1599
1601
|
_buildLocation: true,
|
|
@@ -1956,7 +1958,11 @@ export class RouterCore<
|
|
|
1956
1958
|
_includeValidateSearch: true,
|
|
1957
1959
|
})
|
|
1958
1960
|
|
|
1959
|
-
|
|
1961
|
+
this.pendingBuiltLocation = location as ParsedLocation<
|
|
1962
|
+
FullSearchSchema<TRouteTree>
|
|
1963
|
+
>
|
|
1964
|
+
|
|
1965
|
+
const commitPromise = this.commitLocation({
|
|
1960
1966
|
...location,
|
|
1961
1967
|
viewTransition,
|
|
1962
1968
|
replace,
|
|
@@ -1964,6 +1970,16 @@ export class RouterCore<
|
|
|
1964
1970
|
hashScrollIntoView,
|
|
1965
1971
|
ignoreBlocker,
|
|
1966
1972
|
})
|
|
1973
|
+
|
|
1974
|
+
// Clear pending location after commit starts
|
|
1975
|
+
// We do this on next microtask to allow synchronous navigate calls to chain
|
|
1976
|
+
Promise.resolve().then(() => {
|
|
1977
|
+
if (this.pendingBuiltLocation === location) {
|
|
1978
|
+
this.pendingBuiltLocation = undefined
|
|
1979
|
+
}
|
|
1980
|
+
})
|
|
1981
|
+
|
|
1982
|
+
return commitPromise
|
|
1967
1983
|
}
|
|
1968
1984
|
|
|
1969
1985
|
/**
|