-
Notifications
You must be signed in to change notification settings - Fork 5.4k
refactor(5566): migrate from v5 &v5-compat to react-router-dom-v6 #38330
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
base: main
Are you sure you want to change the base?
Conversation
…dom in all test files
…gate Updated test files that require navigation functionality: - unconnected-account-alert.test.js - name.test.tsx - cancel-speedup-popover.test.js - customize-nonce.test.js - user-preferenced-currency-input.test.js - snap-ui-renderer/test-utils.tsx (and its dependent form.test.ts) - transaction-activity-log.component.test.js
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
✨ Files requiring CODEOWNER review ✨💎 @MetaMask/metamask-assets (3 files, +4 -4)
📜 @MetaMask/policy-reviewers (9 files, +110 -393)
Tip Follow the policy review process outlined in the LavaMoat Policy Review Process doc before expecting an approval from Policy Reviewers. |
...hain-accounts/permissions/permission-review-page/multichain-review-permissions-page.test.tsx
Outdated
Show resolved
Hide resolved
ui/components/app/network-connection-banner/network-connection-banner.test.tsx
Outdated
Show resolved
Hide resolved
29b646e to
78999e5
Compare
Builds ready [78999e5]
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
72d6709 to
b37b714
Compare
Builds ready [b37b714]
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
@metamaskbot update-policies |
1fc8514 to
8357f72
Compare
Builds ready [8357f72]
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
8357f72 to
e0ef096
Compare
e0ef096 to
e0d01da
Compare
Builds ready [254b147]
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
7ccc468 to
ee73b24
Compare
|
@metamaskbot update-policies |
ee73b24 to
3d65598
Compare
| ...renderer(component, { wrapper: Wrapper }), | ||
| history, | ||
| }; | ||
| return render(component, { wrapper: Wrapper }); |
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.
Bug: Missing export for removed function causes import error
The test/jest/index.js file exports renderWithProviderAndHistory from ./rendering, but this function was removed from test/jest/rendering.js as part of this PR's migration. This will cause a JavaScript error when anything tries to import from test/jest or specifically import renderWithProviderAndHistory. The export statement in index.js needs to be updated to remove the reference to the deleted function.
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.
|
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
Builds ready [1ce4c35]
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
e9f5424 to
87347be
Compare
Builds ready [87347be]
UI Startup Metrics (1324 ± 104 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
87347be to
62cb481
Compare
Builds ready [62cb481]
UI Startup Metrics (1260 ± 110 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
georgewrmarshall
left a comment
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.
🟢 Approving component-library and storybook changes on behalf of @MetaMask/design-system-engineers
Builds ready [b8a0521]
UI Startup Metrics (1221 ± 108 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
7c6148c to
4e70d56
Compare
Builds ready [c50c837]
UI Startup Metrics (1290 ± 116 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
Migrate
react-router-domfromv5-compatandv5tov6.Changelog
CHANGELOG entry: null
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/5567, https://github.com/MetaMask/MetaMask-planning/issues/5568, https://github.com/MetaMask/MetaMask-planning/issues/5569, https://github.com/MetaMask/MetaMask-planning/issues/5570
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Replaces all v5/v5-compat routing with react-router-dom v6, refactors routes/components to v6 APIs, updates tests/stories, policies, and dependencies.
react-router-dom-v5-compat/v5 with v6 across app (hooks,Routes/Route,Navigate,useRoutes).CompatRouter, v5 wrappers, and prop-passednavigate/location; use v6 hooks directly.toRelativeRoutePath) and v6-orientedcreateRouteWithLayout; rework rootRoutestouseRoutes.useNavigate,useLocation,useParams, and v6 route params (e.g., Asset, Confirm flows, Swaps, Permissions Connect, Onboarding, Settings, Notifications, Multichain pages).react-router-domv6; remove v5-compat usage; adjust snapshots and text expectations.preview.js: dropCompatRouter, use v6Routes/Route.react-router-dom-v5-compatto v6 (@remix-run/router) and addhistoryglobals where needed.react-router-domto^6.28.0; removereact-router-dom-v5-compat; update@remix-run/router; regenerate lockfile.Written by Cursor Bugbot for commit c50c837. This will update automatically on new commits. Configure here.