-
Notifications
You must be signed in to change notification settings - Fork 3
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
fix(deps): update react-router monorepo to v7 (major) #58
base: master
Are you sure you want to change the base?
Conversation
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
683d7d9
to
333edb3
Compare
This PR contains the following updates:
^6.0.0
->^7.0.0
^6.0.0
->^7.0.0
Release Notes
remix-run/react-router (react-router)
v7.0.2
Compare Source
Patch Changes
temporarily only use one build in export map so packages can have a peer dependency on react router (#12437)
Generate wide
matches
andparams
types for current route and child routes (#12397)At runtime,
matches
includes child route matches andparams
include child route path parameters.But previously, we only generated types for parent routes in
matches
; forparams
, we only considered the parent routes and the current route.To align our generated types more closely to the runtime behavior, we now generate more permissive, wider types when accessing child route information.
v7.0.1
Compare Source
v7.0.0
Compare Source
Major Changes
Remove the original
defer
implementation in favor of using raw promises via single fetch andturbo-stream
. This removes these exports from React Router: (#11744)defer
AbortedDeferredError
type TypedDeferredData
UNSAFE_DeferredData
UNSAFE_DEFERRED_SYMBOL
,@remix-run/router
intoreact-router
(#11505)react-router-dom
intoreact-router
@remix-run/server-runtime
intoreact-router
@remix-run/testing
intoreact-router
Remove single_fetch future flag. (#11522)
Drop support for Node 16, React Router SSR now requires Node 18 or higher (#11391)
Remove
future.v7_startTransition
flag (#11696)useNavigate()
useSubmit
useFetcher().load
useFetcher().submit
useRevalidator.revalidate
Remove
future.v7_normalizeFormMethod
future flag (#11697)For Remix consumers migrating to React Router, the
crypto
global from the Web Crypto API is now required when using cookie and session APIs. This means that the following APIs are provided fromreact-router
rather than platform-specific packages: (#11837)createCookie
createCookieSessionStorage
createMemorySessionStorage
createSessionStorage
For consumers running older versions of Node, the
installGlobals
function from@remix-run/node
has been updated to defineglobalThis.crypto
, using Node'srequire('node:crypto').webcrypto
implementation.Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed:
createCookieFactory
createSessionStorageFactory
createCookieSessionStorageFactory
createMemorySessionStorageFactory
Imports/Exports cleanup (#11840)
@remix-run/router
AgnosticDataIndexRouteObject
AgnosticDataNonIndexRouteObject
AgnosticDataRouteMatch
AgnosticDataRouteObject
AgnosticIndexRouteObject
AgnosticNonIndexRouteObject
AgnosticRouteMatch
AgnosticRouteObject
TrackedPromise
unstable_AgnosticPatchRoutesOnMissFunction
Action
-> exported asNavigationType
viareact-router
Router
exported asDataRouter
to differentiate from RR's<Router>
getToPathname
(@private
)joinPaths
(@private
)normalizePathname
(@private
)resolveTo
(@private
)stripBasename
(@private
)createBrowserHistory
-> in favor ofcreateBrowserRouter
createHashHistory
-> in favor ofcreateHashRouter
createMemoryHistory
-> in favor ofcreateMemoryRouter
createRouter
createStaticHandler
-> in favor of wrappercreateStaticHandler
in RR DomgetStaticContextFromError
react-router
Hash
Pathname
Search
update minimum node version to 18 (#11690)
Remove
future.v7_prependBasename
from the ionternalized@remix-run/router
package (#11726)Migrate Remix type generics to React Router (#12180)
Route.*
typesRoute.*
typesuseFetcher
previously had an optional generic (used primarily by Remix v2) that expected the data typetypeof loader
/typeof action
)useFetcher<LoaderData>()
useFetcher<typeof loader>()
Remove
future.v7_throwAbortReason
from internalized@remix-run/router
package (#11728)Add
exports
field to all packages (#11675)node package no longer re-exports from react-router (#11702)
renamed RemixContext to FrameworkContext (#11705)
updates the minimum React version to 18 (#11689)
PrefetchPageDescriptor replaced by PageLinkDescriptor (#11960)
@remix-run/router
,@remix-run/server-runtime
, and@remix-run/react
now that they all live inreact-router
(#12177)LoaderFunction
,LoaderFunctionArgs
,ActionFunction
,ActionFunctionArgs
,DataFunctionArgs
,RouteManifest
,LinksFunction
,Route
,EntryRoute
RouteManifest
type used by the "remix" code is now slightly stricter because it is using the former@remix-run/router
RouteManifest
Record<string, Route> -> Record<string, Route | undefined>
AppData
type in favor of inliningunknown
in the few locations it was usedServerRuntimeMeta*
types in favor of theMeta*
types they were duplicated fromfuture.v7_partialHydration
flag (#11725)<RouterProvider fallbackElement>
propfallbackElement
to ahydrateFallbackElement
/HydrateFallback
on your root routefuture.v7_partialHydration
(when usingfallbackElement
),state.navigation
was populated during the initial loadfuture.v7_partialHydration
,state.navigation
remains in an"idle"
state during the initial loadRemove
v7_relativeSplatPath
future flag (#11695)Drop support for Node 18, update minimum Node vestion to 20 (#12171)
installGlobals()
as this should no longer be necessaryRemove remaining future flags (#11820)
v7_skipActionErrorRevalidation
v3_fetcherPersist
,v3_relativeSplatPath
,v3_throwAbortReason
rename createRemixStub to createRoutesStub (#11692)
Remove
@remix-run/router
deprecateddetectErrorBoundary
option in favor ofmapRouteProperties
(#11751)Add
react-router/dom
subpath export to properly enablereact-dom
as an optionalpeerDependency
(#11851)import ReactDOM from "react-dom"
in<RouterProvider>
in order to accessReactDOM.flushSync()
, since that would breakcreateMemoryRouter
use cases in non-DOM environmentsreact-router/dom
to get the proper component that makesReactDOM.flushSync()
available:entry.client.tsx
:import { HydratedRouter } from 'react-router/dom'
createBrowserRouter
/createHashRouter
:import { RouterProvider } from "react-router/dom"
Remove
future.v7_fetcherPersist
flag (#11731)Update
cookie
dependency to^1.0.1
- please see the release notes for any breaking changes (#12172)Minor Changes
prerender
config in the React Router vite plugin, to support existing SSG use-cases (#11539)prerender
config to pre-render your.html
and.data
files at build time and then serve them statically at runtime (either from a running server or a CDN)prerender
can either be an array of string paths, or a function (sync or async) that returns an array of strings so that you can dynamically generate the paths by talking to your CMS, etc.Params, loader data, and action data as props for route component exports (#11961)
Remove duplicate
RouterProvider
impliementations (#11679)Typesafety improvements (#12019)
React Router now generates types for each of your route modules.
You can access those types by importing them from
./+types.<route filename without extension>
.For example:
This initial implementation targets type inference for:
Params
: Path parameters from your routing config inroutes.ts
including file-based routingLoaderData
: Loader data fromloader
and/orclientLoader
within your route moduleActionData
: Action data fromaction
and/orclientAction
within your route moduleIn the future, we plan to add types for the rest of the route module exports:
meta
,links
,headers
,shouldRevalidate
, etc.We also plan to generate types for typesafe
Link
s:Check out our docs for more:
Stabilize
unstable_dataStrategy
(#11969)Stabilize
unstable_patchRoutesOnNavigation
(#11970)Patch Changes
No changes (
506329c4e
)chore: re-enable development warnings through a
development
exports condition. (#12269)Remove unstable upload handler. (#12015)
Remove unneeded dependency on @web3-storage/multipart-parser (#12274)
Fix redirects returned from loaders/actions using
data()
(#12021)fix(react-router): (v7) fix static prerender of non-ascii characters (#12161)
Replace
substr
withsubstring
(#12080)Remove the deprecated
json
utility (#12146)Response.json
if you still need to construct JSON responses in your appRemove unneeded dependency on source-map (#12275)
v6.28.0
Compare Source
Minor Changes
json
/defer
in favor of returning raw objectsPatch Changes
@remix-run/[email protected]
v6.27.0
: v6.27.0Compare Source
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v6270
v6.26.2
Compare Source
Patch Changes
@remix-run/[email protected]
v6.26.1
Compare Source
v6.26.0
Compare Source
Minor Changes
replace(url, init?)
alternative toredirect(url, init?)
that performs ahistory.replaceState
instead of ahistory.pushState
on client-side navigation redirects (#11811)Patch Changes
future.v7_partialHydration
along withunstable_patchRoutesOnMiss
(#11838)router.state.matches
will now include any partial matches so that we can render ancestorHydrateFallback
components@remix-run/[email protected]
v6.25.1
: v6.25.1Compare Source
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v6251
v6.25.0
Compare Source
Minor Changes
Stabilize
future.unstable_skipActionErrorRevalidation
asfuture.v7_skipActionErrorRevalidation
(#11769)Response
with a4xx
/5xx
status codeshouldRevalidate
shouldRevalidate
'sunstable_actionStatus
parameter toactionStatus
Patch Changes
useMatch
so matches/params reflect decoded params (#11789)@remix-run/[email protected]
v6.24.1
Compare Source
Patch Changes
future.v7_relativeSplatPath
, properly resolve relative paths in splat routes that are children of pathless routes (#11633)@remix-run/[email protected]
v6.24.0
Compare Source
Minor Changes
Add support for Lazy Route Discovery (a.k.a. Fog of War) (#11626)
unstable_patchRoutesOnMiss
docs: https://reactrouter.com/en/main/routers/create-browser-routerPatch Changes
@remix-run/[email protected]
v6.23.1
Compare Source
Patch Changes
<Await>
(#11513)@remix-run/[email protected]
v6.23.0
Compare Source
Minor Changes
unstable_dataStrategy
configuration option (#11098)Patch Changes
@remix-run/[email protected]
v6.22.3
Compare Source
Patch Changes
@remix-run/[email protected]
v6.22.2
Compare Source
Patch Changes
@remix-run/[email protected]
v6.22.1
: v6.22.1Compare Source
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v6221
v6.22.0
Compare Source
Patch Changes
@remix-run/[email protected]
v6.21.3
Compare Source
Patch Changes
unstable_
prefix fromBlocker
/BlockerFunction
types (#11187)v6.21.2
Compare Source
v6.21.1
Compare Source
Patch Changes
route.lazy
not working correctly on initial SPA load whenv7_partialHydration
is specified (#11121)@remix-run/[email protected]
v6.21.0
Compare Source
Minor Changes
Add a new
future.v7_relativeSplatPath
flag to implement a breaking bug fix to relative routing when inside a splat route. (#11087)This fix was originally added in #10983 and was later reverted in #11078 because it was determined that a large number of existing applications were relying on the buggy behavior (see #11052)
The Bug
The buggy behavior is that without this flag, the default behavior when resolving relative paths is to ignore any splat (
*
) portion of the current route path.The Background
This decision was originally made thinking that it would make the concept of nested different sections of your apps in
<Routes>
easier if relative routing would replace the current splat:Any paths like
/dashboard
,/dashboard/team
,/dashboard/projects
will match theDashboard
route. The dashboard component itself can then render nested<Routes>
:Now, all links and route paths are relative to the router above them. This makes code splitting and compartmentalizing your app really easy. You could render the
Dashboard
as its own independent app, or embed it into your large app without making any changes to it.The Problem
The problem is that this concept of ignoring part of a path breaks a lot of other assumptions in React Router - namely that
"."
always means the current location pathname for that route. When we ignore the splat portion, we start getting invalid paths when using"."
:We've also introduced an issue that we can no longer move our
DashboardTeam
component around our route hierarchy easily - since it behaves differently if we're underneath a non-splat route, such as/dashboard/:widget
. Now, our"."
links will, properly point to ourself inclusive of the dynamic param value so behavior will break from it's corresponding usage in a/dashboard/*
route.Even worse, consider a nested splat route configuration:
Now, a
<Link to=".">
and a<Link to="..">
inside theDashboard
component go to the same place! That is definitely not correct!Another common issue arose in Data Routers (and Remix) where any
<Form>
should post to it's own routeaction
if you the user doesn't specify a form action:This is just a compounded issue from the above because the default location for a
Form
to submit to is itself ("."
) - and if we ignore the splat portion, that now resolves to the parent route.The Solution
If you are leveraging this behavior, it's recommended to enable the future flag, move your splat to it's own route, and leverage
../
for any links to "sibling" pages:This way,
.
means "the full current pathname for my route" in all cases (including static, dynamic, and splat routes) and..
always means "my parents pathname".Patch Changes
@remix-run/[email protected]
v6.20.1
Compare Source
Patch Changes
useResolvedPath
fix for splat routes due to a large number of applications that were relying on the buggy behavior (see https://github.com/remix-run/react-router/issues/11052#issuecomment-1836589329). We plan to re-introduce this fix behind a future flag in the next minor version. (#11078)@remix-run/[email protected]
v6.20.0
Compare Source
Minor Changes
PathParam
type from the public API (#10719)Patch Changes
resolveTo
in splat routes (#11045)getPathContributingMatches
UNSAFE_getPathContributingMatches
export from@remix-run/router
since we no longer need this in thereact-router
/react-router-dom
layers@remix-run/[email protected]
remix-run/react-router (react-router-dom)
v7.0.2
Compare Source
Patch Changes
[email protected]
v7.0.1
Compare Source
Patch Changes
[email protected]
v7.0.0
Compare Source
Major Changes
Remove the original
defer
implementation in favor of using raw promises via single fetch andturbo-stream
. This removes these exports from React Router: (#11744)defer
AbortedDeferredError
type TypedDeferredData
UNSAFE_DeferredData
UNSAFE_DEFERRED_SYMBOL
,Use
createRemixRouter
/RouterProvider
inentry.client
instead ofRemixBrowser
(#11469)Remove single_fetch future flag. (#11522)
Remove
future.v7_startTransition
flag (#11696)Remove
future.v7_normalizeFormMethod
future flag (#11697)Allow returning
undefined
from actions and loaders (#11680)update minimum node version to 18 (#11690)
Remove
future.v7_prependBasename
from the ionternalized@remix-run/router
package (#11726)Remove
future.v7_throwAbortReason
from internalized@remix-run/router
package (#11728)Add
exports
field to all packages (#11675)node package no longer re-exports from react-router (#11702)
updates the minimum React version to 18 (#11689)
future.v7_partialHydration
flag (#11725)<RouterProvider fallbackElement>
propfallbackElement
to ahydrateFallbackElement
/HydrateFallback
on your root routefuture.v7_partialHydration
(when usingfallbackElement
),state.navigation
was populated during the initial loadfuture.v7_partialHydration
,state.navigation
remains in an"idle"
state during the initial loadRemove
future.v7_fetcherPersist
flag (#11731)Minor Changes
Link
/NavLink
when using Remix SSR (#11402)ScrollRestoration
so it can restore properly on an SSR'd document load (#11401)RouterProvider
. When running from a Remix-SSR'd HTML payload with the properwindow
variables (__remixContext
,__remixManifest
,__remixRouteModules
), you don't need to pass arouter
prop andRouterProvider
will create therouter
for you internally. (#11396) (#11400)Patch Changes
RouterProvider
internals to reduce uneccesary re-renders (#11817)[email protected]
v6.28.0
Compare Source
Minor Changes
json
/defer
in favor of returning raw objectsPatch Changes
[email protected]
@remix-run/[email protected]
v6.27.0
Compare Source
v6.26.2
Compare Source
v6.26.1
Compare Source
v6.26.0
Compare Source
Minor Changes
replace(url, init?)
alternative toredirect(url, init?)
that performs ahistory.replaceState
instead of ahistory.pushState
on client-side navigation redirects (#11811)Patch Changes
future.v7_partialHydration
along withunstable_patchRoutesOnMiss
(#11838)router.state.matches
will now include any partial matches so that we can render ancestorHydrateFallback
components@remix-run/[email protected]
[email protected]
v6.25.1
Compare Source
Patch Changes
RouterProvider
internals to reduce unnecessary re-renders (#11803)[email protected]
v6.25.0
Compare Source
Minor Changes
Stabilize
future.unstable_skipActionErrorRevalidation
asfuture.v7_skipActionErrorRevalidation
(#11769)Response
with a4xx
/5xx
status codeshouldRevalidate
shouldRevalidate
'sunstable_actionStatus
parameter toactionStatus
Patch Changes
[email protected]
@remix-run/[email protected]
v6.24.1
Compare Source
Patch Changes
polyfill.io
reference from warning message because the domain was sold and has since been determined to serve malware (#11741)NavLinkRenderProps
type for easier typing of customNavLink
callback (#11553)@remix-run/[email protected]
[email protected]
v6.24.0
Compare Source
Minor Changes
Add support for Lazy Route Discovery (a.k.a. Fog of War) (#11626)
unstable_patchRoutesOnMiss
docs: https://reactrouter.com/en/main/routers/create-browser-routerPatch Changes
fetcher.submit
types - remove incorrectnavigate
/fetcherKey
/unstable_viewTransition
options because they are only relevant foruseSubmit
(#11631)location.state
values passed to<StaticRouter>
(#11495)[email protected]
@remix-run/[email protected]
v6.23.1
Compare Source
Patch Changes
document
existence when checkingstartViewTransition
(#11544)react-router-dom/server
import back toreact-router-dom
instead ofindex.ts
(#11514)@remix-run/[email protected]
[email protected]
v6.23.0
Compare Source
Minor Changes
unstable_dataStrategy
configuration option (#11098)Patch Changes
@remix-run/[email protected]
[email protected]
v6.22.3
Compare Source
Patch Changes
@remix-run/[email protected]
[email protected]
v6.22.2
Compare Source
Patch Changes
@remix-run/[email protected]
[email protected]
v6.22.1
Compare Source
v6.22.0
Compare Source
Minor Changes
window__reactRouterVersion
tag for CWV Report detection (#11222)Patch Changes
@remix-run/[email protected]
[email protected]
v6.21.3
Compare Source
Patch Changes
NavLink
isPending
when abasename
is used (#11195)unstable_
prefix fromBlocker
/BlockerFunction
types (#11187)[email protected]
v6.21.2
Compare Source
v6.21.1
Compare Source
Patch Changes
[email protected]
@remix-run/[email protected]
v6.21.0
Compare Source
Minor Changes
Add a new
future.v7_relativeSplatPath
flag to implement a breaking bug fix to relative routing when inside a splat route. (#11087)This fix was originally added in #10983 and was later reverted in #11078 because it was determined that a large number of existing applications were relying on the buggy behavior (see #11052)
The Bug
The buggy behavior is that without this flag, the default behavior when resolving relative paths is to ignore any splat (
*
) portion of the current route path.The Background
This decision was originally made thinking that it would make the concept of nested different sections of your apps in
<Routes>
easier if relative routing would replace the current splat:Any paths like
/dashboard
,/dashboard/team
,/dashboard/projects
will match theDashboard
route. The dashboard component itself can then render nested<Routes>
:Now, all links and route paths are relative to the router above them. This makes code splitting and compartmentalizing your app really easy. You could render the
Dashboard
as its own independent app, or embed it into your large app without making any changes to it.The Problem
The problem is that this concept of ignoring part of a path breaks a lot of other assumptions in React Router - namely that
"."
always means the current location pathname for that route. When we ignore the splat portion, we start getting invalid paths when using"."
:We've also introduced an issue that we can no longer move our
DashboardTeam
component around our route hierarchy easily - since it behaves differently if we're underneath a non-splat route, such as/dashboard/:widget
. Now, our"."
links will, properly point to ourself inclusive of the dynamic param value so behavior will break from it's corresponding usage in a/dashboard/*
route.Even worse, consider a nested splat route configuration:
Now, a
<Link to=".">
and a<Link to="..">
inside theDashboard
component go to the same place! That is definitely not correct!Another common issue arose in Data Routers (and Remix) where any
<Form>
should post to it's own routeaction
if you the user doesn't specify a form action:This is just a compounded issue from the above because the default location for a
Form
to submit to is itself ("."
) - and if we ignore the splat portion, that now resolves to the parent route.The Solution
If you are leveraging this behavior, it's recommended to enable the future flag, move your splat to it's own route, and leverage
../
for any links to "sibling" pages:This way,
.
means "the full current pathname for my route" in all cases (including static, dynamic, and splat routes) and..
always means "my parents pathname".Patch Changes
@remix-run/[email protected]
[email protected]
v6.20.1
Compare Source
Patch Changes
useResolvedPath
fix for splat routes due to a large number of applications that were relying on the buggy behavior (see https://github.com/remix-run/react-router/issues/11052#issuecomment-1836589329). We plan to re-introduce this fix behind a future flag in the next minor version. (#11078)[email protected]
@remix-run/[email protected]
v6.20.0
Compare Source
Minor Changes
PathParam
type from the public API (#10719)Patch Changes
[email protected]
@remix-run/[email protected]
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), 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 these updates again.
This PR was generated by Mend Renovate. View the repository job log.