fix(deps): update react-router monorepo to v7.6.0 #144
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "renovate/react-router-monorepo"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
7.2.0
->7.6.0
7.2.0
->7.6.0
Release Notes
remix-run/react-router (react-router)
v7.6.0
Compare Source
Minor Changes
Added a new
react-router.config.ts
routeDiscovery
option to configure Lazy Route Discovery behavior. (#13451)/__manifest
path: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-router
module augmentation forNodeNext
(#13498)Don't bundle
react-router
inreact-router/dom
CJS export (#13497)Fix bug where a submitting
fetcher
would get stuck in aloading
state if a revalidatingloader
redirected (#12873)Fix hydration error if a server
loader
returnedundefined
(#13496)Fix initial load 404 scenarios in data mode (#13500)
Stabilize
useRevalidator
'srevalidate
function (#13542)Preserve status code if a
clientAction
throws adata()
result in framework mode (#13522)Be defensive against leading double slashes in paths to avoid
Invalid URL
errors from the URL constructor (#13510)new URL("//", window.location.origin)
Remove
Navigator
declaration fornavigator.connection.saveData
to avoid messing with any other types beyondsaveData
in userland (#13512)Fix
handleError
params
values on.data
requests for routes with a dynamic param as the last URL segment (#13481)Don't trigger an
ErrorBoundary
UI before the reload when we detect a manifest verison mismatch in Lazy Route Discovery (#13480)Inline
turbo-stream@2.4.1
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
dataStrategy
requests (#13521)Cannot read properties of undefined (reading 'result')
v7.5.3
Compare Source
Patch Changes
loaderData
being cleared at the handlingErrorBoundary
route (#13476)clientLoader.hydrate
initial load executions (#13477)v7.5.2
Compare Source
Patch Changes
Update Single Fetch to also handle the 204 redirects used in
?_data
requests in Remix v2 (#13364).data
requests from outside the scope of React Router (i.e., anexpress
/hono
middleware)Adjust approach for Prerendering/SPA Mode via headers (#13453)
v7.5.1
Compare Source
Patch Changes
Fix single fetch bug where no revalidation request would be made when navigating upwards to a reused parent route (#13253)
When using the object-based
route.lazy
API, theHydrateFallback
andhydrateFallbackElement
properties are now skipped when lazy loading routes after hydration. (#13376)If you move the code for these properties into a separate file, you can use this optimization to avoid downloading unused hydration code. For example:
Properly revalidate prerendered paths when param values change (#13380)
UNSTABLE: Add a new
unstable_runClientMiddleware
argument todataStrategy
to enable middleware execution in customdataStrategy
implementations (#13395)UNSTABLE: Add better error messaging when
getLoadContext
is not updated to return aMap
" (#13242)Do not automatically add
null
tostaticHandler.query()
context.loaderData
if routes do not have loaders (#13223)undefined
from loaders, our prior check ofloaderData[routeId] !== undefined
was no longer sufficient and was changed to arouteId in loaderData
check - thesenull
values can cause issues for this new checkcreateStaticHandler()
/<StaticRouterProvider>
, and usingcontext.loaderData
to control<RouterProvider>
hydration behavior on the clientFix prerendering when a loader returns a redirect (#13365)
UNSTABLE: Update context type for
LoaderFunctionArgs
/ActionFunctionArgs
when middleware is enabled (#13381)Add support for the new
unstable_shouldCallHandler
/unstable_shouldRevalidateArgs
APIs indataStrategy
(#13253)v7.5.0
Compare Source
Minor Changes
Add granular object-based API for
route.lazy
to support lazy loading of individual route properties, for example: (#13294)Breaking change for
route.unstable_lazyMiddleware
consumersThe
route.unstable_lazyMiddleware
property is no longer supported. If you want to lazily load middleware, you must use the new object-basedroute.lazy
API withroute.lazy.unstable_middleware
, for example:Patch Changes
unstable_subResourceIntegrity
future flag that enables generation of an importmap with integrity for the scripts that will be loaded by the browser. (#13163)v7.4.1
Compare Source
Patch Changes
Fix types on
unstable_MiddlewareFunction
to avoid type errors when a middleware doesn't return a value (#13311)Dedupe calls to
route.lazy
functions (#13260)Add support for
route.unstable_lazyMiddleware
function to allow lazy loading of middleware logic. (#13210)Breaking change for
unstable_middleware
consumersThe
route.unstable_middleware
property is no longer supported in the return value fromroute.lazy
. If you want to lazily load middleware, you must useroute.unstable_lazyMiddleware
.v7.4.0
Compare Source
Patch Changes
shouldRevalidate
behavior forclientLoader
-only routes inssr:true
apps (#13221)RequestHandler
loadContext
parameter type when middleware is enabled (#13204)Route.unstable_MiddlewareFunction
to have a return value ofResponse | undefined
instead ofResponse | void
becaue you should not return anything if you aren't returning theResponse
(#13199)next()
and are no longer leaking theMiddlewareError
implementation detail (#13180)v7.3.0
Compare Source
Minor Changes
Add
fetcherKey
as a parameter topatchRoutesOnNavigation
(#13061)fetcher
calls to undiscovered routes, this mismatch will trigger a document reload of the current pathPatch Changes
Skip resource route flow in dev server in SPA mode (#13113)
Support middleware on routes (unstable) (#12941)
Middleware is implemented behind a
future.unstable_middleware
flag. To enable, you must enable the flag and the types in yourreact-router-config.ts
file:⚠️ Middleware is unstable and should not be adopted in production. There is at least one known de-optimization in route module loading for
clientMiddleware
that we will be addressing this before a stable release.⚠️ Enabling middleware contains a breaking change to the
context
parameter passed to yourloader
/action
functions - see below for more information.Once enabled, routes can define an array of middleware functions that will run sequentially before route handlers run. These functions accept the same parameters as
loader
/action
plus an additionalnext
parameter to run the remaining data pipeline. This allows middlewares to perform logic before and after handlers execute.Here's a simple example of a client-side logging middleware that can be placed on the root route:
Note that in the above example, the
next
/middleware
functions don't return anything. This is by design as on the client there is no "response" to send over the network like there would be for middlewares running on the server. The data is all handled behind the scenes by the statefulrouter
.For a server-side middleware, the
next
function will return the HTTPResponse
that React Router will be sending across the wire, thus giving you a chance to make changes as needed. You may throw a new response to short circuit and respond immediately, or you may return a new or altered response to override the default returned bynext()
.You can throw a
redirect
from a middleware to short circuit any remaining processing:Note that in cases like this where you don't need to do any post-processing you don't need to call the
next
function or return aResponse
.Here's another example of using a server middleware to detect 404s and check the CMS for a redirect:
context
parameterWhen middleware is enabled, your application will use a different type of
context
parameter in your loaders and actions to provide better type safety. Instead ofAppLoadContext
,context
will now be an instance ofContextProvider
that you can use with type-safe contexts (similar toReact.createContext
):If you are using a custom server with a
getLoadContext
function, the return value for initial context values passed from the server adapter layer is no longer an object and should now return anunstable_InitialContext
(Map<RouterContext, unknown>
):Fix types for loaderData and actionData that contained
Record
s (#13139)UNSTABLE(BREAKING):
unstable_SerializesTo
added a way to register custom serialization types in Single Fetch for other library and framework authors like Apollo.It was implemented with branded type whose branded property that was made optional so that casting arbitrary values was easy:
However, this broke type inference in
loaderData
andactionData
for anyRecord
types as those would now (incorrectly) matchunstable_SerializesTo
.This affected all users, not just those that depended on
unstable_SerializesTo
.To fix this, the branded property of
unstable_SerializesTo
is marked as required instead of optional.For library and framework authors using
unstable_SerializesTo
, you may need to addas unknown
casts before casting tounstable_SerializesTo
.[REMOVE] Remove middleware depth logic and always call middlware for all matches (#13172)
Fix single fetch
_root.data
requests when abasename
is used (#12898)Add
context
support to client side data routers (unstable) (#12941)Your application
loader
andaction
functions on the client will now receive acontext
parameter. This is an instance ofunstable_RouterContextProvider
that you use with type-safe contexts (similar toReact.createContext
) and is most useful with the correspondingmiddleware
/clientMiddleware
API's:Similar to server-side requests, a fresh
context
will be created per navigation (orfetcher
call). If you have initial data you'd like to populate in the context for every request, you can provide anunstable_getContext
function at the root of your app:createBrowserRouter(routes, { unstable_getContext })
<HydratedRouter unstable_getContext>
This function should return an value of type
unstable_InitialContext
which is aMap<unstable_RouterContext, unknown>
of context's and initial values:remix-run/react-router (react-router-dom)
v7.6.0
Compare Source
Patch Changes
react-router@7.6.0
v7.5.3
Compare Source
Patch Changes
react-router@7.5.3
v7.5.2
Compare Source
Patch Changes
react-router@7.5.2
v7.5.1
Compare Source
Patch Changes
react-router@7.5.1
v7.5.0
Compare Source
Patch Changes
react-router@7.5.0
v7.4.1
Compare Source
Patch Changes
react-router@7.4.1
v7.4.0
Compare Source
Patch Changes
react-router@7.4.0
v7.3.0
Compare Source
Patch Changes
react-router@7.3.0
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Renovate Bot.
4a806a2395
to99c6432dc3
fix(deps): update react-router monorepo to v7.4.0to fix(deps): update react-router monorepo to v7.4.199c6432dc3
to4418e1917a
fix(deps): update react-router monorepo to v7.4.1to fix(deps): update react-router monorepo to v7.5.04418e1917a
to1cc6f68307
fix(deps): update react-router monorepo to v7.5.0to fix(deps): update react-router monorepo to v7.5.11cc6f68307
to3f1d8eb808
fix(deps): update react-router monorepo to v7.5.1to fix(deps): update react-router monorepo to v7.5.23f1d8eb808
to5f8adf001f
fix(deps): update react-router monorepo to v7.5.2to fix(deps): update react-router monorepo to v7.5.35f8adf001f
tocb061776a0
fix(deps): update react-router monorepo to v7.5.3to fix(deps): update react-router monorepo to v7.6.0Checkout
From your project repository, check out a new branch and test the changes.