@remix-run/router 0.0.0-experimental-e157216e3 → 0.0.0-experimental-c5cae38f3
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/router.cjs.js +17 -22
- package/dist/router.cjs.js.map +1 -1
- package/dist/router.js +17 -22
- package/dist/router.js.map +1 -1
- package/dist/router.umd.js +17 -22
- 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/dist/utils.d.ts +5 -1
- package/package.json +1 -1
- package/router.ts +22 -36
- package/utils.ts +5 -10
package/dist/router.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @remix-run/router v0.0.0-experimental-
|
|
2
|
+
* @remix-run/router v0.0.0-experimental-c5cae38f3
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -3525,7 +3525,7 @@ function createRouter(init) {
|
|
|
3525
3525
|
let route = partialMatches.length > 0 ? partialMatches[partialMatches.length - 1].route : null;
|
|
3526
3526
|
while (true) {
|
|
3527
3527
|
try {
|
|
3528
|
-
await loadLazyRouteChildren(
|
|
3528
|
+
await loadLazyRouteChildren(patchRoutesOnMissImpl, pathname, partialMatches, dataRoutes || inFlightDataRoutes, manifest, mapRouteProperties, pendingPatchRoutes, signal);
|
|
3529
3529
|
if (signal.aborted) {
|
|
3530
3530
|
return {
|
|
3531
3531
|
type: "aborted"
|
|
@@ -4452,29 +4452,24 @@ function shouldRevalidateLoader(loaderMatch, arg) {
|
|
|
4452
4452
|
* Idempotent utility to execute route.children() method to lazily load route
|
|
4453
4453
|
* definitions and update the routes/routeManifest
|
|
4454
4454
|
*/
|
|
4455
|
-
async function loadLazyRouteChildren(
|
|
4455
|
+
async function loadLazyRouteChildren(patchRoutesOnMissImpl, path, matches, routes, manifest, mapRouteProperties, pendingRouteChildren, signal) {
|
|
4456
4456
|
let key = [path, ...matches.map(m => m.route.id)].join("-");
|
|
4457
|
-
let pending = pendingRouteChildren.get(key);
|
|
4458
|
-
let children = null;
|
|
4459
|
-
if (!pending) {
|
|
4460
|
-
let maybePromise = patchRoutesOnMissImpl(path, matches, (r, c) => patchRoutes(r, c, routes, manifest, mapRouteProperties));
|
|
4461
|
-
if (isPromise(maybePromise)) {
|
|
4462
|
-
pending = maybePromise;
|
|
4463
|
-
pendingRouteChildren.set(key, pending);
|
|
4464
|
-
} else {
|
|
4465
|
-
children = maybePromise;
|
|
4466
|
-
}
|
|
4467
|
-
}
|
|
4468
4457
|
try {
|
|
4469
|
-
|
|
4470
|
-
|
|
4458
|
+
let pending = pendingRouteChildren.get(key);
|
|
4459
|
+
if (!pending) {
|
|
4460
|
+
pending = patchRoutesOnMissImpl({
|
|
4461
|
+
path,
|
|
4462
|
+
matches,
|
|
4463
|
+
patch: (routeId, children) => {
|
|
4464
|
+
if (!signal.aborted) {
|
|
4465
|
+
patchRoutes(routeId, children, routes, manifest, mapRouteProperties);
|
|
4466
|
+
}
|
|
4467
|
+
}
|
|
4468
|
+
});
|
|
4469
|
+
pendingRouteChildren.set(key, pending);
|
|
4471
4470
|
}
|
|
4472
|
-
if (
|
|
4473
|
-
|
|
4474
|
-
patchRoutes(route.id, children, routes, manifest, mapRouteProperties);
|
|
4475
|
-
} else {
|
|
4476
|
-
warning(false, "You cannot return routes from `patchRoutesOnMiss` when there were no " + "partial matches, since React Router doesn't know where to patch the " + "routes. Please use `patch(routeId, children)` instead.");
|
|
4477
|
-
}
|
|
4471
|
+
if (pending && isPromise(pending)) {
|
|
4472
|
+
await pending;
|
|
4478
4473
|
}
|
|
4479
4474
|
} finally {
|
|
4480
4475
|
pendingRouteChildren.delete(key);
|