Update dependency remix-run/react-router to v7 #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
6.30.1->7.9.5Release Notes
remix-run/react-router (remix-run/react-router)
v7.9.5Compare Source
Date: 2025-10-29
What's Changed
Instrumentation (unstable)
This release adds new
unstable_instrumentationAPIs that will allow you to add runtime instrumentation logic to various aspects of your application (server handler, client navigations/fetches, loaders, actions, middleware,route.lazy). For more information, please see the docs.Patch Changes
react-router- Ensure action handlers run for routes with middleware even if no loader is present (#14443)@react-router/dev- Ensure route navigation doesn't remove CSSlinkelements used by dynamic imports (#14463)@react-router/dev- Typegen: only register route module types for routes within the app directory (#14439)Unstable Changes
react-router- Moveunstable_RSCHydratedRouterand utils toreact-router/domexport (#14457)react-router- Add a type-safehandlefield tounstable_useRoute()(#14462)For example:
react-router- Addunstable_instrumentationsAPI to allow users to add observability to their apps by instrumenting route loaders, actions, middlewares, lazy, as well as server-side request handlers and client side navigations/fetches (#14412)entry.server.tsx:export const unstable_instrumentations = [...]entry.client.tsx:<HydratedRouter unstable_instrumentations={[...]} />createBrowserRouter(routes, { unstable_instrumentations: [...] })react-router- Add a newunstable_patternparameter to loaders/actions/middleware which contains the un-interpolated route pattern (i.e.,/blog/:slug) which is useful for aggregating logs/metrics by route in instrumentation code (#14412)@react-router/dev- Introduce aprerender.unstable_concurrencyoption, to support running the pre-rendering concurrently, potentially speeding up the build (#14380)Full Changelog:
v7.9.4...v7.9.5v7.9.4Compare Source
Date: 2025-10-08
What's Changed
useRoute()(unstable)This release includes a new
unstable_useRoute()hook that provides a type-safe way to access routeloaderData/actionDatafrom a specific route in Framework Mode. Think if it like a better version ofuseRouteLoaderDatathat works with the typegen system and also supportsactionData. Check out the changelog entry below for more information.Patch Changes
@react-router/dev- Updatevalibotdependency to^1.1.0(#14379)@react-router/node- Validate format of incoming session ids increateFileSessionStorage(#14426)Unstable Changes
react-router- handle external redirects in from server actions (#14400)react-router- New (unstable)useRoutehook for accessing data from specific routes (#14407)For example, let's say you have an
adminroute somewhere in your app and you want any child routes ofadminto all have access to theloaderDataandactionDatafromadmin.You might even want to create a reusable widget that all of the routes nested under
admincould use:In framework mode,
useRouteknows all your app's routes and gives you TS errors when invalid route IDs are passed in:useRoutereturnsundefinedif the route is not part of the current page:Note: the
rootroute is the exception since it is guaranteed to be part of the current page.As a result,
useRoutenever returnsundefinedforroot.loaderDataandactionDataare marked as optional since they could be accessed before theactionis triggered or after theloaderthrew an error:If instead of a specific route, you wanted access to the current route's
loaderDataandactionData, you can calluseRoutewithout arguments:This usage is equivalent to calling
useLoaderDataanduseActionData, but consolidates all route data access into one hook:useRoute.Note: when calling
useRoute()(without a route ID), TS has no way to know which route is the current route.As a result,
loaderDataandactionDataare typed asunknown.If you want more type-safety, you can either narrow the type yourself with something like
zodor you can refactor your app to pass down typed props to yourAdminWidget:Full Changelog:
v7.9.3...v7.9.4v7.9.3Compare Source
Date: 2025-09-26
Patch Changes
react-router- Fix Data Mode regression causing a 404 during initial load in whenmiddlewareexists without anyloaderfunctions (#14393)react-router- Do not try to useturbo-streamto decode CDN errors that never reached the server (#14385)ErrorBoundaryinstead of a generic "Unable to decode turbo-stream response" errorFull Changelog:
v7.9.2...v7.9.3v7.9.2Compare Source
Date: 2025-09-24
What's Changed
This release contains a handful of bug fixes, but we think you'll be most excited about the new unstable stuff 😉.
RSC Framework Mode (unstable)
This release includes our first release of unstable support for RSC in Framework Mode! You can read more about it in our blog post and the docs.
Fetcher Reset (unstable)
This release also includes a new (long-requested)
fetcher.unstable_reset()API to reset fetchers back to their initialidlestate.Patch Changes
react-router- Ensure client-side router runs clientmiddlewareduring initialization data load (if required) even if no loaders exist (#14348)react-router- Fixmiddlewareprop not being supported on<Route>when used with a data router viacreateRoutesFromElements(#14357)react-router- UpdatecreateRoutesStubto work withmiddleware(#14348)<RoutesStub future={{ v8_middleware: true }} />flag to enable the propercontexttypereact-router- Update Lazy Route Discovery manifest requests to use a singular comma-separatedpathsquery param instead of repeatedpquery params (#14321)react-router- Fail gracefully on manifest version mismatch logic ifsessionStorageaccess is blocked (#14335)react-router- UpdateuseOutletreturned element to have a stable identity in-between route changes (#13382)react-router- Handle encoded question mark and hash characters in ancestor splat routes (#14249)@react-router/dev- Switch internal vite plugin Response logic to use@remix-run/node-fetch-server(#13927)@react-router/dev- Fixpresetsfutureflags being ignored during config resolution (#14369)Unstable Changes
react-router- Addfetcher.unstable_reset()API (#14206)react-router- In RSC Data Mode, handle SSR'd client errors and re-try in the browser (#14342)react-router- Enable full transition support for the RSC router (#14362)@react-router/dev- Add unstable support for RSC Framework Mode (#14336)@react-router/serve- Disablecompression()middleware in RSC framework mode (#14381)Full Changelog:
v7.9.1...v7.9.2v7.9.1Compare Source
Date: 2025-09-12
Patch Changes
Futureinterface naming frommiddleware->v8_middleware(#14327)Full Changelog:
v7.9.0...v7.9.1v7.9.0Compare Source
Date: 2025-09-12
What's Changed
Stable Middleware and Context APIs
We have removed the
unstable_prefix from the following APIs and they are now considered stable and ready for production use:RouterContextProvidercreateContextcreateBrowserRoutergetContextoption<HydratedRouter>getContextpropPlease see the Middleware Docs, the Middleware RFC, and the Client-side Context RFC for more information.
Minor Changes
Patch Changes
react-router- Updatehref()to correctly process routes that have an extension after the parameter or are a single optional parameter (#13797)react-router- Escape HTML inmeta()JSON-LD content (#14316)Unstable Changes
react-router- RSC: Add react-serverAwaitcomponent implementation (#14261)react-router- RSC: Fix hydration errors for routes that only have client loaders when using RSC in Data Mode along with a custom basename (#14264)react-router- RSC: Makehreffunction available in areact-servercontext (#14262)react-router- RSC: Decode each timegetPayload()is called to allow for "in-context" decoding and hoisting of contextual assets (#14248)Full Changelog:
v7.8.2...v7.9.0v7.8.2Compare Source
Date: 2025-08-22
Patch Changes
react-router- MaintainReadonlyMapandReadonlySettypes in server response data. (#13092)react-router- Fixbasenameusage without a leading slash in data routers (#11671)react-router- FixTypeErrorif you throw frompatchRoutesOnNavigationwhen no partial matches exist (#14198)react-router- Properly escape interpolated param values ingeneratePath()(#13530)@react-router/dev- Fix potential memory leak in defaultentry.server(#14200)Unstable Changes
Client-side
onErrorreact-router- Add<RouterProvider unstable_onError>/<HydratedRouter unstable_onError>prop for client side error reporting (#14162)Middleware
react-router- Delay serialization of.dataredirects to 202 responses until after middleware chain (#14205)react-router- Update client middleware so it returns thedataStrategyresults up the chain allowing for more advanced post-processing middleware (#14151, #14212)react-router- Remove Data Modefuture.unstable_middlewareflag fromcreateBrowserRouter(#14213)getLoadContexttype behavior changeRSC
react-router- Allow opting out of revalidation on server actions with hidden$SKIP_REVALIDATIONinput (#14154)Full Changelog:
v7.8.1...v7.8.2v7.8.1Compare Source
Date: 2025-08-15
Patch Changes
react-router- Fix usage of optional path segments in nested routes defined using absolute paths (#14135)react-router- Fix optional static segment matching inmatchPath(#11813)react-router- Fix pre-rendering when abasenameis set withssr:false(#13791)react-router- Properly convert returned/throwndata()values toResponseinstances viaResponse.json()in resource routes and middleware (#14159, #14181)@react-router/dev- Update generatedRoute.MetaArgstype soloaderDatais only potentially undefined when anErrorBoundaryexport is present (#14173)Unstable Changes
Middleware
react-router- Bubble client pre-nextmiddleware errors to the shallowest ancestor that needs to load, not strictly the shallowest ancestor with a loader (#14150)react-router- Propagate non-redirectResponsevalues thrown from middleware to the error boundary on document/data requests (#14182)RSC
react-router- ProvideisRouteErrorResponseutility inreact-serverenvironments (#14166)react-router- HandlemetaandlinksRoute Exports in RSC Data Mode (#14136)Full Changelog:
v7.8.0...v7.8.1v7.8.0Compare Source
Date: 2025-08-07
What's Changed
Consistently named
loaderDatavaluesEver noticed the discrepancies in loader data values handed to you by the framework? Like, we call it
loaderDatain your component props, but thenmatch.datain your matches? Yeah, us too - as well as some keen-eyed React Router users who raised this in a proposal. We've added newloaderDatafields alongside existingdatafields in a few lingering spots to align with theloaderDatanaming used in the newRoute.*APIs.Improvements/fixes to the middleware APIs (unstable)
The biggest set of changes in
7.8.0are to theunstable_middlewareAPI's as we move closer to stabilizing them. If you've adopted the middleware APIs for early testing, please read the middleware changes below carefully. We hope to stabilize these soon so please let us know of any feedback you have on the API's in their current state!Minor Changes
react-router- Addnonceprop toLinks&PrefetchPageLinks(#14048)react-router- AddloaderDataarguments/properties alongside existingdataarguments/properties to provide consistency and clarity betweenloaderDataandactionDataacross the board (#14047)Route.MetaArgs,Route.MetaMatch,MetaArgs,MetaMatch,Route.ComponentProps.matches,UIMatch@deprecatedwarnings have been added to the existingdataproperties to point users to newloaderDataproperties, in preparation for removing thedataproperties in a future major releasePatch Changes
react-router- Prevent "Did not find corresponding fetcher result" console error when navigating during afetcher.submitrevalidation (#14114)react-router- Switch Lazy Route Discovery manifest URL generation to use a standaloneURLSearchParamsinstance instead ofURL.searchParamsto avoid a major performance bottleneck in Chrome (#14084)react-router- Adjust internal RSC usage ofReact.useto avoid Webpack compilation errors when using React 18 (#14113)react-router- Remove dependency on@types/nodein TypeScript declaration files (#14059)react-router- Fix types forUIMatchto reflect that theloaderData/dataproperties may beundefined(#12206)When an
ErrorBoundaryis being rendered, not all active matches will have loader data available, since it may have been theirloaderthat threw to trigger the boundaryThe
UIMatch.datatype was not correctly handing this and would always reflect the presence of data, leading to the unexpected runtime errors when anErrorBoundarywas renderedmatch.dataaccesses - you should properly guard forundefinedvalues in those scenarios.@react-router/dev- Fix rename without mkdir in Vite plugin (#14105)Unstable Changes
RSC
react-router- Fix Data Mode issue where routes that returnfalsefromshouldRevalidatewould be replaced by an<Outlet />(#14071)react-router- Proxy server action side-effect redirects from actions for document andcallServerrequests (#14131)Middleware
react-router- Change theunstable_getContextsignature onRouterProvider,HydratedRouter, andunstable_RSCHydratedRouterso that it returns anunstable_RouterContextProviderinstance instead of aMapused to construct the instance internally (#14097)unstable_getContextpropreact-router- Run client middleware on client navigations even if no loaders exist (#14106)react-router- Convert internal middleware implementations to use the newunstable_generateMiddlewareResponseAPI (#14103)react-router- Ensure resource route errors go throughhandleErrorw/middleware enabled (#14078)react-router- Propagate returnedResponsefrom server middleware ifnextwasn't called (#14093)react-router- Allow server middlewares to returndata()values which will be converted into aResponse(#14093, #14128)react-router- Update middleware error handling so that thenextfunction never throws and instead handles any middleware errors at the properErrorBoundaryand returns theResponseup through the ancestornextfunction (#14118)nextcalls intry/catchyou should be able to remove thosereact-router- Bubble client-side middleware errors prior tonextto the appropriate ancestor error boundary (#14138)react-router- When middleware is enabled, make thecontextparameter read-only (Readonly<unstable_RouterContextProvider>) so that TypeScript will not allow you to write arbitrary fields to it in loaders, actions, or middleware. (#14097)react-router- Rename and alter the signature/functionality of theunstable_respondAPI instaticHandler.query/staticHandler.queryRoute(#14103)This only impacts users using
createStaticHandler()for manual data loading during non-Framework Mode SSRThe API has been renamed to
unstable_generateMiddlewareResponsefor clarityThe main functional change is that instead of running the loaders/actions before calling
unstable_respondand handing you the result, we now pass aquery/queryRoutefunction as a parameter and you execute the loaders/actions inside your callback, giving you full access to pre-processing and error handlingThe
queryversion of the API now has a signature of(query: (r: Request) => Promise<StaticHandlerContext | Response>) => Promise<Response>The
queryRouteversion of the API now has a signature of(queryRoute: (r: Request) => Promise<Response>) => Promise<Response>This allows for more advanced usages such as running logic before/after calling
queryand direct error handling of errors thrown from querystaticHandlerunstable_respondAPI@react-router/{architect,cloudflare,express,node}- Change thegetLoadContextsignature (type GetLoadContextFunction) whenfuture.unstable_middlewareis enabled so that it returns anunstable_RouterContextProviderinstance instead of aMapused to construct the instance internally (#14097)type unstable_InitialContextexportgetLoadContextdocs for more informationgetLoadContextfunctionChanges by Package
create-react-routerreact-router@react-router/architect@react-router/cloudflare@react-router/dev@react-router/express@react-router/fs-routes@react-router/node@react-router/remix-config-routes-adapter@react-router/serveFull Changelog:
v7.7.1...v7.8.0v7.7.1Compare Source
Date: 2025-07-24
Patch Changes
@react-router/dev- Update to Prettier v3 for formatting when runningreact-router reveal --no-typescript(#14049)Unstable Changes
react-router- RSC Data Mode: fix bug where routes with errors weren't forced to revalidate whenshouldRevalidatereturnedfalse(#14026)react-router- RSC Data Mode: fixMatched leaf route at location "/..." does not have an element or Componentwarnings when error boundaries are rendered (#14021)Full Changelog:
v7.7.0...v7.7.1v7.7.0Compare Source
Date: 2025-07-16
What's Changed
Unstable RSC APIs
We're excited to introduce experimental support for RSC in Data Mode via the following new APIs:
unstable_RSCHydratedRouterunstable_RSCStaticRouterunstable_createCallServerunstable_getRSCStreamunstable_matchRSCServerRequestunstable_routeRSCServerRequestFor more information, check out the blog post and the RSC Docs.
Minor Changes
create-react-router- Add Deno as a supported and detectable package manager. Note that this detection will only work with Deno versions 2.0.5 and above. If you are using an older version version of Deno then you must specify the --package-manager CLI flag set todeno. (#12327)@react-router/remix-config-routes-adapter- ExportDefineRouteFunctiontype alongsideDefineRoutesFunction(#13945)Patch Changes
react-router- HandleInvalidCharacterErrorwhen validating cookie signature (#13847)react-router- Pass a copy ofsearchParamsto thesetSearchParamscallback function to avoid mutations of the internalsearchParamsinstance (#12784)searchParamswhen a navigation is blocked because the internal instance gets out of sync withuseLocation().searchreact-router- Support invalidDateinturbo-streamv2 fork (#13684)react-router- In Framework Mode, clear critical CSS in development after initial render (#13872, #13995)react-router- Strip search parameters frompatchRoutesOnNavigationpathparam for fetcher calls (#13911)react-router- Skip scroll restoration onuseRevalidator()calls because they're not new locations (#13671)react-router- Support unencoded UTF-8 routes in prerender config withssrset tofalse(#13699)react-router- Do not throw if the url hash is not a valid URI component (#13247)react-router- RemoveContent-Lengthheader from Single Fetch responses (#13902)react-router- Fix a regression increateRoutesStubintroduced with the middleware feature (#13946)As part of that work we altered the signature to align with the new middleware APIs without making it backwards compatible with the prior
AppLoadContextAPIThis permitted
createRoutesStubto work if you were opting into middleware and the updatedcontexttypings, but brokecreateRoutesStubfor users not yet opting into middlewareWe've reverted this change and re-implemented it in such a way that both sets of users can leverage it
createRoutesStubwith the updated API.@react-router/dev- Updatevite-nodeto^3.2.2to support Vite 7 (#13781)@react-router/dev- Properly handlehttpsprotocol in dev mode (#13746)@react-router/dev- Fix missing styles when Vite'sbuild.cssCodeSplitoption is disabled (#13943)@react-router/dev- Allow.mtsand.mjsextensions for route config file (#13931)@react-router/dev- Fix prerender file locations whencwddiffers from project root (#13824)@react-router/dev- Improve chunk error logging when a chunk cannot be found during the build (#13799)@react-router/dev- Fix incorrectly configuredexternalConditionswhich had enabledmodulecondition for externals and broke builds with certain packages (like Emotion) (#13871)Unstable Changes
Changes by Package
create-react-routerreact-router@react-router/architect@react-router/cloudflare@react-router/dev@react-router/express@react-router/fs-routes@react-router/node@react-router/remix-config-routes-adapter@react-router/serveFull Changelog:
v7.6.3...v7.7.0v7.6.3Compare Source
Date: 2025-06-27
Patch Changes
react-router- Do not serialize types foruseRouteLoaderData<typeof clientLoader>(#13752)For types to distinguish a
clientLoaderfrom aserverLoader, you MUST annotateclientLoaderargs:@react-router/cloudflare- RemovetsupfrompeerDependencies(#13757)@react-router/dev- Add Vite 7 support (#13748)@react-router/dev- Skippackage.jsonresolution checks when a customentry.server.(j|t)sxfile is provided (#13744)@react-router/dev- Add validation for a route's id not being 'root' (#13792)@react-router/fs-routes@react-router/remix-config-routes-adapter- UsereplaceAllfor normalizing windows file system slashes (#13738)@react-router/node- Remove old "install" package exports (#13762)Full Changelog:
v7.6.2...v7.6.3v7.6.2Compare Source
Date: 2025-06-03
Patch Changes
create-react-router- Updatetar-fs(#13675)react-router- (INTERNAL) Slight refactor of internalheaders()function processing for use with RSC (#13639)react-router@react-router/dev- Avoid additionalwith-propschunk in Framework Mode by moving route module component prop logic from the Vite plugin toreact-router(#13650)@react-router/dev- Whenfuture.unstable_viteEnvironmentApiis enabled and an absolute Vitebasehas been configured, ensure critical CSS is handled correctly during development (#13598)@react-router/dev- Updatevite-node(#13673)@react-router/dev- Fix typegen for non-{.js,.jsx,.ts,.tsx} routes like .mdx (#12453)@react-router/dev- Fix href types for optional dynamic params (#13725)7.6.1 introduced fixes for
hrefwhen using optional static segments,but those fixes caused regressions with how optional dynamic params worked in 7.6.0:
Now, optional static segments are expanded into different paths for
href, but optional dynamic params are not.This way
hrefcan unambiguously refer to an exact URL path, all while keeping the number of path options to a minimum.Additionally, you can pass
paramsfrom component props without needing to narrow them manually:Full Changelog:
v7.6.1...v7.6.2v7.6.1Compare Source
Date: 2025-05-25
Patch Changes
react-router- Partially revert optimization added in7.1.4to reduce calls tomatchRoutesbecause it surfaced other issues (#13562)react-router- UpdateRoute.MetaArgsto reflect thatdatacan be potentiallyundefined(#13563)loaderthrew an error to it's ownErrorBoundary, but it also arises in the case of a 404 which renders the rootErrorBoundary/metabut the rootloaderdid not run because not routes matchedreact-router- Avoid initial fetcher execution 404 error when Lazy Route Discovery is interrupted by a navigation (#13564)react-router- Properlyhrefreplaces splats*(#13593)href("/products/*", { "*": "/1/edit" }); // -> /products/1/edit@react-router/architect- Update@architect/functionsfrom^5.2.0to^7.0.0(#13556)@react-router/dev- Prevent typegen with route files that are outside theapp/directory (#12996)@react-router/dev- Add additional logging tobuildcommand output when cleaning assets from server build (#13547)@react-router/dev- Don't clean assets from server build whenbuild.ssrEmitAssetshas been enabled in Vite config (#13547)@react-router/dev- Fix typegen when same route is used at multiple paths (#13574)For example,
routes/route.tsxis used at 4 different paths here:Previously, typegen would arbitrarily pick one of these paths to be the "winner" and generate types for the route module based on that path
Now, typegen creates unions as necessary for alternate paths for the same route file
@react-router/dev- Better types forparams(#13543)For example:
Previously,
paramsforroutes/routewere calculated as{ p: string, r: string }.This incorrectly ignores params that could come from child routes
If visiting
/parent/1/route/2/child1/3/4, the actual params passed toroutes/routewill have a type of{ p: string, r: string, c1a: string, c1b: string }Now,
paramsare aware of child routes and autocompletion will include child params as optionals:You can also narrow the types for
paramsas it is implemented as a normalized union of params for each page that includesroutes/route:@react-router/dev- Fixhreffor optional segments (#13595)Type generation now expands paths with optionals into their corresponding non-optional paths
For example, the path
/user/:id?gets expanded into/userand/user/:idto more closely model visitable URLshrefthen uses these expanded (non-optional) paths to construct type-safe paths for your app:This becomes even more important for static optional paths where there wasn't a good way to indicate whether the optional should be included in the resulting path:
Unstable Changes
@react-router/dev- Renamed internalreact-router/route-moduleexport toreact-router/internal(#13543)@react-router/dev- RemovedInfoexport from generated+types/*files (#13543)@react-router/dev- Normalize dirent entry path across node versions when generating SRI manifest (#13591)Full Changelog:
v7.6.0...v7.6.1v7.6.0Compare Source
Date: 2025-05-08
What's Changed
routeDiscoveryConfig OptionWe've added a new config option in
7.6.0which grants you more control over the Lazy Route Discovery feature. You can now configure the/__manifestpath if you're running multiple RR applications on the same server, or you can also disable the feature entirely if your application is small enough and the feature isn't necessary.Automatic Types for Future Flags
Some future flags alter the way types should work in React Router. Previously, you had to remember to manually opt-in to the new types. For example, for
future.unstable_middleware:It was up to you to keep the runtime future flags synced with the types for those flags. This was confusing and error-prone.
Now, React Router will automatically enable types for future flags. That means you only need to specify the runtime future flag:
Behind the scenes, React Router will generate the corresponding
declare moduleinto.react-router/types. Currently this is done in.react-router/types/+register.tsbut this is an implementation detail that may change in the future.Minor Changes
react-router- Added a newrouteDiscoveryoption inreact-router.config.tsto configure Lazy Route Discovery behavior (#13451)react-router-Configuration
📅 Schedule: Branch creation - Between 12:00 AM and 03:59 AM, only on Monday ( * 0-3 * * 1 ) (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.