-
Notifications
You must be signed in to change notification settings - Fork 373
5th: Upgrade react-router and related to react-router-dom
#8971
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
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e9f41cb to
32cb302
Compare
Collaborator
|
Please rebase here when you find time. |
2fb0bc7 to
8164177
Compare
7861722 to
4385715
Compare
…use safer approach.
4385715 to
e01b69e
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #8971 +/- ##
==========================================
+ Coverage 79.95% 81.13% +1.18%
==========================================
Files 600 603 +3
Lines 32560 33712 +1152
Branches 3310 3248 -62
==========================================
+ Hits 26032 27352 +1320
+ Misses 6362 5988 -374
- Partials 166 372 +206 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
react-router and related to react-router-dom
react-router and related to react-router-domreact-router and related to react-router-dom
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Build on top of #9124
React Router v6 Migration Summary
Overview
This PR migrates from
react-router-domv5.1.2 to v6.x and removes the deprecatedconnected-react-routerlibrary.Key Changes
Dependencies
API Changes
<Switch><Routes><Route render={() => <Comp />} /><Route element={<Comp />} /><Redirect to="/path" /><Route element={<Navigate to="/path" />} />useHistory()/history.push()useNavigate()/navigate()props.match.pathConnectedRouterBrowserRouterFiles Modified
Redux Store Changes:
ui/job-view/redux/configureStore.js- Removed router middleware and reducerRouter Updates:
ui/App.jsx- ReplacedConnectedRouter+SwitchwithBrowserRouter+Routesui/push-health/App.jsx- Updated to v6 routing patternsui/perfherder/App.jsx- Updated to v6 routing patternsui/intermittent-failures/App.jsx- Updated to v6 routing patternsNavigation Refactoring:
ui/job-view/App.jsx- ReplacedpushRoutewithuseNavigateui/job-view/headerbars/SecondaryNavBar.jsx- ReplacedpushRoutewithuseNavigateui/job-view/pushes/PushActionMenu.jsx- ReplacedpushRoutewithuseNavigateui/job-view/redux/stores/selectedJob.js- Useswindow.history.pushStatefor URL updatesui/job-view/redux/stores/pushes.js- Useswindow.history.pushStatefor URL updatesui/models/filter.js- Accepts navigate function instead of Redux pushRouteNew Utilities:
ui/helpers/router.js- Centralized navigation hooks and utilitiesWhy This Migration?
connected-react-routeris deprecated and unmaintainedTesting