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