-
Notifications
You must be signed in to change notification settings - Fork 0
fix(deps): update dependency react-router to v7.11.0 #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
renovate
wants to merge
1
commit into
main
Choose a base branch
from
renovate/react-router-monorepo
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+6
−13
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2d1ab31 to
cc51932
Compare
cc51932 to
5fc5255
Compare
5fc5255 to
f8960cc
Compare
f8960cc to
19ce9b4
Compare
19ce9b4 to
f491463
Compare
6264aea to
4a36545
Compare
4a36545 to
b0983a8
Compare
b0983a8 to
b0eaf8d
Compare
b0eaf8d to
8de1c28
Compare
8de1c28 to
06f2c5e
Compare
0ed3ff5 to
d4b0d8f
Compare
d4b0d8f to
0c08bac
Compare
0c08bac to
7448f1d
Compare
7448f1d to
040857b
Compare
843b8b2 to
3dee5b6
Compare
3dee5b6 to
0397872
Compare
0397872 to
ea50ef3
Compare
ea50ef3 to
af795e7
Compare
af795e7 to
5038680
Compare
5038680 to
ff86b9d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
7.5.3→7.11.0Release Notes
remix-run/react-router (react-router)
v7.11.0Compare Source
Minor Changes
<HydratedRouter onError>/<RouterProvider onError>(#14546)Patch Changes
add support for throwing redirect Response's at RSC render time (#14596)
Support for throwing
data()and Response from server component render phase. Response body is not serialized as async work is not allowed as error encoding phase. If you wish to transmit data to the boundary, throwdata()instead. (#14632)Fix
unstable_useTransitionsprop on<Router>component to permit omission for backewards compatibility (#14646)routeRSCServerRequestreplacefetchServerwithserverResponse(#14597)[UNSTABLE] Add a new
unstable_defaultShouldRevalidateflag to various APIs to allow opt-ing out of standard revalidation behaviors. (#14542)If active routes include a
shouldRevalidatefunction, then your value will be passed asdefaultShouldRevalidatein those function so that the route always has the final revalidation determination.<Form method="post" unstable_defaultShouldRevalidate={false}>submit(data, { method: "post", unstable_defaultShouldRevalidate: false })<fetcher.Form method="post" unstable_defaultShouldRevalidate={false}>fetcher.submit(data, { method: "post", unstable_defaultShouldRevalidate: false })This is also available on non-submission APIs that may trigger revalidations due to changing search params:
<Link to="/" unstable_defaultShouldRevalidate={false}>navigate("/?foo=bar", { unstable_defaultShouldRevalidate: false })setSearchParams(params, { unstable_defaultShouldRevalidate: false })Allow redirects to be returned from client side middleware (#14598)
Handle
dataStrategyimplementations that return insufficient result sets by adding errors for routes without any available result (#14627)v7.10.1Compare Source
Patch Changes
useOptimisticstub we provide for React 18 users to use a stable setter function to avoid potentialuseEffectloops - specifically when using<Link viewTransition>(#14628)v7.10.0Compare Source
Minor Changes
Stabilize
fetcher.reset()(#14545)fetcher.unstable_reset()Stabilize the
dataStrategymatch.shouldRevalidateArgs/match.shouldCallHandler()APIs. (#14592)The
match.shouldLoadAPI is now marked deprecated in favor of these more powerful alternativesIf you're using this API in a custom
dataStrategytoday, you can swap to the new API at your convenience:match.shouldRevalidateArgsis the argument that will be passed to the routeshouldRevaliatefunctionCombined with the parameter accepted by
match.shouldCallHandler, you can define a custom revalidation behavior for yourdataStrategy:Patch Changes
Fix a Framework Mode bug where the
defaultShouldRevalidateparameter toshouldRevalidatewould not be correct afteractionreturned a 4xx/5xx response (truewhen it should have beenfalse) (#14592)shouldRevalidatefunction relied on that parameter, you may have seen unintended revalidationsFix
fetcher.submitfailing with plain objects containing atagNameproperty (#14534)[UNSTABLE] Add
unstable_patternto the parameters for client sideunstable_onError, refactor how it's called byRouterProviderto avoid potential strict mode issues (#14573)Add new
unstable_useTransitionsflag to routers to give users control over the usage ofReact.startTransitionandReact.useOptimistic. (#14524)<HydratedRouter unstable_transition>/<RouterProvider unstable_transition>React.startTransitionReact.startTransitiontrueif you run into this scenario to get the enhanceduseOptimisticbehavior (requires React 19)trueReact.startTransition(as they are without the flag)Link/Formnavigations will be wrapped inReact.startTransitionReact.useOptimistic(i.e.,useNavigation(),useFetchers(), etc.)falseReact.startTransitionorReact.useOptimisticon any navigations or state changes<BrowserRouter unstable_useTransitions>React.startTransitiontrueReact.startTransition(as they are without the flag)Link/Formnavigations will be wrapped inReact.startTransitionfalseReact.startTransitionon any navigations or state changesFix the promise returned from
useNavigatein Framework/Data Mode so that it properly tracks the duration ofpopstatenavigations (i.e.,navigate(-1)) (#14524)Fix internal type error in useRoute types that surfaces when skipLibCheck is disabled (#14577)
Preserve
statusTexton theErrorResponseinstance when throwingdata()from a route handler (#14555)Optimize href() to avoid backtracking regex on splat (#14329)
v7.9.6Compare Source
Patch Changes
[UNSTABLE] Add
location/paramsas arguments to client-sideunstable_onErrorto permit enhanced error reporting. (#14509)unstable_onError. The seconderrorInfoparameter is now an object withlocationandparams:Properly handle ancestor thrown middleware errors before
next()on fetcher submissions (#14517)Fix issue with splat routes interfering with multiple calls to patchRoutesOnNavigation (#14487)
Normalize double-slashes in
resolvePath(#14529)v7.9.5Compare Source
Patch Changes
Move RSCHydratedRouter and utils to
/domexport. (#14457)useRoute: return type-safe
handle(#14462)For example:
Ensure action handlers run for routes with middleware even if no loader is present (#14443)
Add
unstable_instrumentationsAPI to allow users to add observablity 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: [...] })This also adds a new
unstable_patternparameter to loaders/actions/middleware which contains the un-interpolated route pattern (i.e.,/blog/:slug) which is useful for aggregating performance metrics by routev7.9.4Compare Source
Patch Changes
handle external redirects in from server actions (#14400)
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:v7.9.3Compare Source
Patch Changes
Do not try to use
turbo-streamto decode CDN errors that never reached the server (#14385)Fix Data Mode regression causing a 404 during initial load in when
middlewareexists without anyloaderfunctions (#14393)v7.9.2Compare Source
Patch Changes
middlewareon initial load even if no loaders exist (#14348)createRoutesStubto run route middleware<RoutesStub future={{ v8_middleware: true }} />flag to enable the propercontexttypeUpdate Lazy Route Discovery manifest requests to use a singular comma-separated
pathsquery param instead of repeatedpquery params (#14321)[UNSTABLE] Add
fetcher.unstable_reset()API (#14206)Made useOutlet element reference have stable identity in-between route chages (#13382)
feat: enable full transition support for the rsc router (#14362)
In RSC Data Mode, handle SSR'd client errors and re-try in the browser (#14342)
Support
middlewareprop on<Route>for usage with a data router viacreateRoutesFromElements(#14357)Handle encoded question mark and hash characters in ancestor splat routes (#14249)
Fail gracefully on manifest version mismatch logic if
sessionStorageaccess is blocked (#14335)v7.9.1Compare Source
Patch Changes
Futureinterface naming frommiddleware->v8_middleware(#14327)v7.9.0Compare Source
Minor Changes
Stabilize middleware and context APIs. (#14215)
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.
Patch Changes
meta()JSON-LD content (#14316)hreffunction available in a react-server context (#14262)getPayload()is called to allow for "in-context" decoding and hoisting of contextual assets (#14248)href()now correctly processes routes that have an extension after the parameter or are a single optional parameter. (#13797)v7.8.2Compare Source
Patch Changes
[UNSTABLE] Remove Data Mode
future.unstable_middlewareflag fromcreateBrowserRouter(#14213)getLoadContexttype behavior change[UNSTABLE] Add
<RouterProvider unstable_onError>/<HydratedRouter unstable_onError>prop for client side error reporting (#14162)server action revalidation opt out via $SKIP_REVALIDATION field (#14154)
Properly escape interpolated param values in
generatePath()(#13530)Maintain
ReadonlyMapandReadonlySettypes in server response data. (#13092)[UNSTABLE] Delay serialization of
.dataredirects to 202 responses until after middleware chain (#14205)Fix
TypeErrorif you throw frompatchRoutesOnNavigationwhen no partial matches exist (#14198)Fix
basenameusage without a leading slash in data routers (#11671)[UNSTABLE] Update client middleware so it returns the data strategy results allowing for more advanced post-processing middleware (#14151)
v7.8.1Compare Source
Patch Changes
matchPath(#11813)basenameis set withssr:false(#13791)isRouteErrorResponseutility inreact-serverenvironments (#14166)metaandlinksRoute Exports in RSC Data Mode (#14136)data()values toResponseinstances viaResponse.json()in resource routes and middleware (#14159, #14181)v7.8.0Compare Source
Minor Changes
nonceprop toLinks&PrefetchPageLinks(#14048)loaderDataarguments/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
Prevent "Did not find corresponding fetcher result" console error when navigating during a
fetcher.submitrevalidation (#14114)Bubble client-side middleware errors prior to
nextto the appropriate ancestor error boundary (#14138)Switch Lazy Route Discovery manifest URL generation to usea standalone
URLSearchParamsinstance instead ofURL.searchParamsto avoid a major performance bottleneck in Chrome (#14084)Adjust internal RSC usage of
React.useto avoid Webpack compilation errors when using React 18 (#14113)Remove dependency on
@types/nodein TypeScript declaration files (#14059)Fix types for
UIMatchto reflect that theloaderData/dataproperties may beundefined(#12206)ErrorBoundaryis being rendered, not all active matches will have loader data available, since it may have been theirloaderthat threw to trigger the boundaryUIMatch.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.[UNSTABLE] Ensure resource route errors go through
handleErrorw/middleware enabled (#14078)[UNSTABLE] Propagate returned Response from server middleware if next wasn't called (#14093)
[UNSTABLE] Allow server middlewares to return
data()values which will be converted into aResponse(#14093)[UNSTABLE] Update middleware error handling so that the
nextfunction never throws and instead handles any middleware errors at the properErrorBoundaryand returns theResponseup through the ancestornextfunction (#14118)[UNSTABLE] When middleware is enabled, make the
contextparameter read-only (viaReadonly<unstable_RouterContextProvider>) so that TypeScript will not allow you to write arbitrary fields to it in loaders, actions, or middleware. (#14097)[UNSTABLE] Rename and alter the signature/functionality of the
unstable_respondAPI instaticHandler.query/staticHandler.queryRoute(#14103)unstable_generateMiddlewareResponsefor clarityunstable_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 handlingqueryversion of the API now has a signature of(query: (r: Request) => Promise<StaticHandlerContext | Response>) => Promise<Response>queryRouteversion of the API now has a signature of(queryRoute: (r: Request) => Promise<Response>) => Promise<Response>queryand direct error handling of errors thrown from querystaticHandlerunstable_respondAPI[UNSTABLE] Convert internal middleware implementations to use the new
unstable_generateMiddlewareResponseAPI (#14103)[UNSTABLE] Change
getLoadContextsignature (type GetLoadContextFunction) whenfuture.unstable_middlewareis enabled so that it returns anunstable_RouterContextProviderinstance instead of aMapused to contruct the instance internally (#14097)type unstable_InitialContextexportgetLoadContextfunction[UNSTABLE] Run client middleware on client navigations even if no loaders exist (#14106)
[UNSTABLE] Change the
unstable_getContextsignature onRouterProvider/HydratedRouter/unstable_RSCHydratedRouterso that it returns anunstable_RouterContextProviderinstance instead of aMapused to contruct the instance internally (#14097)unstable_getContextprop[UNSTABLE] proxy server action side-effect redirects from actions for document and callServer requests (#14131)
[UNSTABLE] Fix RSC Data Mode issue where routes that return
falsefromshouldRevalidatewould be replaced by an<Outlet />(#14071)v7.7.1Compare Source
Patch Changes
shouldRevalidatereturned false (#14026)Matched leaf route at location "/..." does not have an element or Componentwarnings when error boundaries are rendered. (#14021)v7.7.0Compare Source
Minor Changes
Add unstable RSC support (#13700)
For more information, see the RSC documentation.
Patch Changes
Handle
InvalidCharacterErrorwhen validating cookie signature (#13847)Pass a copy of
searchParamsto thesetSearchParamscallback function to avoid muations of the internalsearchParamsinstance. This was an issue when navigations were blocked because the internal instance be out of sync withuseLocation().search. (#12784)Support invalid
Dateinturbo-streamv2 fork (#13684)In Framework Mode, clear critical CSS in development after initial render (#13872)
Strip search parameters from
patchRoutesOnNavigationpathparam for fetcher calls (#13911)Skip scroll restoration on useRevalidator() calls because they're not new locations (#13671)
Support unencoded UTF-8 routes in prerender config with
ssrset tofalse(#13699)Do not throw if the url hash is not a valid URI component (#13247)
Fix a regression in
createRoutesStubintroduced 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
AppLoadContextAPI. This permittedcreateRoutesStubto work if you were opting into middleware and the updatedcontexttypings, but brokecreateRoutesStubfor users not yet opting into middleware.We've reverted this change and re-implemented it in such a way that both sets of users can leverage it.
createRoutesStubwith the updated API.Remove
Content-Lengthheader from Single Fetch responses (#13902)v7.6.3Compare Source
Patch Changes
Do not serialize types for
useRouteLoaderData<typeof clientLoader>(#13752)For types to distinguish a
clientLoaderfrom aserverLoader, you MUST annotateclientLoaderargs:v7.6.2Compare Source
Patch Changes
with-propschunk in Framework Mode by moving route module component prop logic from the Vite plugin toreact-router(#13650)headers()function processing for use with RSC (#13639)v7.6.1Compare Source
Patch Changes
Update
Route.MetaArgsto reflect thatdatacan be potentiallyundefined(#13563)This is primarily for cases where a route
loaderthrew an error to it's ownErrorBoundary. but it also arises in the case of a 404 which renders the rootErrorBoundary/metabut the root loader did not run because not routes matched.Partially revert optimization added in
7.1.4to reduce calls tomatchRoutesbecause it surfaced other issues (#13562)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.
Better types for
params(#13543)For example:
Previously,
paramsfor theroutes/layout.tsxroute were calculated as{ p: string, l: string }.This incorrectly ignores params that could come from child routes.
If visiting
/parent/1/layout/2/child1/3/4, the actual params passed toroutes/layout.tsxwill have a type of{ p: string, l: 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/layout.tsx:UNSTABLE: renamed internal
react-router/route-moduleexport toreact-router/internalUNSTABLE: removed
Infoexport from generated+types/*filesAvoid initial fetcher execution 404 error when Lazy Route Discovery is interrupted by a navigation (#13564)
href replaces splats
*(#13593)v7.6.0Compare Source
Minor Changes
Added a new
react-router.config.tsrouteDiscoveryoption to configure Lazy Route Discovery behavior. (#13451)/__manifestpath:routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" }routeDiscovery: { mode: "lazy", manifestPath: "/custom-manifest" }routeDiscovery: { mode: "initial" }Add support for route component props in
createRoutesStub. This allows you to unit test your route components using the props instead of the hooks: (#13528)Patch Changes
Fix
react-routermodule augmentation forNodeNext(#13498)Don't bundle
react-routerinreact-router/domCJS export (#13497)Fix bug where a submitting
fetcherwould get stuck in aloadingstate if a revalidatingloaderredirected (#12873)Fix hydration error if a server
loaderreturnedundefined(#13496)Fix initial load 404 scenarios in data mode (#13500)
Stabilize
useRevalidator'srevalidatefunction (#13542)Preserve status code if a
clientActionthrows adata()result in framework mode (#13522)Be defensive against leading double slashes in paths to avoid
Invalid URLerrors from the URL constructor (#13510)new URL("//", window.location.origin)Remove
Navigatordeclaration fornavigator.connection.saveDatato avoid messing with any other types beyondsaveDatain userland (#13512)Fix
handleErrorparamsvalues on.datarequests for routes with a dynamic param as the last URL segment (#13481)Don't trigger an
ErrorBoundaryUI before the reload when we detect a manifest verison mismatch in Lazy Route Discovery (#13480)Inline
[email protected]dependency and fix decoding ordering of Map/Set instances (#13518)Only render dev warnings in DEV mode (#13461)
UNSTABLE: Fix a few bugs with error bubbling in middleware use-cases (#13538)
Short circuit post-processing on aborted
dataStrategyrequests (#13521)Cannot read properties of undefined (reading 'result')Configuration
📅 Schedule: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) in timezone America/New_York, 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.