Update dependency remix-run/react-router to v7 - autoclosed #276
  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.
  
    
  
    
Coming soon: The Renovate bot (GitHub App) will be renamed to Mend. PRs from Renovate will soon appear from 'Mend'. Learn more here.
This PR contains the following updates:
6.30.1->7.9.1Release Notes
remix-run/react-router (remix-run/react-router)
v7.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- Add support for route component props increateRoutesStub(#13528)This allows you to unit test your route components using the props instead of the hooks:
@react-router/dev- Automatic types for future flags (#13506)Patch Changes
You may notice this list is a bit larger than usual! The team ate their vegetables last week and spent the week squashing bugs to work on lowering the issue count that had ballooned a bit since the v7 release.
react-router- Fixreact-routermodule augmentation forNodeNext(#13498)react-router- Don't bundlereact-routerinreact-router/domCJS export (#13497)react-router- Fix bug where a submittingfetcherwould get stuck in aloadingstate if a revalidatingloaderredirected (#12873)react-router- Fix hydration error if a serverloaderreturnedundefined(#13496)react-router- Fix initial load 404 scenarios in data mode (#13500)react-router- StabilizeuseRevalidator'srevalidatefunction (#13542)react-router- Preserve status code if aclientActionthrows adata()result in framework mode (#13522)react-router- Be defensive against leading double slashes in paths to avoidInvalid URLerrors from the URL constructor (#13510)new URL("//", window.location.origin)react-router- RemoveNavigatordeclaration fornavigator.connection.saveDatato avoid messing with any other types beyondsaveDatain user land (#13512)react-router- FixhandleErrorparamsvalues on.datarequests for routes with a dynamic param as the last URL segment (#13481)react-router- Don't trigger anErrorBoundaryUI before the reload when we detect a manifest version mismatch in Lazy Route Discovery (#13480)react-router- Inline[email protected]dependency and fix decoding ordering ofMap/Setinstances (#13518)react-router- Only render dev warnings during dev (#13461)react-router- Short circuit post-processing on aborteddataStrategyrequests (#13521)Cannot read properties of undefined (reading 'result')@react-router/dev- Support project root directories without apackage.jsonif it exists in a parent directory (#13472)@react-router/dev- When providing a custom Vite config path via the CLI--config/-cflag, default the project root directory to the directory containing the Vite config when not explicitly provided (#13472)@react-router/dev- In aroutes.tscontext, ensure the--modeflag is respected forimport.meta.env.MODE(#13485)import.meta.env.MODEwithin aroutes.tscontext was always"development"for thedevandtypegen --watchcommands, but otherwise resolved to"production". These defaults are still in place, but if a--modeflag is provided, this will now take precedence.@react-router/dev- Ensure consistent project root directory resolution logic in CLI commands (#13472)@react-router/dev- When executingreact-router.config.tsandroutes.tswithvite-node, ensure that PostCSS config files are ignored (#13489)@react-router/dev- When extracting critical CSS during development, ensure it's loaded from the client environment to avoid issues with plugins that handle the SSR environment differently (#13503)@react-router/dev- Fix "Status message is not supported by HTTP/2" error during dev when using HTTPS (#13460)@react-router/dev- Update config whenreact-router.config.tsis created or deleted during development (#12319)@react-router/dev- Skip unnecessaryroutes.tsevaluation before Vite build is started (#13513)@react-router/dev- FixTS2300: Duplicate identifiererrors caused by generated types (#13499)href(.react-router/types/+register.ts), causing type checking errorsUnstable Changes
react-router- Fix a few bugs with error bubbling in middleware use-cases (#13538)@react-router/dev- Whenfuture.unstable_viteEnvironmentApiis enabled, ensure thatbuild.assetsDirin Vite config is respected whenenvironments.client.build.assetsDiris not configured (#13491)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.5.3...v7.6.0v7.5.3Compare Source
Date: 2025-04-28
Patch Changes
react-router- Fix bug where bubbled action errors would result inloaderDatabeing cleared at the handlingErrorBoundaryroute (#13476)react-router- Handle redirects fromclientLoader.hydrateinitial load executions (#13477)Full Changelog:
v7.5.2...v7.5.3v7.5.2Compare Source
Date: 2025-04-24
Security Notice
Fixed 2 security vulnerabilities that could result in cache-poisoning attacks by sending specific headers intended for build-time usage for SPA Mode and Pre-rendering (GHSA-f46r-rw29-r322, GHSA-cpj6-fhp6-mr6j).
Patch Changes
react-router- Adjust approach for Pre-rendering/SPA Mode via headers (#13453)react-router- Update Single Fetch to also handle the 204 redirects used in?_datarequests in Remix v2 (#13364).datarequests from outside the scope of React Router (i.e., anexpress/honomiddleware) the same way they did in Remix v2 before Single Fetch was implemented.datarequest wih a response as follows:X-Remix-Redirect: <new-location>headerX-Remix-Replace: trueorX-Remix-Reload-Document: trueheaders to replicatereplace()/redirectDocument()functionalityFull Changelog:
v7.5.1...v7.5.2v7.5.1Compare Source
Date: 2025-04-17
Patch Changes
react-router- When using the object-basedroute.lazyAPI, theHydrateFallbackandhydrateFallbackElementproperties are now skipped when lazy loading routes after hydration (#13376)If you move the code for these properties into a separate file, since the hydrate properties were unused already (if the route wasn't present during hydration), you can avoid downloading them at all. For example:
react-router- Fix single feConfiguration
📅 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.