-
Notifications
You must be signed in to change notification settings - Fork 279
fix(deps): update react-router monorepo to v6 (major) #635
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
Conversation
980d9f7 to
721aba2
Compare
721aba2 to
dd51b8b
Compare
dd51b8b to
2807348
Compare
|
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
|
The tests still mock out history directly; will have to change that approach |
23967bd to
9732ce4
Compare
2807348 to
697fff0
Compare
9732ce4 to
b456361
Compare
697fff0 to
57e5cc3
Compare
57e5cc3 to
0de6abe
Compare
|
@bmulholland I believe that renovate discarded your changes. If you have changes saved locally, try to save them beforehand! |
|
Think I've managed to get the changes back. |
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. ⚠ Warning: custom changes will be lost. |
|
What to feel about what? The bundled app size increasing? |
Yeah, but it shouldn't be a problem here. We're shipping an electron app either way. |
|
Yep, agreed. It'll all be local. |
|
Re: createMemoryHistory, the equivalent that I've found in the v6+ docs is https://reactrouter.com/en/main/routers/create-memory-router That mocking seems to be at a different level, though -- would have to pass in the route configuration, I think? Probably don't want to go to the trouble of re-architecting the route setup just for the upgrade. |
|
I'll fix the test I broke |
5791cca to
8deaa9d
Compare
8deaa9d to
22b489a
Compare
It is not too different from what we currently have set up I think. |



This PR contains the following updates:
5.3.4->6.16.05.3.4->6.16.0Release Notes
remix-run/react-router (react-router)
v6.16.0Compare Source
Minor Changes
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.statevalueActionFunctionArgs/ActionFunction/LoaderFunctionArgs/LoaderFunctionnow accept a generic for thecontextparameter (only used in SSR usages viacreateStaticHandler)useMatches(now exported asUIMatch) accepts generics formatch.dataandmatch.handle- both of which were already set tounknown@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)ShouldRevalidateFunctionArgsinterface (#10797)_isFetchActionRedirect,_hasFetcherDoneAnything) (#10715)Patch Changes
@remix-run/router@1.9.0v6.15.0Compare Source
Minor Changes
redirectDocument()function which allows users to specify that a redirect from aloader/actionshould trigger a document reload (viawindow.location) instead of attempting to navigate to the redirected location via React Router (#10705)Patch Changes
useRevalidatoris referentially stable across re-renders if revalidations are not actively occurring (#10707)@remix-run/router@1.8.0v6.14.2Compare Source
Patch Changes
@remix-run/router@1.7.2v6.14.1Compare Source
Patch Changes
unstable_useBlockerwhen used with an unstable blocker function (#10652)@remix-run/router@1.7.1v6.14.0Compare Source
Patch Changes
basenamefrom locations provided tounstable_useBlockerfunctions to matchuseLocation(#10573)generatePathwhen passed a numeric0value parameter (#10612)unstable_useBlockerkey issues inStrictMode(#10573)tsc --skipLibCheck:falseissues on React 17 (#10622)typescriptto 5.1 (#10581)@remix-run/router@1.7.0v6.13.0Compare Source
Minor Changes
Move
React.startTransitionusage behind a future flag to avoid issues with existing incompatibleSuspenseusages. We recommend folks adopting this flag to be better compatible with React concurrent mode, but if you run into issues you can continue without the use ofstartTransitionuntil v7. Issues usually boils down to creating net-new promises during the render cycle, so if you run into issues you should either lift your promise creation out of the render cycle or put it behind auseMemo. (#10596)Existing behavior will no longer include
React.startTransition:If you wish to enable
React.startTransition, pass the future flag to your component:Patch Changes
React.startTransitionminification bug in production mode (#10588)v6.12.1Compare Source
Patch Changes
React.startTransitionto fix webpack + react 17 compilation error (#10569)v6.12.0Compare Source
Minor Changes
React.startTransitionif it exists (#10438)Patch Changes
@remix-run/router@1.6.3v6.11.2Compare Source
Patch Changes
basenameduplication in descendant<Routes>inside a<RouterProvider>(#10492)@remix-run/router@1.6.2v6.11.1Compare Source
Patch Changes
ComponentAPI within descendant<Routes>(#10434)useNavigatefrom<Routes>inside a<RouterProvider>(#10432)<Navigate>in strict mode when using a data router (#10435)@remix-run/router@1.6.1v6.11.0Compare Source
Patch Changes
<Routes>whenRouterProvidererrors existed (#10374)Componentinstead ofelementon a route definition (#10287)useNavigatein the render cycle by setting theactiveRefin a layout effect, allowing thenavigatefunction to be passed to child components and called in auseEffectthere. (#10394)useSyncExternalStoretouseStatefor internal@remix-run/routerrouter state syncing in<RouterProvider>. We found some subtle bugs where router state updates got propagated before other normaluseStateupdates, which could lead to footguns inuseEffectcalls. (#10377, #10409)useRevalidator()to resolve a loader-driven error boundary scenario (#10369)RouterProvider,useNavigate/useSubmit/fetcher.submitare now stable across location changes, since we can handle relative routing via the@remix-run/routerinstance and get rid of our dependence onuseLocation(). When usingBrowserRouter, these hooks remain unstable across location changes because they still rely onuseLocation(). (#10336)@remix-run/router@1.6.0v6.10.0Compare Source
Minor Changes
Added support for Future Flags in React Router. The first flag being introduced is
future.v7_normalizeFormMethodwhich will normalize the exposeduseNavigation()/useFetcher()formMethodfields as uppercase HTTP methods to align with thefetch()behavior. (#10207)future.v7_normalizeFormMethod === false(default v6 behavior),useNavigation().formMethodis lowercaseuseFetcher().formMethodis lowercasefuture.v7_normalizeFormMethod === true:useNavigation().formMethodis uppercaseuseFetcher().formMethodis uppercasePatch Changes
createRoutesFromElements(#10193)@remix-run/router@1.5.0v6.9.0Compare Source
Minor Changes
React Router now supports an alternative way to define your route
elementanderrorElementfields as React Components instead of React Elements. You can instead pass a React Component to the newComponentandErrorBoundaryfields if you choose. There is no functional difference between the two, so use whichever approach you prefer 😀. You shouldn't be defining both, but if you doComponent/ErrorBoundarywill "win". (#10045)Example JSON Syntax
Example JSX Syntax
Introducing Lazy Route Modules! (#10045)
In order to keep your application bundles small and support code-splitting of your routes, we've introduced a new
lazy()route property. This is an async function that resolves the non-route-matching portions of your route definition (loader,action,element/Component,errorElement/ErrorBoundary,shouldRevalidate,handle).Lazy routes are resolved on initial load and during the
loadingorsubmittingphase of a navigation or fetcher call. You cannot lazily define route-matching properties (path,index,children) since we only execute your lazy route functions after we've matched known routes.Your
lazyfunctions will typically return the result of a dynamic import.Then in your lazy route modules, export the properties you want defined for the route:
An example of this in action can be found in the
examples/lazy-loading-router-providerdirectory of the repository.🙌 Huge thanks to @rossipedia for the Initial Proposal and POC Implementation.
Updated dependencies:
@remix-run/router@1.4.0Patch Changes
generatePathincorrectly applying parameters in some cases (#10078)v6.8.2Compare Source
Patch Changes
@remix-run/router@1.3.3v6.8.1Compare Source
Patch Changes
@remix-run/router@1.3.2v6.8.0Compare Source
Patch Changes
@remix-run/router@1.3.1v6.7.0Compare Source
Minor Changes
unstable_useBlockerhook for blocking navigations within the app's location origin (#9709)Patch Changes
generatePathwhen optional params are present (#9764)<Await>to acceptReactNodeas children function return result (#9896)@remix-run/router@1.3.0v6.6.2Compare Source
Patch Changes
useIdconsistency during SSR (#9805)v6.6.1Compare Source
Patch Changes
@remix-run/router@1.2.1v6.6.0Compare Source
Patch Changes
useLoaderDatausage inerrorElement(#9735)@remix-run/router@1.2.0v6.5.0Compare Source
This release introduces support for Optional Route Segments. Now, adding a
?to the end of any path segment will make that entire segment optional. This works for both static segments and dynamic parameters.Optional Params Examples
<Route path=":lang?/about>will match:/:lang/about/about<Route path="/multistep/:widget1?/widget2?/widget3?">will match:/multistep/multistep/:widget1/multistep/:widget1/:widget2/multistep/:widget1/:widget2/:widget3Optional Static Segment Example
<Route path="/home?">will match://home<Route path="/fr?/about">will match:/about/fr/aboutMinor Changes
Patch Changes
<Route path="prefix-:param">, to align with how splat parameters work. If you were previously relying on this behavior then it's recommended to extract the static portion of the path at theuseParamscall site: (#9506)@remix-run/router@1.1.0v6.4.5Compare Source
Patch Changes
@remix-run/router@1.0.5v6.4.4Compare Source
Patch Changes
@remix-run/router@1.0.4v6.4.3Compare Source
Patch Changes
useRoutesshould be able to returnnullwhen passinglocationArg(#9485)initialEntriestype increateMemoryRouter(#9498)@remix-run/router@1.0.3v6.4.2Compare Source
Patch Changes
IndexRouteObjectandNonIndexRouteObjecttypes to makehasErrorElementoptional (#9394)RouteObject/RoutePropstypes to surface the error in TypeScript. (#9366)@remix-run/router@1.0.2v6.4.1Compare Source
Patch Changes
initialEntries(#9288)@remix-run/router@1.0.1v6.4.0Compare Source
Whoa this is a big one!
6.4.0brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the docs, especially the feature overview and the tutorial.New APIs
createMemoryRouter<RouterProvider>loaderand mutate with a RouteactionerrorElementdeferandAwaitBug Fixes
useLocationreturns the scoped location inside a<Routes location>component (#9094)Updated Dependencies
@remix-run/router@1.0.0v6.3.0: react-router@v6.3.0Compare Source
What's Changed
New Contributors
Full Changelog: remix-run/react-router@v6.2.2...v6.3.0
v6.2.2Compare Source
What's Changed
🐛 Bug Fixes
New Contributors
Full Changelog: remix-run/react-router@v6.2.1...v6.2.2
v6.2.1Compare Source
This release updates the internal
historydependency to5.2.0.Full Changelog: remix-run/react-router@v6.2.0...v6.2.1
v6.2.0Compare Source
🐛 Bug fixes
RoutePropselementtype, which should be aReactNode(#8473)useOutletfor top-level routes (#8483)✨ Features
New Contributors
Full Changelog: remix-run/react-router@v6.1.1...v6.2.0
v6.1.1Compare Source
In v6.1.0 we inadvertently shipped a new, undocumented API that will likely introduce bugs (#7586). We have flagged
HistoryRouterasunstable_HistoryRouter, as this API will likely need to change before a new major release.Full Changelog: remix-run/react-router@v6.1.0...v6.1.1
v6.1.0Compare Source
🐛 Bug fixes
✨ Features
<Outlet>can now receive acontextprop. This value is passed to child routes and is accessible via the newuseOutletContexthook. See the API docs for details. (#8461)<NavLink>can now receive a child function for access to its props. (#8164)💅 Enhancements
useMatchandmatchPath. For example, when you calluseMatch("foo/:bar/:baz"), the path is parsed and the return type will bePathMatch<"bar" | "baz">. (#8030)New Contributors
Full Changelog: remix-run/react-router@v6.0.1...v6.1.0
v6.0.2Compare Source
✨ Features
reloadDocumentprop to<Link>. This allows<Link>to function like a normal anchor tag by reloading the document after navigation while maintaining the relativetoresolution.🗒️ Docs
🤝 New Contributors
Full Changelog
v6.0.1Compare Source
🐛 Bug Fixes
<StaticRouter location>value (#8243)<Route>inside<Routes>to help people make the change (#8238)v6.0.0Compare Source
React Router v6 is here!
Please go read our blog post for more information on all the great stuff in v6 including notes about how to upgrade from React Router v5 and Reach Router.
remix-run/react-router (react-router-dom)
v6.16.0Compare Source
Minor Changes
@remix-run/router@1.9.0react-router@6.16.0Patch Changes
v6.15.0Compare Source
Minor Changes
redirectDocument()function which allows users to specify that a redirect from aloader/actionshould trigger a document reload (viawindow.location) instead of attempting to navigate to the redirected location via React Router (#10705)Patch Changes
URLSearchParamsand theuseSearchParamshook. (#10620)useFormAction()for unspecified actions since it cannot be determined on the server and causes hydration issues (#10758)unstable_usePromptto avoid throwing an exception if the prompt is unblocked and a navigation is performed synchronously (#10687, #10718)@remix-run/router@1.8.0react-router@6.15.0v6.14.2Compare Source
Patch Changes
<ScrollRestoration>(#10682)<Form state>prop to populatehistory.stateon submission navigations (#10630)Errorsubclasses such asReferenceError/TypeError(#10633)@remix-run/router@1.7.2react-router@6.14.2v6.14.1Compare Source
Patch Changes
react-router@6.14.1@remix-run/router@1.7.1v6.14.0Compare Source
Minor Changes
Add support for
application/jsonandtext/plainencodings foruseSubmit/fetcher.submit. To reflect these additional types,useNavigation/useFetchernow also containnavigation.json/navigation.textandfetcher.json/fetcher.textwhich include the json/text submission if applicable (#10413)Patch Changes
submitterelement, prefer the built-innew FormData(form, submitter)instead of the previous manual approach in modern browsers (those that support the newsubmitterparameter) (#9865, #10627)type="image"buttonsformdata-submitter-polyfillwindow.history.pushState/replaceStatebefore updating React Router state (instead of after) so thatwindow.locationmatchesuseLocationduring synchronous React 17 rendering (#10448)window.locationand should always referenceuseLocationwhen possible, aswindow.locationwill not be in sync 100% of the time (due topopstateevents, concurrent mode, etc.)tsc --skipLibCheck:falseissues on React 17 (#10622)typescriptto 5.1 (#10581)react-router@6.14.0@remix-run/router@1.7.0v6.13.0Compare Source
Minor Changes
Move
React.startTransitionusage behind a future flag to avoid issues with existing incompatibleSuspenseusages. We recommend folks adopting this flag to be better compatible with React concurrent mode, but if you run into issues you can continue without the use ofstartTransitionuntil v7. Issues usually boils down to creating net-new promises during the render cycle, so if you run into issues you should either lift your promise creation out of the render cycle or put it behind auseMemo. (#10596)Existing behavior will no longer include
React.startTransition:If you wish to enable
React.startTransition, pass the future flag to your component:Patch Changes
React.startTransitionminification bug in production mode (#10588)react-router@6.13.0v6.12.1Compare Source
Patch Changes
React.startTransitionto fix webpack + react 17 compilation error (#10569)react-router@6.12.1v6.12.0Compare Source
Minor Changes
React.startTransitionif it exists (#10438)Patch Changes
DOMException(DataCloneError) when attempting to perform aPUSHnavigation with non-serializable state. (#10427)@remix-run/router@1.6.3react-router@6.12.0v6.11.2Compare Source
Patch Changes
SetURLSearchParamstype (#10444)react-router@6.11.2@remix-run/router@1.6.2v6.11.1Compare Source
Patch Changes
react-router@6.11.1@remix-run/router@1.6.1v6.11.0Compare Source
Minor Changes
basenamesupport inuseFetcher(#10336)basenamethen you will need to remove the manually prependedbasenamefrom yourfetchercalls (fetcher.load('/basename/route') -> fetcher.load('/route'))Patch Changes
Componentinstead ofelementon a route definition (#10287)<Link to="//">and other invalid URL values (#10367)useSyncExternalStoretouseStatefor internal@remix-run/routerrouter state syncing in<RouterProvider>. We found some subtle bugs where router state updates got propagated before other normaluseStateupdates, which could lead to footguns inuseEffectcalls. (#10377, #10409)StaticRouterProvider's internalRoutercomponent (#10401)RouterProvider,useNavigate/useSubmit/fetcher.submitare now stable across location changes, since we can handle relative routing via the@remix-run/routerinstance and get rid of our dependence onuseLocation(). When usingBrowserRouter, these hooks remain unstable acrosConfiguration
📅 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 has been generated by Mend Renovate. View repository job log here.