@tanstack/router-core 1.131.17 → 1.131.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 +32 -27
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/router.js +32 -27
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +26 -21
package/package.json
CHANGED
package/src/router.ts
CHANGED
|
@@ -2697,10 +2697,12 @@ export class RouterCore<
|
|
|
2697
2697
|
this.getMatch(matchId),
|
|
2698
2698
|
loaderData,
|
|
2699
2699
|
)
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2700
|
+
if (loaderData !== undefined) {
|
|
2701
|
+
innerLoadContext.updateMatch(matchId, (prev) => ({
|
|
2702
|
+
...prev,
|
|
2703
|
+
loaderData,
|
|
2704
|
+
}))
|
|
2705
|
+
}
|
|
2704
2706
|
}
|
|
2705
2707
|
|
|
2706
2708
|
// Lazy option can modify the route options,
|
|
@@ -2837,14 +2839,16 @@ export class RouterCore<
|
|
|
2837
2839
|
)
|
|
2838
2840
|
: shouldReloadOption
|
|
2839
2841
|
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2842
|
+
const nextPreload =
|
|
2843
|
+
!!preload && !this.state.matches.some((d) => d.id === matchId)
|
|
2844
|
+
const match = this.getMatch(matchId)!
|
|
2845
|
+
match._nonReactive.loaderPromise = createControlledPromise<void>()
|
|
2846
|
+
if (nextPreload !== match.preload) {
|
|
2847
|
+
innerLoadContext.updateMatch(matchId, (prev) => ({
|
|
2843
2848
|
...prev,
|
|
2844
|
-
preload:
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
})
|
|
2849
|
+
preload: nextPreload,
|
|
2850
|
+
}))
|
|
2851
|
+
}
|
|
2848
2852
|
|
|
2849
2853
|
// If the route is successful and still fresh, just resolve
|
|
2850
2854
|
const { status, invalid } = this.getMatch(matchId)!
|
|
@@ -2886,23 +2890,24 @@ export class RouterCore<
|
|
|
2886
2890
|
}
|
|
2887
2891
|
}
|
|
2888
2892
|
}
|
|
2893
|
+
const match = this.getMatch(matchId)!
|
|
2889
2894
|
if (!loaderIsRunningAsync) {
|
|
2890
|
-
const match = this.getMatch(matchId)!
|
|
2891
2895
|
match._nonReactive.loaderPromise?.resolve()
|
|
2892
2896
|
match._nonReactive.loadPromise?.resolve()
|
|
2893
2897
|
}
|
|
2894
2898
|
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2899
|
+
clearTimeout(match._nonReactive.pendingTimeout)
|
|
2900
|
+
match._nonReactive.pendingTimeout = undefined
|
|
2901
|
+
if (!loaderIsRunningAsync) match._nonReactive.loaderPromise = undefined
|
|
2902
|
+
match._nonReactive.dehydrated = undefined
|
|
2903
|
+
const nextIsFetching = loaderIsRunningAsync ? match.isFetching : false
|
|
2904
|
+
if (nextIsFetching !== match.isFetching || match.invalid !== false) {
|
|
2905
|
+
innerLoadContext.updateMatch(matchId, (prev) => ({
|
|
2901
2906
|
...prev,
|
|
2902
|
-
isFetching:
|
|
2907
|
+
isFetching: nextIsFetching,
|
|
2903
2908
|
invalid: false,
|
|
2904
|
-
}
|
|
2905
|
-
}
|
|
2909
|
+
}))
|
|
2910
|
+
}
|
|
2906
2911
|
return this.getMatch(matchId)!
|
|
2907
2912
|
}
|
|
2908
2913
|
|