Skip to content

Commit d3ab031

Browse files
committed
Update changesets and readme
1 parent b48bc8b commit d3ab031

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

.changeset/fetcher-basename-copy.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/fetcher-basename.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"react-router-dom": minor
3+
"@remix-run/router": minor
4+
---
5+
6+
- Enable relative routing in the `@remix-run/router` when providing a source route ID from which the path is relative to:
7+
8+
- Example: `router.navigate("../path", { fromRouteId: "some-route" })`.
9+
- This also applies to `router.fetch` which already receives a source route ID
10+
11+
- Introduce a new `@remix-run/router` `future.v7_prependBasename` flag to enable `basename` prefixing to all paths coming into `router.navigate` and `router.fetch`.
12+
- Previously the `basename` was prepended in the React Router layer, but now that relative routing is being handled by the router we need prepend the `basename` _after_ resolving any relative paths
13+
- This also enables `basename` support in `useFetcher` as well

packages/router/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,17 @@ router.fetch("key", "/page", {
106106

107107
By default, active loaders will revalidate after any navigation or fetcher mutation. If you need to kick off a revalidation for other use-cases, you can use `router.revalidate()` to re-execute all active loaders.
108108

109+
### Future Flags
110+
111+
We use _Future Flags_ in the router to help us introduce breaking changes in an opt-in fashion ahead of major releases. Please check out the [blog post][future-flags-post] and [React Router Docs][api-development-strategy] for more information on this process. The currently available future flags in `@remix-run/router` are:
112+
113+
| Flag | Description |
114+
| `v7_normalizeFormMethod` | Normalize `useNavigation().formMethod` to be an uppercase HTTP Method |
115+
| `v7_prependBasename` | Prepend the `basename` to incoming `router.navigate`/`router.fetch` paths |
116+
109117
[react-router]: https://reactrouter.com
110118
[remix]: https://remix.run
111119
[react-router-repo]: https://github.com/remix-run/react-router
112120
[remix-routers-repo]: https://github.com/brophdawg11/remix-routers
121+
[api-development-strategy]: https://reactrouter.com/en/main/guides/api-development-strategy
122+
[future-flags-post]: https://remix.run/blog/future-flags

0 commit comments

Comments
 (0)