React Router v8 #14468
Replies: 7 comments 31 replies
-
|
🤔 Drop CJS builds and go ESM only Node.js 20.19+, 22.12+ supports require(esm) without a flag, which means we can drop our CJS builds. We will need to specify the proper minimum node version. A few resources I found helpful in considering if now is the right time |
Beta Was this translation helpful? Give feedback.
-
|
🤔 Subresource Integrity (SRI) #14244 @jacob-ebey has expressed the desire to consult with experts on SRI to make sure this API is fully ready to mark as stable. We plan to ask internally at Shopify, but are of course open to the wider OSS community to weigh in. |
Beta Was this translation helpful? Give feedback.
-
|
🤔 This is a feature we shipped back in Remix v2 (guide). There are some subtle bugs this flag can introduce for certain projects, so we didn't feel comfortable stabilizing it as it was, and carried it into React Router v7, since it is useful and fixes annoying an developer experience for many users. The solution to stabilizing this flag is to have separate module graphs without requiring transforms to run. This would require doing away with single file route modules, which is a far bigger change then we're comfortable requiring of our users. However, according to @pcattori this should be solved by Vite rolldown since the current bugs are caused by In the event that |
Beta Was this translation helpful? Give feedback.
-
|
🤔 Drop Node 20 support
Technically we don't need to drop Node 20. For dropping CJS builds we can require Node 20.19+. Would we still want to go ahead and bump the minimum Node version to 22.12? |
Beta Was this translation helpful? Give feedback.
-
|
🤔 Remove matches in ComponentProps This is from a conversation @pcattori and I had. This worked, unless you used an arrow function for your component function MyRoute({ matches }: Route.ComponentProps) {
// ^ type-safe matches! 🎉
}
const MyRoute = ({ matches }: Route.ComponentProps) => {
// ^ infinite type recursion! 💣
}This makes @pcattori has an alternative approach to type-safe matches leveraging the |
Beta Was this translation helpful? Give feedback.
-
|
🤔 Stabilize RSC (data and framework mode) #11566 IMO it would be really ideal if RSC is stabilized going into v8, especially if it's addition will allow us to deprecate/simplify any other APIs in the future (I'm not entirely sure it will, but I know it's a possibility). I assume RSC support going into v8 will be just as opt-in as it is today, and not require any breaking changes. I would love to know if
|
Beta Was this translation helpful? Give feedback.
-
|
🤔 Consolidate Router State Access #13073 This would allow us in v8 to start deprecating some hooks if we feel that was worth doing to trim down the API. However, even if we ship this hook in v7, given the timeline I would not feel comfortable immediately removing other hooks as it would just create unnecessary churn for developers and feed into the impression that we're always breaking things just to make people mad. @pcattori do you have any input on if this should be part of the v8 roadmap? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
React Router v7 was released almost a year ago (2024-11-21). We're at a good point to start considering what we want to include/remove in v8, which will help us build out any remaining roadmap and estimate a timeline.
There are a few principles from our Design Goals worth mentioning here as we plan for our next major version:
We have released a lot and have a few future flags already stabilized or can be soon. This is a good spot to take stock of future flags we have in progress, what deprecations we've introduced or still need, and draw a line in the sand for any future breaking changes we're considering.
Note
Threads will be created for anything proposed that needs to be discussed further. This top level summary will be kept up to date with all decisions that have been made.
Please open a thread (if one does not exist) if you have questions or comments on anything below, or if you have another feature, deprecation, or change you would like to be considered.
unstable_)Future Flags
v8_middleware🗺️ Middleware #12695getLoadContext/AppLoadContexthave the potential to be the most disruptive breaking changes in v8. We have a very feasible solution for custom servers usinggetLoadContextand should highlight this approach again in our upgrade guide.unstable_optimizeDepsDeprecations
datain types (in preference ofloaderData) feat(react-router): addloaderDataand deprecatedatawhere possible #14047require(esm)without a flag, which means we can drop our CJS builds.matchesinComponentPropsNice to Haves
These are non-breaking changes features that are marked as unstable or have not been started. Given that they are features, they can be added in future minor versions. However, for the sake of simplicity, shipping major versions with little to no dangling
unstable_features makes for a clean story and clear starting point for both end users and contributors.RouterProvideronErrorprop RouterProvider onError #12958useRouteConsolidate route data access with new type-safe hook:useRoute#14418fetcher.resetAdd fetcher.reset() API #14207instrumentationObservability #14376Rejected Changes
ViewTransitioncomponentViewTranstionis a canary feature at the time of this proposal. Even if it is released by the time v8 comes out, we would be forced to make React 19.3(?) the minimum required React version very shortly after it coming out. Currently we have no intention of dropping React 18 support, so this is out of the question for React Router v8. We should continue to consider the possibility of removing our APIs in favor of React's built-in support in the long term, but more research will be required to determine the impactBeta Was this translation helpful? Give feedback.
All reactions