@remix-run/router 0.0.0-experimental-ce5294fc → 0.0.0-experimental-8f9ef191
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 +7 -12
- package/dist/router.cjs.js.map +1 -1
- package/dist/router.js +7 -12
- package/dist/router.js.map +1 -1
- package/dist/router.umd.js +7 -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 +3 -17
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-8f9ef191
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -2258,7 +2258,7 @@ function createRouter(init) {
|
|
|
2258
2258
|
|
|
2259
2259
|
// Create a controller/Request for this navigation
|
|
2260
2260
|
pendingNavigationController = new AbortController();
|
|
2261
|
-
let request = createClientSideRequest(init.history, location, pendingNavigationController.signal, opts && opts.
|
|
2261
|
+
let request = createClientSideRequest(init.history, location, pendingNavigationController.signal, opts && opts.submission);
|
|
2262
2262
|
let pendingActionData;
|
|
2263
2263
|
let pendingError;
|
|
2264
2264
|
if (opts && opts.pendingError) {
|
|
@@ -2614,7 +2614,7 @@ function createRouter(init) {
|
|
|
2614
2614
|
|
|
2615
2615
|
// Call the action for the fetcher
|
|
2616
2616
|
let abortController = new AbortController();
|
|
2617
|
-
let fetchRequest = createClientSideRequest(init.history, path, abortController.signal,
|
|
2617
|
+
let fetchRequest = createClientSideRequest(init.history, path, abortController.signal, submission);
|
|
2618
2618
|
fetchControllers.set(key, abortController);
|
|
2619
2619
|
let originatingLoadId = incrementingLoadId;
|
|
2620
2620
|
let actionResult = await callLoaderOrAction("action", fetchRequest, match, requestMatches, manifest, mapRouteProperties, basename);
|
|
@@ -2662,7 +2662,7 @@ function createRouter(init) {
|
|
|
2662
2662
|
// Start the data load for current matches, or the next location if we're
|
|
2663
2663
|
// in the middle of a navigation
|
|
2664
2664
|
let nextLocation = state.navigation.location || state.location;
|
|
2665
|
-
let revalidationRequest = createClientSideRequest(init.history, nextLocation, abortController.signal
|
|
2665
|
+
let revalidationRequest = createClientSideRequest(init.history, nextLocation, abortController.signal);
|
|
2666
2666
|
let routesToUse = inFlightDataRoutes || dataRoutes;
|
|
2667
2667
|
let matches = state.navigation.state !== "idle" ? matchRoutes(routesToUse, state.navigation.location, basename) : state.matches;
|
|
2668
2668
|
invariant(matches, "Didn't find any matches after fetcher action");
|
|
@@ -2767,7 +2767,7 @@ function createRouter(init) {
|
|
|
2767
2767
|
|
|
2768
2768
|
// Call the loader for this fetcher route match
|
|
2769
2769
|
let abortController = new AbortController();
|
|
2770
|
-
let fetchRequest = createClientSideRequest(init.history, path, abortController.signal
|
|
2770
|
+
let fetchRequest = createClientSideRequest(init.history, path, abortController.signal);
|
|
2771
2771
|
fetchControllers.set(key, abortController);
|
|
2772
2772
|
let originatingLoadId = incrementingLoadId;
|
|
2773
2773
|
let result = await callLoaderOrAction("loader", fetchRequest, match, matches, manifest, mapRouteProperties, basename);
|
|
@@ -2920,7 +2920,7 @@ function createRouter(init) {
|
|
|
2920
2920
|
// accordingly
|
|
2921
2921
|
let results = await Promise.all([...matchesToLoad.map(match => callLoaderOrAction("loader", request, match, matches, manifest, mapRouteProperties, basename)), ...fetchersToLoad.map(f => {
|
|
2922
2922
|
if (f.matches && f.match && f.controller) {
|
|
2923
|
-
return callLoaderOrAction("loader", createClientSideRequest(init.history, f.path, f.controller.signal
|
|
2923
|
+
return callLoaderOrAction("loader", createClientSideRequest(init.history, f.path, f.controller.signal), f.match, f.matches, manifest, mapRouteProperties, basename);
|
|
2924
2924
|
} else {
|
|
2925
2925
|
let error = {
|
|
2926
2926
|
type: ResultType.error,
|
|
@@ -4221,16 +4221,11 @@ async function callLoaderOrAction(type, request, match, matches, manifest, mapRo
|
|
|
4221
4221
|
// Utility method for creating the Request instances for loaders/actions during
|
|
4222
4222
|
// client-side navigations and fetches. During SSR we will always have a
|
|
4223
4223
|
// Request instance from the static handler (query/queryRoute)
|
|
4224
|
-
function createClientSideRequest(history, location, signal,
|
|
4224
|
+
function createClientSideRequest(history, location, signal, submission) {
|
|
4225
4225
|
let url = history.createURL(stripHashFromPath(location)).toString();
|
|
4226
4226
|
let init = {
|
|
4227
4227
|
signal
|
|
4228
4228
|
};
|
|
4229
|
-
if (initial) {
|
|
4230
|
-
init.headers = {
|
|
4231
|
-
"X-Remix-Initial-Load": "yes"
|
|
4232
|
-
};
|
|
4233
|
-
}
|
|
4234
4229
|
if (submission && isMutationMethod(submission.formMethod)) {
|
|
4235
4230
|
let {
|
|
4236
4231
|
formMethod,
|