@tanstack/router-core 1.134.9 → 1.134.12
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 +41 -37
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/router.js +41 -37
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +53 -48
package/dist/esm/router.js
CHANGED
|
@@ -624,44 +624,48 @@ class RouterCore {
|
|
|
624
624
|
updateMatch: this.updateMatch,
|
|
625
625
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
626
626
|
onReady: async () => {
|
|
627
|
-
this.
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
627
|
+
this.startTransition(() => {
|
|
628
|
+
this.startViewTransition(async () => {
|
|
629
|
+
let exitingMatches = [];
|
|
630
|
+
let enteringMatches = [];
|
|
631
|
+
let stayingMatches = [];
|
|
632
|
+
batch(() => {
|
|
633
|
+
this.__store.setState((s) => {
|
|
634
|
+
const previousMatches = s.matches;
|
|
635
|
+
const newMatches = s.pendingMatches || s.matches;
|
|
636
|
+
exitingMatches = previousMatches.filter(
|
|
637
|
+
(match) => !newMatches.some((d) => d.id === match.id)
|
|
638
|
+
);
|
|
639
|
+
enteringMatches = newMatches.filter(
|
|
640
|
+
(match) => !previousMatches.some((d) => d.id === match.id)
|
|
641
|
+
);
|
|
642
|
+
stayingMatches = newMatches.filter(
|
|
643
|
+
(match) => previousMatches.some((d) => d.id === match.id)
|
|
644
|
+
);
|
|
645
|
+
return {
|
|
646
|
+
...s,
|
|
647
|
+
isLoading: false,
|
|
648
|
+
loadedAt: Date.now(),
|
|
649
|
+
matches: newMatches,
|
|
650
|
+
pendingMatches: void 0,
|
|
651
|
+
cachedMatches: [
|
|
652
|
+
...s.cachedMatches,
|
|
653
|
+
...exitingMatches.filter((d) => d.status !== "error")
|
|
654
|
+
]
|
|
655
|
+
};
|
|
656
|
+
});
|
|
657
|
+
this.clearExpiredCache();
|
|
655
658
|
});
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
[
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
659
|
+
[
|
|
660
|
+
[exitingMatches, "onLeave"],
|
|
661
|
+
[enteringMatches, "onEnter"],
|
|
662
|
+
[stayingMatches, "onStay"]
|
|
663
|
+
].forEach(([matches, hook]) => {
|
|
664
|
+
matches.forEach((match) => {
|
|
665
|
+
this.looseRoutesById[match.routeId].options[hook]?.(
|
|
666
|
+
match
|
|
667
|
+
);
|
|
668
|
+
});
|
|
665
669
|
});
|
|
666
670
|
});
|
|
667
671
|
});
|