-
Notifications
You must be signed in to change notification settings - Fork 161
Replace react-router-dom with react-router #4540
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
4db2c06
to
054db59
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested the branch, and UI and elements are functional
4332098
to
8aa39cc
Compare
Found one broken link to the image repository and removed an accidentally included test suite change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update tested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! I left some comments, most important are in the <SubRouterTabs />
component. Overall looks very good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks!
This commit rewrites much of the routing to support react-router instead of react-router-dom which is deprecated/removed in version 7. react-router-dom 6 introduced large changes to how navigation was managed. This is compounded by layout changes inside react-router 7. This change addresses the need by reworking the navigation to match the format specified by react-router 6 and 7
- Drop types/react-router - Set all routes to be element instead of Component - Undo convertImage change moved to separate PR - Review comments offer simplification to SubRouterTabs - Fix broken Automations route - Reset and reapply change to AppContext to cleanup redundant changes - As above for CoreContext - Remove typecasting, prettify, lint
01d2732
to
a2622fe
Compare
What changed?
This commit rewrites much of the routing to support react-router instead of react-router-dom which is deprecated/removed in version 7.
This change moves the router across 2 major versions 5.2.0 to 7.1.1
When moving from react-router-dom 5.2.0 to version 6.x, largescale changes were made to how routing and navigation was managed. The change from 6.x to 7.x further refined this, changing how sub-routes were handled by forcing a split of the
Route(/*)
intoRoute -> Route(*)
This split introduced breaking changes into how routing is managed by the application.
The change to router also had impacts on how automatic logout was managed as this prevented the sign-in page from completely loading, resulting in a loading icon replacing the
continue
button.Every care has been taken to ensure all routes and tabs are functional however this is not currently exhaustive.
Why was this change made?
To ensure ongoing and future compatibility with upstream libraries.
How was this change implemented?
By working through the routing to ensure it was upgraded to match
[email protected]
How did you validate the change?
By loading the UI using both
yarn start
andtilt up
and ensuring in both environments all visible pages and tabs are accessible.By ensuring that all relevant unit tests pass with minimal difference.
One test suite was modified by this change. The
Link
test suite contained invalid / broken test cases that became apparent as a result of the change being made. These have now been corrected for URLs treated as relative links.Release notes
N/A
Documentation Changes
N/A