Update react-router-dom 6.17.0 → 6.22.3 (minor)
Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.
What changed?
✳️ react-router-dom (6.17.0 → 6.22.3) · Repo · Changelog
Release Notes
6.22.0 (from changelog)
Date: 2024-02-01
What's Changed
Core Web Vitals Technology Report Flag
In 2021, the HTTP Archive launched the Core Web Vitals Technology Report dashboard:
By combining the powers of real-user experiences in the Chrome UX Report 26 (CrUX) dataset with web technology detections in HTTP Archive 30, we can get a glimpse into how architectural decisions like choices of CMS platform or JavaScript framework play a role in sites’ CWV performance.
They use a tool called
wappalyzerto identify what technologies a given website is using by looking for certain scripts, global JS variables, or other identifying characteristics. For example, for Remix applications, they look for the global__remixContextvariable to identify that a website is using Remix.It was brought to our attention that React Router was unable to be reliably identified because there are no identifying global aspects. They are currently looking for external scripts with
react-routerin the name. This will identify sites using React Router from a CDN such asunpkg- but it will miss the vast majority of sites that are installing React Router from the npm registry and bundling it into their JS files. This results in drastically under-reporting the usage of React Router on the web.Starting with version
6.22.0, sites usingreact-router-domwill begin adding awindow.__reactRouterVersionvariable that will be set to a string value of the SemVer major version number (i.e.,window.__reactRouterVersion = "6";) so that they can be properly identified.Minor Changes
- Include a
window.__reactRouterVersionfor CWV Report detection (#11222)- Add a
createStaticHandlerfuture.v7_throwAbortReasonflag to throwrequest.signal.reason(defaults to aDOMException) when a request is aborted instead of anErrorsuch asnew Error("query() call aborted: GET /path")(#11104)
- Please note that
DOMExceptionwas added in Node v17 so you will not get aDOMExceptionon Node 16 and below.Patch Changes
- Respect the
ErrorResponsestatus code if passed togetStaticContextFormError(#11213)Full Changelog:
v6.21.3...v6.22.0
6.21.3 (from changelog)
Date: 2024-01-18
Patch Changes
- Fix
NavLinkisPendingwhen abasenameis used (#11195)- Remove leftover
unstable_prefix fromBlocker/BlockerFunctiontypes (#11187)Full Changelog:
v6.21.2...v6.21.3
6.21.2 (from changelog)
Date: 2024-01-11
Patch Changes
- Leverage
useIdfor internal fetcher keys when available (#11166)- Fix bug where dashes were not picked up in dynamic parameter names (#11160)
- Do not attempt to deserialize empty JSON responses (#11164)
Full Changelog:
v6.21.1...v6.21.2
6.21.1 (from changelog)
Patch Changes
- Fix bug with
route.lazynot working correctly on initial SPA load whenv7_partialHydrationis specified (#11121)- Fix bug preventing revalidation from occurring for persisted fetchers unmounted during the
submittingphase (#11102)- De-dup relative path logic in
resolveTo(#11097)Full Changelog:
v6.21.0...v6.21.1
6.21.0 (from changelog)
What's Changed
future.v7_relativeSplatPathWe fixed a splat route path-resolution bug in
6.19.0, but later determined a large number of applications were relying on the buggy behavior, so we reverted the fix in6.20.1(see #10983, #11052, #11078).The buggy behavior is that the default behavior when resolving relative paths inside a splat route would ignore any splat (
*) portion of the current route path. When the future flag is enabled, splat portions are included in relative path logic within splat routes.For more information, please refer to the
useResolvedPathdocs and/or the detailed changelog entry.Partial Hydration
We added a new
future.v7_partialHydrationfuture flag for the@remix-run/routerthat enables partial hydration of a data router when Server-Side Rendering. This allows you to providehydrationData.loaderDatathat has values for some initially matched route loaders, but not all. When this flag is enabled, the router will callloaderfunctions for routes that do not have hydration loader data duringrouter.initialize(), and it will render down to the deepest providedHydrateFallback(up to the first route without hydration data) while it executes the unhydrated routes. (#11033)Minor Changes
- Add a new
future.v7_relativeSplatPathflag to implement a breaking bug fix to relative routing when inside a splat route. (#11087)- Add a new
future.v7_partialHydrationfuture flag that enables partial hydration of a data router when Server-Side Rendering (#11033)Patch Changes
- Properly handle falsy error values in
ErrorBoundary's (#11071)- Catch and bubble errors thrown when trying to unwrap responses from
loader/actionfunctions (#11061)- Fix
relative="path"issue when renderingLink/NavLinkoutside of matched routes (#11062)Full Changelog:
v6.20.1...v6.21.0
6.20.1 (from changelog)
Patch Changes
- Revert the
useResolvedPathfix for splat routes due to a large number of applications that were relying on the buggy behavior (see #11052) (#11078)
- We plan to re-introduce this fix behind a future flag in the next minor version (see this comment)
- This fix was included in versions
6.19.0and6.20.0. If you are upgrading from6.18.0or earlier, you would not have been impacted by this fix.Full Changelog:
v6.20.0...v6.20.1
6.20.0 (from changelog)
Minor Changes
- Export the
PathParamtype from the public API (#10719)Patch Changes
- Updated dependencies:
[email protected]@remix-run/[email protected]
6.19.0 (from changelog)
Minor Changes
- Add
unstable_flushSyncoption touseNavigate/useSumbit/fetcher.load/fetcher.submitto opt-out ofReact.startTransitionand intoReactDOM.flushSyncfor state updates (#11005)- Allow
unstable_usePromptto accept aBlockerFunctionin addition to aboolean(#10991)Patch Changes
- Fix issue where a changing fetcher
keyin auseFetcherthat remains mounted wasn't getting picked up (#11009)- Fix
useFormActionwhich was incorrectly inheriting the?indexquery param from child routeactionsubmissions (#11025)- Fix
NavLinkactivelogic whentolocation has a trailing slash (#10734)- Updated dependencies:
[email protected]@remix-run/[email protected]
6.18.0 (from changelog)
Minor Changes
Add support for manual fetcher key specification via
useFetcher({ key: string })so you can access the same fetcher instance from different components in your application without prop-drilling (RFC) (#10960)
- Fetcher keys are now also exposed on the fetchers returned from
useFetchersso that they can be looked up bykeyAdd
navigate/fetcherKeyparams/props touseSumbit/Formto support kicking off a fetcher submission under the hood with an optionally user-specifiedkey(#10960)
- Invoking a fetcher in this way is ephemeral and stateless
- If you need to access the state of one of these fetchers, you will need to leverage
useFetcher({ key })to look it up elsewherePatch Changes
- Adds a fetcher context to
RouterProviderthat holds completed fetcher data, in preparation for the upcoming future flag that will change the fetcher persistence/cleanup behavior (#10961)- 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][email protected]
Does any of this look wrong? Please let us know.
↗️ react-router (indirect, 6.17.0 → 6.22.3) · Repo · Changelog
Release Notes
6.22.0 (from changelog)
Date: 2024-02-01
What's Changed
Core Web Vitals Technology Report Flag
In 2021, the HTTP Archive launched the Core Web Vitals Technology Report dashboard:
By combining the powers of real-user experiences in the Chrome UX Report 26 (CrUX) dataset with web technology detections in HTTP Archive 30, we can get a glimpse into how architectural decisions like choices of CMS platform or JavaScript framework play a role in sites’ CWV performance.
They use a tool called
wappalyzerto identify what technologies a given website is using by looking for certain scripts, global JS variables, or other identifying characteristics. For example, for Remix applications, they look for the global__remixContextvariable to identify that a website is using Remix.It was brought to our attention that React Router was unable to be reliably identified because there are no identifying global aspects. They are currently looking for external scripts with
react-routerin the name. This will identify sites using React Router from a CDN such asunpkg- but it will miss the vast majority of sites that are installing React Router from the npm registry and bundling it into their JS files. This results in drastically under-reporting the usage of React Router on the web.Starting with version
6.22.0, sites usingreact-router-domwill begin adding awindow.__reactRouterVersionvariable that will be set to a string value of the SemVer major version number (i.e.,window.__reactRouterVersion = "6";) so that they can be properly identified.Minor Changes
- Include a
window.__reactRouterVersionfor CWV Report detection (#11222)- Add a
createStaticHandlerfuture.v7_throwAbortReasonflag to throwrequest.signal.reason(defaults to aDOMException) when a request is aborted instead of anErrorsuch asnew Error("query() call aborted: GET /path")(#11104)
- Please note that
DOMExceptionwas added in Node v17 so you will not get aDOMExceptionon Node 16 and below.Patch Changes
- Respect the
ErrorResponsestatus code if passed togetStaticContextFormError(#11213)Full Changelog:
v6.21.3...v6.22.0
6.21.3 (from changelog)
Date: 2024-01-18
Patch Changes
- Fix
NavLinkisPendingwhen abasenameis used (#11195)- Remove leftover
unstable_prefix fromBlocker/BlockerFunctiontypes (#11187)Full Changelog:
v6.21.2...v6.21.3
6.21.2 (from changelog)
Date: 2024-01-11
Patch Changes
- Leverage
useIdfor internal fetcher keys when available (#11166)- Fix bug where dashes were not picked up in dynamic parameter names (#11160)
- Do not attempt to deserialize empty JSON responses (#11164)
Full Changelog:
v6.21.1...v6.21.2
6.21.1 (from changelog)
Patch Changes
- Fix bug with
route.lazynot working correctly on initial SPA load whenv7_partialHydrationis specified (#11121)- Fix bug preventing revalidation from occurring for persisted fetchers unmounted during the
submittingphase (#11102)- De-dup relative path logic in
resolveTo(#11097)Full Changelog:
v6.21.0...v6.21.1
6.21.0 (from changelog)
What's Changed
future.v7_relativeSplatPathWe fixed a splat route path-resolution bug in
6.19.0, but later determined a large number of applications were relying on the buggy behavior, so we reverted the fix in6.20.1(see #10983, #11052, #11078).The buggy behavior is that the default behavior when resolving relative paths inside a splat route would ignore any splat (
*) portion of the current route path. When the future flag is enabled, splat portions are included in relative path logic within splat routes.For more information, please refer to the
useResolvedPathdocs and/or the detailed changelog entry.Partial Hydration
We added a new
future.v7_partialHydrationfuture flag for the@remix-run/routerthat enables partial hydration of a data router when Server-Side Rendering. This allows you to providehydrationData.loaderDatathat has values for some initially matched route loaders, but not all. When this flag is enabled, the router will callloaderfunctions for routes that do not have hydration loader data duringrouter.initialize(), and it will render down to the deepest providedHydrateFallback(up to the first route without hydration data) while it executes the unhydrated routes. (#11033)Minor Changes
- Add a new
future.v7_relativeSplatPathflag to implement a breaking bug fix to relative routing when inside a splat route. (#11087)- Add a new
future.v7_partialHydrationfuture flag that enables partial hydration of a data router when Server-Side Rendering (#11033)Patch Changes
- Properly handle falsy error values in
ErrorBoundary's (#11071)- Catch and bubble errors thrown when trying to unwrap responses from
loader/actionfunctions (#11061)- Fix
relative="path"issue when renderingLink/NavLinkoutside of matched routes (#11062)Full Changelog:
v6.20.1...v6.21.0
6.20.1 (from changelog)
Patch Changes
- Revert the
useResolvedPathfix for splat routes due to a large number of applications that were relying on the buggy behavior (see #11052) (#11078)
- We plan to re-introduce this fix behind a future flag in the next minor version (see this comment)
- This fix was included in versions
6.19.0and6.20.0. If you are upgrading from6.18.0or earlier, you would not have been impacted by this fix.Full Changelog:
v6.20.0...v6.20.1
6.20.0 (from changelog)
Minor Changes
- Export the
PathParamtype from the public API (#10719)Patch Changes
- Do not revalidate unmounted fetchers when
v7_fetcherPersistis enabled (#11044)- Fix bug with
resolveTopath resolution in 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-domlayersFull Changelog:
v6.19.0...v6.20.0
6.19.0 (from changelog)
What's Changed
unstable_flushSyncAPIThis release brings a new
unstable_flushSyncoption to the imperative APIs (useSubmit,useNavigate,fetcher.submit,fetcher.load) to let users opt-into synchronous DOM updates for pending/optimistic UI.function handleClick() { submit(data, { flushSync: true }); // Everything is flushed to the DOM so you can focus/scroll to your pending/optimistic UI setFocusAndOrScrollToNewlyAddedThing(); }Minor Changes
- Add
unstable_flushSyncoption touseNavigate/useSubmit/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 (#10991)
- We do not plan to remove the prefix from
unstable_usePromptdue to differences in how browsers handlewindow.confirmthat prevent React Router from guaranteeing consistent/correct behaviorPatch 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.Fix issue where a changing fetcher
keyin auseFetcherthat remains mounted wasn't getting picked up (#11009)Fix
useFormActionwhich was incorrectly inheriting the?indexquery param from child routeactionsubmissions (#11025)Fix
NavLinkactivelogic whentolocation has a trailing slash (#10734)Fix types so
unstable_usePromptcan accept aBlockerFunctionin addition to aboolean(#10991)Fix
relative="path"bug where relative path calculations started from the full location pathname, instead of from the current contextual route pathname. (#11006)<Route path="/a">
<Route path="/b" element={<Component />}>
<Route path="/c" />
</Route>
</Route>;function Component() {
return (
<>
{/* This is now correctly relative to /a/b, not /a/b/c */}
<Link to=".." relative="path" />
<Outlet />
</>
);
}Full Changelog:
6.18.0...6.19.0
6.18.0 (from changelog)
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]
Does any of this look wrong? Please let us know.
Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.
All Depfu comment commands
- @depfu rebase
- Rebases against your default branch and redoes this update
- @depfu recreate
- Recreates this PR, overwriting any edits that you've made to it
- @depfu merge
- Merges this PR once your tests are passing and conflicts are resolved
- @depfu cancel merge
- Cancels automatic merging of this PR
- @depfu close
- Closes this PR and deletes the branch
- @depfu reopen
- Restores the branch and reopens this PR (if it's closed)
- @depfu pause
- Ignores all future updates for this dependency and closes this PR
- @depfu pause [minor|major]
- Ignores all future minor/major updates for this dependency and closes this PR
- @depfu resume
- Future versions of this dependency will create PRs again (leaves this PR as is)
Closed in favor of #133.