@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.
@@ -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.startViewTransition(async () => {
628
- let exitingMatches;
629
- let enteringMatches;
630
- let stayingMatches;
631
- batch(() => {
632
- this.__store.setState((s) => {
633
- const previousMatches = s.matches;
634
- const newMatches = s.pendingMatches || s.matches;
635
- exitingMatches = previousMatches.filter(
636
- (match) => !newMatches.some((d) => d.id === match.id)
637
- );
638
- enteringMatches = newMatches.filter(
639
- (match) => !previousMatches.some((d) => d.id === match.id)
640
- );
641
- stayingMatches = newMatches.filter(
642
- (match) => previousMatches.some((d) => d.id === match.id)
643
- );
644
- return {
645
- ...s,
646
- isLoading: false,
647
- loadedAt: Date.now(),
648
- matches: newMatches,
649
- pendingMatches: void 0,
650
- cachedMatches: [
651
- ...s.cachedMatches,
652
- ...exitingMatches.filter((d) => d.status !== "error")
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
- this.clearExpiredCache();
657
- });
658
- [
659
- [exitingMatches, "onLeave"],
660
- [enteringMatches, "onEnter"],
661
- [stayingMatches, "onStay"]
662
- ].forEach(([matches, hook]) => {
663
- matches.forEach((match) => {
664
- this.looseRoutesById[match.routeId].options[hook]?.(match);
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
  });