-
Notifications
You must be signed in to change notification settings - Fork 265
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
Update React Router to v6 #2452
Comments
Recent React Router v5 releases have some fixes for React 18 compatibility so we should try updating React first and see how that goes. Our previous attempt at updating React Router using the compatibility layer ran into some issues but with most other dependencies now updated, and assuming the React 18 update works as expected, it's time to try this again. If the compatibility layer doesn't work out we can just update it all in one go but it would be nice to break it down into a series of smaller changes if possible to facilitate easier review and testing. |
PR #2542 opened to add the compatibility layer and start migrating to the new API. All routes have been converted to use the compatibility layer, including hooks from the new API. Remaining:
|
/lifecycle frozen |
Revisiting this in the near future. According to the declared dependencies we should actually be able to upgrade to React Router v6 while remaining on React 17. Perhaps some of the previous issues were red herrings or have since been resolved 🤞
|
Last PR related to compatibility layer issues: #2650 |
I've been looking at a large set of updates across our main dependencies. There are a number of improvements in React Router 6 that allow us to remove previous workarounds / custom components that were added purely for managing / interacting with the router, in favour of built-in APIs now provided by RR. These allow us to significantly simplify the client architecture, reduce maintenance overhead, and further lower the barrier to entry for new contributors. As a result it also makes some previously explored feature requests more feasible. More to come after our next LTS release is done so we can focus more effort on these upgrades. |
Once #3465 is merged we can start on simplifying and unifying most of the per-resource type containers. This means that for most resources they'll just need their routes defined, and everything else should be handled without the need for additional code. Highly custom pages such as those for PipelineRuns, TaskRuns, etc. will keep their custom containers for now, but in future should also be migrated to the common containers as wrappers, with custom render functions as needed. Also tracking React Query (TanStack Query) update to v5:
|
Remaining issues tracked in #3492 |
Update react-router / react-router-dom to the v6 releases. This will likely be a breaking change for consumers of the Dashboard's
@tektoncd/dashboard-components
and@tektoncd/dashboard-utils
packages and will need to be managed carefully.See the documentation for details of the changes:
https://reactrouter.com/en/main/upgrading/v5
There is a compatibility layer that should make the update process a bit smoother, allowing us to use both APIs in parallel while we make the required changes across the app, although it may not cover all use cases. This is documented at:
remix-run/react-router#8753
Some changes have already been done in preparation for this update:
Some additional changes identified:
component
prop is no longer supported in v6,useHref
hook in custom component insteaduseSearchParams
instead of current manualURLSearchParams
andhistory.push
approach. Not 'required' but is a nice cleanup that we should considerOnce we agree a timeline for this update the next steps will be to review the latest documentation, enable the compatibility layer, and start by updating a small set of routes to validate the process.
The text was updated successfully, but these errors were encountered: