@remix-run/router 0.0.0-experimental-b162e81d → 0.0.0-experimental-cec61865

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-b162e81d
2
+ * @remix-run/router v0.0.0-experimental-cec61865
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1975,7 +1975,7 @@ function createRouter(init) {
1975
1975
  shortCircuited,
1976
1976
  loaderData,
1977
1977
  errors
1978
- } = await handleLoaders(request, location, matches, loadingNavigation, opts && opts.submission, opts && opts.replace, pendingActionData, pendingError);
1978
+ } = await handleLoaders(request, location, matches, loadingNavigation, opts && opts.submission, opts && opts.fetcherSubmission, opts && opts.replace, pendingActionData, pendingError);
1979
1979
 
1980
1980
  if (shortCircuited) {
1981
1981
  return;
@@ -2088,7 +2088,7 @@ function createRouter(init) {
2088
2088
  // errors, etc.
2089
2089
 
2090
2090
 
2091
- async function handleLoaders(request, location, matches, overrideNavigation, submission, replace, pendingActionData, pendingError) {
2091
+ async function handleLoaders(request, location, matches, overrideNavigation, submission, fetcherSubmission, replace, pendingActionData, pendingError) {
2092
2092
  // Figure out the right navigation we want to use for data loading
2093
2093
  let loadingNavigation = overrideNavigation;
2094
2094
 
@@ -2107,7 +2107,7 @@ function createRouter(init) {
2107
2107
  // we have it on the loading navigation so use that if available
2108
2108
 
2109
2109
 
2110
- let activeSubmission = submission ? submission : loadingNavigation.formMethod && loadingNavigation.formAction && loadingNavigation.formData && loadingNavigation.formEncType ? {
2110
+ let activeSubmission = submission || fetcherSubmission ? submission || fetcherSubmission : loadingNavigation.formMethod && loadingNavigation.formAction && loadingNavigation.formData && loadingNavigation.formEncType ? {
2111
2111
  formMethod: loadingNavigation.formMethod,
2112
2112
  formAction: loadingNavigation.formAction,
2113
2113
  formData: loadingNavigation.formData,
@@ -2615,6 +2615,22 @@ function createRouter(init) {
2615
2615
  // Preserve this flag across redirects
2616
2616
  preventScrollReset: pendingPreventScrollReset
2617
2617
  });
2618
+ } else if (isFetchActionRedirect) {
2619
+ // For a fetch action redirect, we kick off a new loading navigation
2620
+ // without the fetcher submission, but we send it along for shouldRevalidate
2621
+ await startNavigation(redirectHistoryAction, redirectLocation, {
2622
+ overrideNavigation: {
2623
+ state: "loading",
2624
+ location: redirectLocation,
2625
+ formMethod: undefined,
2626
+ formAction: undefined,
2627
+ formEncType: undefined,
2628
+ formData: undefined
2629
+ },
2630
+ fetcherSubmission: submission,
2631
+ // Preserve this flag across redirects
2632
+ preventScrollReset: pendingPreventScrollReset
2633
+ });
2618
2634
  } else {
2619
2635
  // Otherwise, we kick off a new loading navigation, preserving the
2620
2636
  // submission info for the duration of this navigation