@remix-run/router 1.14.0-pre.0 → 1.14.0
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/CHANGELOG.md +4 -4
- package/dist/router.cjs.js +24 -14
- package/dist/router.cjs.js.map +1 -1
- package/dist/router.js +24 -13
- package/dist/router.js.map +1 -1
- package/dist/router.umd.js +24 -14
- package/dist/router.umd.js.map +1 -1
- package/dist/router.umd.min.js +2 -2
- package/dist/router.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/router.ts +27 -16
package/dist/router.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @remix-run/router v1.14.0
|
|
2
|
+
* @remix-run/router v1.14.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -1733,18 +1733,28 @@
|
|
|
1733
1733
|
[route.id]: error
|
|
1734
1734
|
};
|
|
1735
1735
|
}
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1736
|
+
let initialized;
|
|
1737
|
+
let hasLazyRoutes = initialMatches.some(m => m.route.lazy);
|
|
1738
|
+
let hasLoaders = initialMatches.some(m => m.route.loader);
|
|
1739
|
+
if (hasLazyRoutes) {
|
|
1740
|
+
// All initialMatches need to be loaded before we're ready. If we have lazy
|
|
1741
|
+
// functions around still then we'll need to run them in initialize()
|
|
1742
|
+
initialized = false;
|
|
1743
|
+
} else if (!hasLoaders) {
|
|
1744
|
+
// If we've got no loaders to run, then we're good to go
|
|
1745
|
+
initialized = true;
|
|
1746
|
+
} else if (future.v7_partialHydration) {
|
|
1747
|
+
// If partial hydration is enabled, we're initialized so long as we were
|
|
1748
|
+
// provided with hydrationData for every route with a loader, and no loaders
|
|
1749
|
+
// were marked for explicit hydration
|
|
1750
|
+
let loaderData = init.hydrationData ? init.hydrationData.loaderData : null;
|
|
1751
|
+
let errors = init.hydrationData ? init.hydrationData.errors : null;
|
|
1752
|
+
initialized = initialMatches.every(m => m.route.loader && m.route.loader.hydrate !== true && (loaderData && loaderData[m.route.id] !== undefined || errors && errors[m.route.id] !== undefined));
|
|
1753
|
+
} else {
|
|
1754
|
+
// Without partial hydration - we're initialized if we were provided any
|
|
1755
|
+
// hydrationData - which is expected to be complete
|
|
1756
|
+
initialized = init.hydrationData != null;
|
|
1757
|
+
}
|
|
1748
1758
|
let router;
|
|
1749
1759
|
let state = {
|
|
1750
1760
|
historyAction: init.history.action,
|
|
@@ -1911,7 +1921,7 @@
|
|
|
1911
1921
|
// in the normal navigation flow. For SSR it's expected that lazy modules are
|
|
1912
1922
|
// resolved prior to router creation since we can't go into a fallbackElement
|
|
1913
1923
|
// UI for SSR'd apps
|
|
1914
|
-
if (!state.initialized
|
|
1924
|
+
if (!state.initialized) {
|
|
1915
1925
|
startNavigation(Action.Pop, state.location, {
|
|
1916
1926
|
initialHydration: true
|
|
1917
1927
|
});
|