@remix-run/router 1.6.1 → 1.6.2

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.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @remix-run/router v1.6.1
2
+ * @remix-run/router v1.6.2
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1883,12 +1883,14 @@ function createRouter(init) {
1883
1883
  }
1884
1884
  });
1885
1885
  return;
1886
- } // Short circuit if it's only a hash change and not a mutation submission
1886
+ } // Short circuit if it's only a hash change and not a mutation submission.
1887
+ // Ignore on initial page loads because since the initial load will always
1888
+ // be "same hash".
1887
1889
  // For example, on /page#hash and submit a <Form method="post"> which will
1888
1890
  // default to a navigation to /page
1889
1891
 
1890
1892
 
1891
- if (isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
1893
+ if (state.initialized && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
1892
1894
  completeNavigation(location, {
1893
1895
  matches
1894
1896
  });
@@ -2900,7 +2902,8 @@ function createRouter(init) {
2900
2902
  }
2901
2903
 
2902
2904
  function _internalSetRoutes(newRoutes) {
2903
- inFlightDataRoutes = newRoutes;
2905
+ manifest = {};
2906
+ inFlightDataRoutes = convertRoutesToDataRoutes(newRoutes, mapRouteProperties, undefined, manifest);
2904
2907
  }
2905
2908
 
2906
2909
  router = {
@@ -4155,15 +4158,17 @@ function isHashChangeOnly(a, b) {
4155
4158
  }
4156
4159
 
4157
4160
  if (a.hash === "") {
4158
- // No hash -> hash
4161
+ // /page -> /page#hash
4159
4162
  return b.hash !== "";
4160
4163
  } else if (a.hash === b.hash) {
4161
- // current hash -> same hash
4164
+ // /page#hash -> /page#hash
4162
4165
  return true;
4163
4166
  } else if (b.hash !== "") {
4164
- // current hash -> new hash
4167
+ // /page#hash -> /page#other
4165
4168
  return true;
4166
- }
4169
+ } // If the hash is removed the browser will re-perform a request to the server
4170
+ // /page#hash -> /page
4171
+
4167
4172
 
4168
4173
  return false;
4169
4174
  }