@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/CHANGELOG.md +7 -0
- package/dist/router.cjs.js +13 -8
- package/dist/router.cjs.js.map +1 -1
- package/dist/router.js +13 -8
- package/dist/router.js.map +1 -1
- package/dist/router.umd.js +13 -8
- 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 +16 -5
package/dist/router.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @remix-run/router v1.6.
|
|
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
|
-
|
|
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
|
-
//
|
|
4161
|
+
// /page -> /page#hash
|
|
4159
4162
|
return b.hash !== "";
|
|
4160
4163
|
} else if (a.hash === b.hash) {
|
|
4161
|
-
//
|
|
4164
|
+
// /page#hash -> /page#hash
|
|
4162
4165
|
return true;
|
|
4163
4166
|
} else if (b.hash !== "") {
|
|
4164
|
-
//
|
|
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
|
}
|