-
Couldn't load subscription status.
- Fork 5.4k
refactor: migrate components/app files to v5-compat #37204
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
|
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. |
✨ Files requiring CODEOWNER review ✨🔑 @MetaMask/accounts-engineers (4 files, +17 -16)
👨🔧 @MetaMask/core-extension-ux (5 files, +65 -38)
🔄 @MetaMask/swaps-engineers (1 files, +3 -4)
|
5de5042 to
10922ec
Compare
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [10922ec]
UI Startup Metrics (1252 ± 73 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
10922ec to
a4caa9d
Compare
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [fda8ed3]
UI Startup Metrics (1276 ± 83 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
fda8ed3 to
0bb1bb8
Compare
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [0bb1bb8]
UI Startup Metrics (1265 ± 82 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
0bb1bb8 to
580fab6
Compare
| const onHomeScreen = location.pathname === DEFAULT_ROUTE; | ||
| const onSettingsScreen = location.pathname.startsWith(SETTINGS_ROUTE); | ||
| // Use passed location or fallback to DEFAULT_ROUTE | ||
| const currentPathname = location?.pathname ?? DEFAULT_ROUTE; |
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.
ToastMaster was using useLocation() from v5-compat while being rendered in a v5 router context, causing the survey toast to not render correctly. By passing location as a prop rather than having the component fetch it via a mismatched router context can eliminate the router context mismatch.
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [580fab6]
UI Startup Metrics (1242 ± 72 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
580fab6 to
9d27590
Compare
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [9d27590]
UI Startup Metrics (1280 ± 79 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
Migrate components/app files to v5-compat
Changelog
CHANGELOG entry: null
Related issues
Fixes: part of https://github.com/MetaMask/MetaMask-planning/issues/3261
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Replaces react-router-dom v5 APIs with v5-compat hooks (
useNavigate,useLocation) across app components, hooks, and tests, updates routing HOCs/utilities, and adjusts Toasts and Routes integration accordingly.react-router-domv5 APIs (useHistory,useLocation,withRouter) toreact-router-dom-v5-compathooks (useNavigate,useLocation) andwithRouterHooks.history.push/replacewithnavigate(...)across components and hooks (e.g.,ConnectedSnaps,ConvertTokenToNFTModal,TurnOnBackupAndSyncModal,TurnOnMetamaskNotifications,PasswordOutdatedModal,RecoveryPhraseReminder,TransactionListItem, bridge hooks).ToastMasterto acceptlocationvia props instead of reading it directly; wire it fromroutes.component.basic-configuration-modal: switch to v5-compatuseLocation.transaction-list-item-details.container: swapwithRouterforwithRouterHooks.useHandleSendNonEvmanduseBridgeTxHistoryData: useuseNavigatefor confirmations/tx-details navigation.react-router-dom-v5-compathooks and userender-helpers-navigate; adjust expectations fromhistory.pushtonavigateand passlocationwhere needed.Written by Cursor Bugbot for commit 9d27590. This will update automatically on new commits. Configure here.