@remix-run/router 0.0.0-experimental-cbcd94b7 → 0.0.0-experimental-de419c3d
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 +10 -12
- package/dist/router.cjs.js.map +1 -1
- package/dist/router.d.ts +1 -1
- package/dist/router.js +10 -12
- package/dist/router.js.map +1 -1
- package/dist/router.umd.js +10 -12
- 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 +11 -14
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-de419c3d
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -1699,7 +1699,7 @@ function createRouter(init) {
|
|
|
1699
1699
|
v7_partialHydration: false,
|
|
1700
1700
|
v7_prependBasename: false,
|
|
1701
1701
|
v7_relativeSplatPath: false,
|
|
1702
|
-
|
|
1702
|
+
unstable_skipActionErrorRevalidation: true
|
|
1703
1703
|
}, init.future);
|
|
1704
1704
|
// Cleanup function for history
|
|
1705
1705
|
let unlistenHistory = null;
|
|
@@ -2421,7 +2421,7 @@ function createRouter(init) {
|
|
|
2421
2421
|
// we have it on the loading navigation so use that if available
|
|
2422
2422
|
let activeSubmission = submission || fetcherSubmission || getSubmissionFromNavigation(loadingNavigation);
|
|
2423
2423
|
let routesToUse = inFlightDataRoutes || dataRoutes;
|
|
2424
|
-
let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, activeSubmission, location, future.v7_partialHydration && initialHydration === true, future.
|
|
2424
|
+
let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, activeSubmission, location, future.v7_partialHydration && initialHydration === true, future.unstable_skipActionErrorRevalidation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionResult);
|
|
2425
2425
|
|
|
2426
2426
|
// Cancel pending deferreds for no-longer-matched routes or routes we're
|
|
2427
2427
|
// about to reload. Note that if this is an action reload we would have
|
|
@@ -2702,7 +2702,7 @@ function createRouter(init) {
|
|
|
2702
2702
|
fetchReloadIds.set(key, loadId);
|
|
2703
2703
|
let loadFetcher = getLoadingFetcher(submission, actionResult.data);
|
|
2704
2704
|
state.fetchers.set(key, loadFetcher);
|
|
2705
|
-
let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, submission, nextLocation, false, future.
|
|
2705
|
+
let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, submission, nextLocation, false, future.unstable_skipActionErrorRevalidation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, [match.route.id, actionResult]);
|
|
2706
2706
|
|
|
2707
2707
|
// Put all revalidating fetchers into the loading state, except for the
|
|
2708
2708
|
// current fetcher which we want to keep in it's current loading state which
|
|
@@ -3708,9 +3708,8 @@ function createStaticHandler(routes, opts) {
|
|
|
3708
3708
|
throw normalizeRelativeRoutingRedirectResponse(result.result, request, matchesToLoad[i].route.id, matches, basename, future.v7_relativeSplatPath);
|
|
3709
3709
|
}
|
|
3710
3710
|
if (isResponse(result.result) && isRouteRequest) {
|
|
3711
|
-
// For SSR single-route requests, we want to hand Responses back
|
|
3712
|
-
// without unwrapping
|
|
3713
|
-
// interface so we can know whether it was returned or thrown
|
|
3711
|
+
// For SSR single-route requests, we want to hand Responses back
|
|
3712
|
+
// directly without unwrapping
|
|
3714
3713
|
throw result;
|
|
3715
3714
|
}
|
|
3716
3715
|
return convertHandlerResultToDataResult(result);
|
|
@@ -4108,7 +4107,7 @@ function shouldRevalidateLoader(loaderMatch, arg) {
|
|
|
4108
4107
|
*/
|
|
4109
4108
|
async function loadLazyRouteModule(route, mapRouteProperties, manifest) {
|
|
4110
4109
|
if (!route.lazy) {
|
|
4111
|
-
return
|
|
4110
|
+
return;
|
|
4112
4111
|
}
|
|
4113
4112
|
let lazyRoute = await route.lazy();
|
|
4114
4113
|
|
|
@@ -4116,7 +4115,7 @@ async function loadLazyRouteModule(route, mapRouteProperties, manifest) {
|
|
|
4116
4115
|
// call then we can return - first lazy() to finish wins because the return
|
|
4117
4116
|
// value of lazy is expected to be static
|
|
4118
4117
|
if (!route.lazy) {
|
|
4119
|
-
return
|
|
4118
|
+
return;
|
|
4120
4119
|
}
|
|
4121
4120
|
let routeToUpdate = manifest[route.id];
|
|
4122
4121
|
invariant(routeToUpdate, "No route found in manifest");
|
|
@@ -4152,7 +4151,6 @@ async function loadLazyRouteModule(route, mapRouteProperties, manifest) {
|
|
|
4152
4151
|
Object.assign(routeToUpdate, _extends({}, mapRouteProperties(routeToUpdate), {
|
|
4153
4152
|
lazy: undefined
|
|
4154
4153
|
}));
|
|
4155
|
-
return routeToUpdate;
|
|
4156
4154
|
}
|
|
4157
4155
|
|
|
4158
4156
|
// Default implementation of `dataStrategy` which fetches all loaders in parallel
|
|
@@ -4234,7 +4232,7 @@ async function callLoaderOrAction(type, request, match, manifest, mapRouteProper
|
|
|
4234
4232
|
if (handler) {
|
|
4235
4233
|
// Run statically defined handler in parallel with lazy()
|
|
4236
4234
|
let handlerError;
|
|
4237
|
-
let
|
|
4235
|
+
let [value] = await Promise.all([
|
|
4238
4236
|
// If the handler throws, don't let it immediately bubble out,
|
|
4239
4237
|
// since we need to let the lazy() execution finish so we know if this
|
|
4240
4238
|
// route has a boundary that can handle the error
|
|
@@ -4244,7 +4242,7 @@ async function callLoaderOrAction(type, request, match, manifest, mapRouteProper
|
|
|
4244
4242
|
if (handlerError !== undefined) {
|
|
4245
4243
|
throw handlerError;
|
|
4246
4244
|
}
|
|
4247
|
-
result =
|
|
4245
|
+
result = value;
|
|
4248
4246
|
} else {
|
|
4249
4247
|
// Load lazy route module, then run any returned handler
|
|
4250
4248
|
await loadLazyRouteModule(match.route, mapRouteProperties, manifest);
|