@remix-run/router 1.7.0-pre.0 → 1.7.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.
- package/CHANGELOG.md +9 -10
- package/dist/router.cjs.js +1 -1
- package/dist/router.js +1 -1
- package/dist/router.umd.js +1 -1
- package/dist/router.umd.min.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `@remix-run/router`
|
|
2
2
|
|
|
3
|
-
## 1.7.0
|
|
3
|
+
## 1.7.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -14,13 +14,12 @@
|
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
async function action({ request }) {
|
|
17
|
-
|
|
18
|
-
// formData => FormData instance with entry [key=value]
|
|
17
|
+
// await request.formData() => FormData instance with entry [key=value]
|
|
19
18
|
}
|
|
20
19
|
```
|
|
21
20
|
|
|
22
21
|
```js
|
|
23
|
-
// Pass `formEncType` to opt-into a different encoding
|
|
22
|
+
// Pass `formEncType` to opt-into a different encoding (json)
|
|
24
23
|
router.navigate("/", {
|
|
25
24
|
formMethod: "post",
|
|
26
25
|
formEncType: "application/json",
|
|
@@ -28,12 +27,12 @@
|
|
|
28
27
|
});
|
|
29
28
|
|
|
30
29
|
async function action({ request }) {
|
|
31
|
-
|
|
32
|
-
// json => { key: "value" }
|
|
30
|
+
// await request.json() => { key: "value" }
|
|
33
31
|
}
|
|
34
32
|
```
|
|
35
33
|
|
|
36
34
|
```js
|
|
35
|
+
// Pass `formEncType` to opt-into a different encoding (text)
|
|
37
36
|
router.navigate("/", {
|
|
38
37
|
formMethod: "post",
|
|
39
38
|
formEncType: "text/plain",
|
|
@@ -41,16 +40,16 @@
|
|
|
41
40
|
});
|
|
42
41
|
|
|
43
42
|
async function action({ request }) {
|
|
44
|
-
|
|
45
|
-
// text => "Text submission"
|
|
43
|
+
// await request.text() => "Text submission"
|
|
46
44
|
}
|
|
47
45
|
```
|
|
48
46
|
|
|
49
47
|
### Patch Changes
|
|
50
48
|
|
|
51
|
-
- Call `window.history.pushState/replaceState` before updating React Router state (instead of after) so that `window.location` matches `useLocation` during synchronous React 17 rendering
|
|
52
|
-
-
|
|
49
|
+
- Call `window.history.pushState/replaceState` before updating React Router state (instead of after) so that `window.location` matches `useLocation` during synchronous React 17 rendering ([#10448](https://github.com/remix-run/react-router/pull/10448))
|
|
50
|
+
- ⚠️ However, generally apps should not be relying on `window.location` and should always reference `useLocation` when possible, as `window.location` will not be in sync 100% of the time (due to `popstate` events, concurrent mode, etc.)
|
|
53
51
|
- Strip `basename` from the `location` provided to `<ScrollRestoration getKey>` to match the `useLocation` behavior ([#10550](https://github.com/remix-run/react-router/pull/10550))
|
|
52
|
+
- Avoid calling `shouldRevalidate` for fetchers that have not yet completed a data load ([#10623](https://github.com/remix-run/react-router/pull/10623))
|
|
54
53
|
- Fix `unstable_useBlocker` key issues in `StrictMode` ([#10573](https://github.com/remix-run/react-router/pull/10573))
|
|
55
54
|
- Upgrade `typescript` to 5.1 ([#10581](https://github.com/remix-run/react-router/pull/10581))
|
|
56
55
|
|
package/dist/router.cjs.js
CHANGED
package/dist/router.js
CHANGED
package/dist/router.umd.js
CHANGED
package/dist/router.umd.min.js
CHANGED