@tanstack/router-core 0.0.1-beta.13 → 0.0.1-beta.14
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/build/cjs/packages/router-core/src/router.js +15 -6
- package/build/cjs/packages/router-core/src/router.js.map +1 -1
- package/build/esm/index.js +15 -6
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +128 -128
- package/build/umd/index.development.js +15 -6
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +24 -12
|
@@ -1701,10 +1701,16 @@
|
|
|
1701
1701
|
return router.routesById[id];
|
|
1702
1702
|
},
|
|
1703
1703
|
notify: () => {
|
|
1704
|
-
router.state
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1704
|
+
const isFetching = router.state.status === 'loading' || router.state.matches.some(d => d.isFetching);
|
|
1705
|
+
const isPreloading = Object.values(router.matchCache).some(d => d.match.isFetching && !router.state.matches.find(dd => dd.matchId === d.match.matchId));
|
|
1706
|
+
|
|
1707
|
+
if (router.state.isFetching !== isFetching || router.state.isPreloading !== isPreloading) {
|
|
1708
|
+
router.state = _extends({}, router.state, {
|
|
1709
|
+
isFetching,
|
|
1710
|
+
isPreloading
|
|
1711
|
+
});
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1708
1714
|
cascadeLoaderData(router.state.matches);
|
|
1709
1715
|
router.listeners.forEach(listener => listener(router));
|
|
1710
1716
|
},
|
|
@@ -1723,7 +1729,7 @@
|
|
|
1723
1729
|
invariant(dehydratedMatch, 'Oh no! Dehydrated route matches did not match the active state of the router 😬');
|
|
1724
1730
|
Object.assign(match, dehydratedMatch);
|
|
1725
1731
|
});
|
|
1726
|
-
|
|
1732
|
+
matches.forEach(match => match.__.validate());
|
|
1727
1733
|
router.state = _extends({}, router.state, dehydratedState, {
|
|
1728
1734
|
matches
|
|
1729
1735
|
});
|
|
@@ -1739,8 +1745,11 @@
|
|
|
1739
1745
|
|
|
1740
1746
|
if (next.href !== router.location.href) {
|
|
1741
1747
|
router.__.commitLocation(next, true);
|
|
1742
|
-
}
|
|
1748
|
+
}
|
|
1743
1749
|
|
|
1750
|
+
if (!router.state.matches.length) {
|
|
1751
|
+
router.load();
|
|
1752
|
+
}
|
|
1744
1753
|
|
|
1745
1754
|
const unsub = router.history.listen(event => {
|
|
1746
1755
|
router.load(router.__.parseLocation(event.location, router.location));
|