| 1 | ---
|
| 2 | title: Future Changes
|
| 3 | order: 1
|
| 4 | ---
|
| 5 |
|
| 6 | # Future Changes
|
| 7 |
|
| 8 | We try our best to keep major version upgrades simple and boring through the use of opt-in APIs and [Future Flags][api-development-strategy]. Future flags are used to gate breaking changes that don't otherwise have a good call-site opt-in strategy. By adopting all opt-in APIs and future flags, you should be able to upgrade to the next major version of React Router with minimal changes.
|
| 9 |
|
| 10 | We plan to ship new major versions roughly once a year as described in our [Open Governance Model][governance], so this guide will continue to track future changes you can adopt ahead of the next major release. v9 is currently estimated for mid-2027 when Node 22 reaches EOL.
|
| 11 |
|
| 12 | We highly recommend you make a commit after each step and ship it instead of doing everything all at once. Most flags can be adopted in any order, with exceptions noted below.
|
| 13 |
|
| 14 | <docs-info>This is an evolving document that will be updated throughout the duration of v8</docs-info>
|
| 15 |
|
| 16 | ## Minimum Versions
|
| 17 |
|
| 18 | [MODES: framework, data, declarative]
|
| 19 |
|
| 20 | <br/>
|
| 21 | <br/>
|
| 22 |
|
| 23 | React Router v9 will require the following minimum versions (as of now). You can prepare for the upgrade by updating them while still on v8:
|
| 24 |
|
| 25 | - `node@24+`
|
| 26 |
|
| 27 | ## Update to latest v8.x
|
| 28 |
|
| 29 | Before adopting any future flags or call-site opt-in changes, you should update to the latest minor version of v8.x to make sure you have access to the latest flags. You may see a number of deprecation warnings as you upgrade, which we'll cover below.
|
| 30 |
|
| 31 | 👉 Update to latest v8
|
| 32 |
|
| 33 | ```sh
|
| 34 | npm install react-router@8 @react-router/{dev,node,etc.}@8
|
| 35 | ```
|
| 36 |
|
| 37 | ## Future Flags
|
| 38 |
|
| 39 | _No future flags yet_
|
| 40 |
|
| 41 | ## Other Planned Breaking Changes
|
| 42 |
|
| 43 | _No known planned breaking changes yet_
|
| 44 |
|
| 45 | ## Unstable Future Flags (Optional)
|
| 46 |
|
| 47 | We document some [unstable] flags here as a reference for folks contributing to the project via beta testing, but they are not generally recommended for production use and may have breaking changes in patch or minor releases - adopt with caution!
|
| 48 |
|
| 49 | ### `future.unstable_optimizeDeps`
|
| 50 |
|
| 51 | [MODES: framework]
|
| 52 |
|
| 53 | <br/>
|
| 54 | <br/>
|
| 55 |
|
| 56 | **Background**
|
| 57 |
|
| 58 | This flag lets React Router provide Vite's dependency optimizer with the client entry file and route module files. This can improve dependency optimization in development, but the behavior is still experimental.
|
| 59 |
|
| 60 | 👉 **Enable the Flag**
|
| 61 |
|
| 62 | ```ts filename=react-router.config.ts
|
| 63 | import type { Config } from "@react-router/dev/config";
|
| 64 |
|
| 65 | export default {
|
| 66 | future: {
|
| 67 | unstable_optimizeDeps: true,
|
| 68 | },
|
| 69 | } satisfies Config;
|
| 70 | ```
|
| 71 |
|
| 72 | **Update your Code**
|
| 73 |
|
| 74 | No code changes are required. If you run into dependency optimization issues after enabling this flag, remove the flag and restart the dev server.
|
| 75 |
|
| 76 | [api-development-strategy]: ../community/api-development-strategy
|
| 77 | [governance]: https://github.com/remix-run/react-router/blob/main/GOVERNANCE.md#design-goals
|
| 78 | [unstable]: ../community/api-development-strategy#unstable-flags
|
| 79 | |
| \ | No newline at end of file |