@tanstack/router-core 1.136.11 → 1.136.13
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 +10 -2
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/router.d.cts +8 -0
- package/dist/esm/router.d.ts +8 -0
- package/dist/esm/router.js +10 -2
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +21 -2
package/dist/cjs/router.cjs
CHANGED
|
@@ -654,9 +654,17 @@ class RouterCore {
|
|
|
654
654
|
loadedAt: Date.now(),
|
|
655
655
|
matches: newMatches,
|
|
656
656
|
pendingMatches: void 0,
|
|
657
|
+
/**
|
|
658
|
+
* When committing new matches, cache any exiting matches that are still usable.
|
|
659
|
+
* Routes that resolved with `status: 'error'` or `status: 'notFound'` are
|
|
660
|
+
* deliberately excluded from `cachedMatches` so that subsequent invalidations
|
|
661
|
+
* or reloads re-run their loaders instead of reusing the failed/not-found data.
|
|
662
|
+
*/
|
|
657
663
|
cachedMatches: [
|
|
658
664
|
...s.cachedMatches,
|
|
659
|
-
...exitingMatches.filter(
|
|
665
|
+
...exitingMatches.filter(
|
|
666
|
+
(d) => d.status !== "error" && d.status !== "notFound"
|
|
667
|
+
)
|
|
660
668
|
]
|
|
661
669
|
};
|
|
662
670
|
});
|
|
@@ -775,7 +783,7 @@ class RouterCore {
|
|
|
775
783
|
return {
|
|
776
784
|
...d,
|
|
777
785
|
invalid: true,
|
|
778
|
-
...opts?.forcePending || d.status === "error" ? { status: "pending", error: void 0 } : void 0
|
|
786
|
+
...opts?.forcePending || d.status === "error" || d.status === "notFound" ? { status: "pending", error: void 0 } : void 0
|
|
779
787
|
};
|
|
780
788
|
}
|
|
781
789
|
return d;
|