@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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# `@remix-run/router`
|
|
2
2
|
|
|
3
|
+
## 1.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix HMR-driven error boundaries by properly reconstructing new routes and `manifest` in `\_internalSetRoutes` ([#10437](https://github.com/remix-run/react-router/pull/10437))
|
|
8
|
+
- Fix bug where initial data load would not kick off when hash is present ([#10493](https://github.com/remix-run/react-router/pull/10493))
|
|
9
|
+
|
|
3
10
|
## 1.6.1
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/dist/router.cjs.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
|
*
|
|
@@ -1936,12 +1936,14 @@ function createRouter(init) {
|
|
|
1936
1936
|
}
|
|
1937
1937
|
});
|
|
1938
1938
|
return;
|
|
1939
|
-
} // Short circuit if it's only a hash change and not a mutation submission
|
|
1939
|
+
} // Short circuit if it's only a hash change and not a mutation submission.
|
|
1940
|
+
// Ignore on initial page loads because since the initial load will always
|
|
1941
|
+
// be "same hash".
|
|
1940
1942
|
// For example, on /page#hash and submit a <Form method="post"> which will
|
|
1941
1943
|
// default to a navigation to /page
|
|
1942
1944
|
|
|
1943
1945
|
|
|
1944
|
-
if (isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
|
|
1946
|
+
if (state.initialized && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
|
|
1945
1947
|
completeNavigation(location, {
|
|
1946
1948
|
matches
|
|
1947
1949
|
});
|
|
@@ -2953,7 +2955,8 @@ function createRouter(init) {
|
|
|
2953
2955
|
}
|
|
2954
2956
|
|
|
2955
2957
|
function _internalSetRoutes(newRoutes) {
|
|
2956
|
-
|
|
2958
|
+
manifest = {};
|
|
2959
|
+
inFlightDataRoutes = convertRoutesToDataRoutes(newRoutes, mapRouteProperties, undefined, manifest);
|
|
2957
2960
|
}
|
|
2958
2961
|
|
|
2959
2962
|
router = {
|
|
@@ -4208,15 +4211,17 @@ function isHashChangeOnly(a, b) {
|
|
|
4208
4211
|
}
|
|
4209
4212
|
|
|
4210
4213
|
if (a.hash === "") {
|
|
4211
|
-
//
|
|
4214
|
+
// /page -> /page#hash
|
|
4212
4215
|
return b.hash !== "";
|
|
4213
4216
|
} else if (a.hash === b.hash) {
|
|
4214
|
-
//
|
|
4217
|
+
// /page#hash -> /page#hash
|
|
4215
4218
|
return true;
|
|
4216
4219
|
} else if (b.hash !== "") {
|
|
4217
|
-
//
|
|
4220
|
+
// /page#hash -> /page#other
|
|
4218
4221
|
return true;
|
|
4219
|
-
}
|
|
4222
|
+
} // If the hash is removed the browser will re-perform a request to the server
|
|
4223
|
+
// /page#hash -> /page
|
|
4224
|
+
|
|
4220
4225
|
|
|
4221
4226
|
return false;
|
|
4222
4227
|
}
|