fix(deps): update react-router monorepo to v6.30.2
This PR contains the following updates:
| Package | Change | Age | Confidence |
|---|---|---|---|
| react-router (source) | 6.15.0 -> 6.30.2 |
||
| react-router-dom (source) | 6.15.0 -> 6.30.2 |
Release Notes
remix-run/react-router (react-router)
v6.30.2: v6.30.2
See the changelog for release notes: https://github.com/remix-run/react-router/blob/v6/CHANGELOG.md#v6302
v6.30.1: v6.30.1
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v6301
v6.30.0: v6.30.0
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v6300
v6.29.0: v6.29.0
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v6290
v6.28.2: v6.28.2
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v6282
v6.28.1: v6.28.1
See the changelog for release notes: https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v6281
v6.28.0
Minor Changes
-
- Log deprecation warnings for v7 flags (#11750)
- Add deprecation warnings to
json/deferin favor of returning raw objects- These methods will be removed in React Router v7
Patch Changes
- Update JSDoc URLs for new website structure (add /v6/ segment) (#12141)
- Updated dependencies:
-
@remix-run/[email protected]
-
v6.27.0
Minor Changes
- Stabilize
unstable_patchRoutesOnNavigation(#11973)- Add new
PatchRoutesOnNavigationFunctionArgstype for convenience (#11967)
- Add new
- Stabilize
unstable_dataStrategy(#11974) - Stabilize the
unstable_flushSyncoption for navigations and fetchers (#11989) - Stabilize the
unstable_viewTransitionoption for navigations and the correspondingunstable_useViewTransitionStatehook (#11989)
Patch Changes
-
Fix bug when submitting to the current contextual route (parent route with an index child) when an
?indexparam already exists from a prior submission (#12003) -
Fix
useFormActionbug - when removing?indexparam it would not keep other non-Remixindexparams (#12003) -
Fix types for
RouteObjectwithinPatchRoutesOnNavigationFunction'spatchmethod so it doesn't expect agnostic route objects passed topatch(#11967) -
Updated dependencies:
-
@remix-run/[email protected]
-
v6.26.2
Patch Changes
- Updated dependencies:
-
@remix-run/[email protected]
-
v6.26.1
Patch Changes
- Rename
unstable_patchRoutesOnMisstounstable_patchRoutesOnNavigationto match new behavior (#11888) - Updated dependencies:
-
@remix-run/[email protected]
-
v6.26.0
Minor Changes
- Add a new
replace(url, init?)alternative toredirect(url, init?)that performs ahistory.replaceStateinstead of ahistory.pushStateon client-side navigation redirects (#11811)
Patch Changes
- Fix initial hydration behavior when using
future.v7_partialHydrationalong withunstable_patchRoutesOnMiss(#11838)- During initial hydration,
router.state.matcheswill now include any partial matches so that we can render ancestorHydrateFallbackcomponents
- During initial hydration,
- Updated dependencies:
-
@remix-run/[email protected]
-
v6.25.1
No significant changes to this package were made in this release. See the repo CHANGELOG.md for an overview of all changes in v6.25.1.
v6.25.0
Minor Changes
- Stabilize
future.unstable_skipActionErrorRevalidationasfuture.v7_skipActionErrorRevalidation(#11769)- When this flag is enabled, actions will not automatically trigger a revalidation if they return/throw a
Responsewith a4xx/5xxstatus code - You may still opt-into revalidation via
shouldRevalidate - This also changes
shouldRevalidate'sunstable_actionStatusparameter toactionStatus
- When this flag is enabled, actions will not automatically trigger a revalidation if they return/throw a
Patch Changes
- Fix regression and properly decode paths inside
useMatchso matches/params reflect decoded params (#11789) - Updated dependencies:
-
@remix-run/[email protected]
-
v6.24.1
Patch Changes
- When using
future.v7_relativeSplatPath, properly resolve relative paths in splat routes that are children of pathless routes (#11633) - Updated dependencies:
-
@remix-run/[email protected]
-
v6.24.0
Minor Changes
- Add support for Lazy Route Discovery (a.k.a. Fog of War) (#11626)
- RFC: https://redirect.github.com/remix-run/react-router/discussions/11113
-
unstable_patchRoutesOnMissdocs: https://reactrouter.com/v6/routers/create-browser-router
Patch Changes
- Updated dependencies:
-
@remix-run/[email protected]
-
v6.23.1
Patch Changes
- allow undefined to be resolved with
<Await>(#11513) - Updated dependencies:
-
@remix-run/[email protected]
-
v6.23.0
Minor Changes
- Add a new
unstable_dataStrategyconfiguration option (#11098)- This option allows Data Router applications to take control over the approach for executing route loaders and actions
- The default implementation is today's behavior, to fetch all loaders in parallel, but this option allows users to implement more advanced data flows including Remix single-fetch, middleware/context APIs, automatic loader caching, and more
Patch Changes
- Updated dependencies:
-
@remix-run/[email protected]
-
v6.22.3
Patch Changes
- Updated dependencies:
-
@remix-run/[email protected]
-
v6.22.2
Patch Changes
- Updated dependencies:
-
@remix-run/[email protected]
-
v6.22.1
Patch Changes
- Fix encoding/decoding issues with pre-encoded dynamic parameter values (#11199)
- Updated dependencies:
-
@remix-run/[email protected]
-
v6.22.0
Patch Changes
- Updated dependencies:
-
@remix-run/[email protected]
-
v6.21.3
Patch Changes
- Remove leftover
unstable_prefix fromBlocker/BlockerFunctiontypes (#11187)
v6.21.2
Patch Changes
- Updated dependencies:
-
@remix-run/[email protected]
-
v6.21.1
Patch Changes
- Fix bug with
route.lazynot working correctly on initial SPA load whenv7_partialHydrationis specified (#11121) - Updated dependencies:
-
@remix-run/[email protected]
-
v6.21.0
Minor Changes
-
Add a new
future.v7_relativeSplatPathflag 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:<BrowserRouter> <Routes> <Route path="/" element={<Home />} /> <Route path="dashboard/*" element={<Dashboard />} /> </Routes> </BrowserRouter>Any paths like
/dashboard,/dashboard/team,/dashboard/projectswill match theDashboardroute. The dashboard component itself can then render nested<Routes>:function Dashboard() { return ( <div> <h2>Dashboard</h2> <nav> <Link to="/">Dashboard Home</Link> <Link to="team">Team</Link> <Link to="projects">Projects</Link> </nav> <Routes> <Route path="/" element={<DashboardHome />} /> <Route path="team" element={<DashboardTeam />} /> <Route path="projects" element={<DashboardProjects />} /> </Routes> </div> ); }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
Dashboardas 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".":// If we are on URL /dashboard/team, and we want to link to /dashboard/team: function DashboardTeam() { // ❌ This is broken and results in <a href="/dashboard"> return <Link to=".">A broken link to the Current URL</Link>; // ✅ This is fixed but super unintuitive since we're already at /dashboard/team! return <Link to="./team">A broken link to the Current URL</Link>; }We've also introduced an issue that we can no longer move our
DashboardTeamcomponent 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:
<BrowserRouter> <Routes> <Route path="dashboard"> <Route path="*" element={<Dashboard />} /> </Route> </Routes> </BrowserRouter>Now, a
<Link to=".">and a<Link to="..">inside theDashboardcomponent 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 routeactionif you the user doesn't specify a form action:let router = createBrowserRouter({ path: "/dashboard", children: [ { path: "*", action: dashboardAction, Component() { // ❌ This form is broken! It throws a 405 error when it submits because // it tries to submit to /dashboard (without the splat value) and the parent // `/dashboard` route doesn't have an action return <Form method="post">...</Form>; }, }, ], });This is just a compounded issue from the above because the default location for a
Formto 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:<BrowserRouter> <Routes> <Route path="dashboard"> <Route index path="*" element={<Dashboard />} /> </Route> </Routes> </BrowserRouter> function Dashboard() { return ( <div> <h2>Dashboard</h2> <nav> <Link to="..">Dashboard Home</Link> <Link to="../team">Team</Link> <Link to="../projects">Projects</Link> </nav> <Routes> <Route path="/" element={<DashboardHome />} /> <Route path="team" element={<DashboardTeam />} /> <Route path="projects" element={<DashboardProjects />} /> </Router> </div> ); }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
- Properly handle falsy error values in ErrorBoundary's (#11071)
- Updated dependencies:
-
@remix-run/[email protected]
-
v6.20.1
Patch Changes
- Revert the
useResolvedPathfix for splat routes due to a large number of applications that were relying on the buggy behavior (see #11052 (comment)). We plan to re-introduce this fix behind a future flag in the next minor version. (#11078) - Updated dependencies:
-
@remix-run/[email protected]
-
v6.20.0
Minor Changes
- Export the
PathParamtype from the public API (#10719)
Patch Changes
- Fix bug with
resolveToin splat routes (#11045)- This is a follow up to #10983 to handle the few other code paths using
getPathContributingMatches - This removes the
UNSAFE_getPathContributingMatchesexport from@remix-run/routersince we no longer need this in thereact-router/react-router-domlayers
- This is a follow up to #10983 to handle the few other code paths using
- Updated dependencies:
-
@remix-run/[email protected]
-
v6.19.0
Minor Changes
- Add
unstable_flushSyncoption touseNavigate/useSumbit/fetcher.load/fetcher.submitto opt-out ofReact.startTransitionand intoReactDOM.flushSyncfor state updates (#11005) - Remove the
unstable_prefix from theuseBlockerhook as it's been in use for enough time that we are confident in the API. We do not plan to remove the prefix fromunstable_usePromptdue to differences in how browsers handlewindow.confirmthat prevent React Router from guaranteeing consistent/correct behavior. (#10991)
Patch Changes
-
Fix
useActionDataso it returns proper contextual action data and not any action data in the tree (#11023) -
Fix bug in
useResolvedPaththat would causeuseResolvedPath(".")in a splat route to lose the splat portion of the URL path. (#10983)- ⚠️ This fixes a quite long-standing bug specifically for
"."paths inside a splat route which incorrectly dropped the splat portion of the URL. If you are relative routing via"."inside a splat route in your application you should double check that your logic is not relying on this buggy behavior and update accordingly.
- ⚠️ This fixes a quite long-standing bug specifically for
-
Updated dependencies:
-
@remix-run/[email protected]
-
v6.18.0
Patch Changes
- Fix the
futureprop onBrowserRouter,HashRouterandMemoryRouterso that it accepts aPartial<FutureConfig>instead of requiring all flags to be included. (#10962) - Updated dependencies:
-
@remix-run/[email protected]
-
v6.17.0
Patch Changes
- Fix
RouterProviderfutureprop type to be aPartial<FutureConfig>so that not all flags must be specified (#10900) - Updated dependencies:
-
@remix-run/[email protected]
-
v6.16.0
Minor Changes
- In order to move towards stricter TypeScript support in the future, we're aiming to replace current usages of
anywithunknownon exposed typings for user-provided data. To do this in Remix v2 without introducing breaking changes in React Router v6, we have added generics to a number of shared types. These continue to default toanyin React Router and are overridden withunknownin Remix. In React Router v7 we plan to move these tounknownas a breaking change. (#10843)-
Locationnow accepts a generic for thelocation.statevalue -
ActionFunctionArgs/ActionFunction/LoaderFunctionArgs/LoaderFunctionnow accept a generic for thecontextparameter (only used in SSR usages viacreateStaticHandler) - The return type of
useMatches(now exported asUIMatch) accepts generics formatch.dataandmatch.handle- both of which were already set tounknown
-
- Move the
@privateclass exportErrorResponseto anUNSAFE_ErrorResponseImplexport since it is an implementation detail and there should be no construction ofErrorResponseinstances in userland. This frees us up to export atype ErrorResponsewhich correlates to an instance of the class viaInstanceType. Userland code should only ever be usingErrorResponseas a type and should be type-narrowing viaisRouteErrorResponse. (#10811) - Export
ShouldRevalidateFunctionArgsinterface (#10797) - Removed private/internal APIs only required for the Remix v1 backwards compatibility layer and no longer needed in Remix v2 (
_isFetchActionRedirect,_hasFetcherDoneAnything) (#10715)
Patch Changes
- Updated dependencies:
-
@remix-run/[email protected]
-
remix-run/react-router (react-router-dom)
v6.30.2
v6.30.1
v6.30.0
v6.29.0
v6.28.2
v6.28.1
v6.28.0
v6.27.0
v6.26.2
v6.26.1
v6.26.0
v6.25.1
v6.25.0
v6.24.1
v6.24.0
v6.23.1
v6.23.0
v6.22.3
v6.22.2
v6.22.1
v6.22.0
v6.21.3
v6.21.2
v6.21.1
v6.21.0
v6.20.1
v6.20.0
v6.19.0
v6.18.0
v6.17.0
v6.16.0
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 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.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 88.35%. Comparing base (
d880aac) to head (4d1080c). Report is 1 commits behind head on master.
:exclamation: Current head 4d1080c differs from pull request most recent head 91ca79f
Please upload reports for the commit 91ca79f to get more accurate results.
Additional details and impacted files
@@ Coverage Diff @@
## master #935 +/- ##
==========================================
- Coverage 88.83% 88.35% -0.49%
==========================================
Files 307 291 -16
Lines 5268 4938 -330
Branches 1338 1243 -95
==========================================
- Hits 4680 4363 -317
+ Misses 572 561 -11
+ Partials 16 14 -2
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.