@remix-run/router 0.0.0-experimental-3e5084cc → 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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @remix-run/router v0.0.0-experimental-3e5084cc
2
+ * @remix-run/router v0.0.0-experimental-8f9ef191
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1725,10 +1725,10 @@ function createRouter(init) {
1725
1725
  }
1726
1726
 
1727
1727
  // "Initialized" here really means "Can `RouterProvider` render my route tree?"
1728
- // Prior to `route.InitialFallback`, we only had a root `fallbackElement` so we used
1728
+ // Prior to `route.HydrateFallback`, we only had a root `fallbackElement` so we used
1729
1729
  // `state.initialized` to render that instead of `<DataRoutes>`. Now that we
1730
1730
  // support route level fallbacks we can always render and we'll just render
1731
- // as deep as we have data for and detect the nearest ancestor InitialFallback
1731
+ // as deep as we have data for and detect the nearest ancestor HydrateFallback
1732
1732
  let initialized = future.v7_partialHydration ||
1733
1733
  // All initialMatches need to be loaded before we're ready. If we have lazy
1734
1734
  // functions around still then we'll need to run them in initialize()
@@ -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.initialHydration === true, opts && opts.submission);
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, false, submission);
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, false);
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, false);
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, false), f.match, f.matches, manifest, mapRouteProperties, basename);
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, initial, submission) {
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,