@remix-run/router 1.22.0-pre-v6.1 → 1.23.0-pre-v6.0

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 v1.22.0-pre-v6.1
2
+ * @remix-run/router v1.23.0-pre-v6.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -2324,6 +2324,21 @@
2324
2324
  // `matchRoutes()` has already been called if we're in here via `router.initialize()`
2325
2325
  state.matches : matchRoutes(routesToUse, location, basename);
2326
2326
  let flushSync = (opts && opts.flushSync) === true;
2327
+
2328
+ // Short circuit if it's only a hash change and not a revalidation or
2329
+ // mutation submission.
2330
+ //
2331
+ // Ignore on initial page loads because since the initial hydration will always
2332
+ // be "same hash". For example, on /page#hash and submit a <Form method="post">
2333
+ // which will default to a navigation to /page
2334
+ if (matches && state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
2335
+ completeNavigation(location, {
2336
+ matches
2337
+ }, {
2338
+ flushSync
2339
+ });
2340
+ return;
2341
+ }
2327
2342
  let fogOfWar = checkFogOfWar(matches, routesToUse, location.pathname);
2328
2343
  if (fogOfWar.active && fogOfWar.matches) {
2329
2344
  matches = fogOfWar.matches;
@@ -2348,21 +2363,6 @@
2348
2363
  return;
2349
2364
  }
2350
2365
 
2351
- // Short circuit if it's only a hash change and not a revalidation or
2352
- // mutation submission.
2353
- //
2354
- // Ignore on initial page loads because since the initial hydration will always
2355
- // be "same hash". For example, on /page#hash and submit a <Form method="post">
2356
- // which will default to a navigation to /page
2357
- if (state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
2358
- completeNavigation(location, {
2359
- matches
2360
- }, {
2361
- flushSync
2362
- });
2363
- return;
2364
- }
2365
-
2366
2366
  // Create a controller/Request for this navigation
2367
2367
  pendingNavigationController = new AbortController();
2368
2368
  let request = createClientSideRequest(init.history, location, pendingNavigationController.signal, opts && opts.submission);
@@ -2858,7 +2858,7 @@
2858
2858
  let abortController = new AbortController();
2859
2859
  let fetchRequest = createClientSideRequest(init.history, path, abortController.signal, submission);
2860
2860
  if (isFogOfWar) {
2861
- let discoverResult = await discoverRoutes(requestMatches, new URL(fetchRequest.url).pathname, fetchRequest.signal);
2861
+ let discoverResult = await discoverRoutes(requestMatches, new URL(fetchRequest.url).pathname, fetchRequest.signal, key);
2862
2862
  if (discoverResult.type === "aborted") {
2863
2863
  return;
2864
2864
  } else if (discoverResult.type === "error") {
@@ -3044,7 +3044,7 @@
3044
3044
  let abortController = new AbortController();
3045
3045
  let fetchRequest = createClientSideRequest(init.history, path, abortController.signal);
3046
3046
  if (isFogOfWar) {
3047
- let discoverResult = await discoverRoutes(matches, new URL(fetchRequest.url).pathname, fetchRequest.signal);
3047
+ let discoverResult = await discoverRoutes(matches, new URL(fetchRequest.url).pathname, fetchRequest.signal, key);
3048
3048
  if (discoverResult.type === "aborted") {
3049
3049
  return;
3050
3050
  } else if (discoverResult.type === "error") {
@@ -3588,7 +3588,7 @@
3588
3588
  matches: null
3589
3589
  };
3590
3590
  }
3591
- async function discoverRoutes(matches, pathname, signal) {
3591
+ async function discoverRoutes(matches, pathname, signal, fetcherKey) {
3592
3592
  if (!patchRoutesOnNavigationImpl) {
3593
3593
  return {
3594
3594
  type: "success",
@@ -3605,6 +3605,7 @@
3605
3605
  signal,
3606
3606
  path: pathname,
3607
3607
  matches: partialMatches,
3608
+ fetcherKey,
3608
3609
  patch: (routeId, children) => {
3609
3610
  if (signal.aborted) return;
3610
3611
  patchRoutesImpl(routeId, children, routesToUse, localManifest, mapRouteProperties);