Skip to content

refactor: migrate from HashRouter to createHashRouter#40696

Draft
n3ps wants to merge 8 commits intomainfrom
n3ps/create-router
Draft

refactor: migrate from HashRouter to createHashRouter#40696
n3ps wants to merge 8 commits intomainfrom
n3ps/create-router

Conversation

@n3ps
Copy link
Contributor

@n3ps n3ps commented Mar 8, 2026

Replace component-based HashRouter with the modern data router API (createHashRouter + RouterProvider). This unlocks access to loader, action, errorElement, native lazy, and useNavigation() for future use.

Changes:

  • ui/pages/index.js: Replace HashRouter with createHashRouter + RouterProvider. Move context providers into a root layout route element (AppProviders) that renders Outlet. Error boundary fallback keeps a standalone HashRouter for the error page.
  • ui/pages/routes/routes.component.tsx: Extract routeConfig to module level (removes useMemo with empty dependencies). Replace useRoutes() with Outlet.

Description

Open in GitHub Codespaces

Changelog

CHANGELOG entry: refactor: migrate from HashRouter to createHashRouter

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Replace the legacy component-based HashRouter with the data router API
(createHashRouter + RouterProvider). This unlocks access to loader,
action, errorElement, native lazy, and useNavigation() for future use.

Changes:
- ui/pages/index.js: Replace HashRouter with createHashRouter +
  RouterProvider. Move context providers into a root layout route
  element (AppProviders) that renders Outlet. Error boundary fallback
  keeps a standalone HashRouter for the error page.
- ui/pages/routes/routes.component.tsx: Extract routeConfig to module
  level (removes useMemo with empty deps). Replace useRoutes() with
  Outlet — the data router handles route matching internally.
- ui/pages/routes/index.js: Re-export routeConfig for use by index.js.

Test helpers keep using MemoryRouter (recommended for unit tests by
React Router docs). No test file changes needed.

Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
@metamaskbot metamaskbot added the team-core-extension-ux Core Extension UX team label Mar 8, 2026
@github-actions github-actions bot added the size-L label Mar 8, 2026
@cursor cursor bot temporarily deployed to pr-comment March 8, 2026 05:52 Inactive
Integration tests used window.history.pushState to reset the route
between tests. This manipulates the URL pathname, but createHashRouter
reads window.location.hash. Replace with window.location.hash = '#/'
so the data router sees the navigation.

Also revert index.js to the canonical module-level createHashRouter
pattern per React Router documentation.

Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
@cursor cursor bot force-pushed the n3ps/create-router branch from 8118d54 to c3d7cfe Compare March 8, 2026 06:08
@cursor cursor bot temporarily deployed to pr-comment March 8, 2026 06:08 Inactive
@cursor cursor bot temporarily deployed to pr-comment March 8, 2026 06:36 Inactive
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 8, 2026

Builds ready [c3d7cfe]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account28926234533279345
total28926234533279345
Confirm Txconfirm_tx607660656088960796088
total607660656088960796088
Bridge User Actionsbridge_load_page25923128724287287
bridge_load_asset_picker18314722933216229
bridge_search_token73069978231744782
total1171108412988512471298
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14671238172511115351670
load1226101814799913001412
domContentLoaded1219101414749812951396
domInteractive291894172679
firstPaint1567439074212290
backgroundConnect22219927214227245
firstReactRender21134552131
initialActions107124
loadScripts101381212679710821189
setupStore1363351622
numNetworkReqs312287192284
Power User HomeuiStartup267017537026106727204938
load12601085177217112991690
domContentLoaded12411069173416612921658
domInteractive3821130213895
firstPaint213871674175259378
backgroundConnect67427033837633952539
firstReactRender24165572535
initialActions1010114
loadScripts1022877149215710561428
setupStore1785681933
numNetworkReqs863620543100175
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2182172201218220
srpButtonToSrpForm94939409494
confirmSrpToPwForm21212102121
pwFormToMetricsScreen15151601516
metricsToWalletReadyScreen16151711617
doneButtonToHomeScreen61759664719617647
openAccountMenuToAccountListLoaded290128982904229042904
total3870385338831338833883
Onboarding New WalletcreateWalletToSocialScreen2192182191219219
srpButtonToPwForm1141101194119119
createPwToRecoveryScreen999099
skipBackupToMetricsScreen40404104041
agreeButtonToOnboardingSuccess17171801718
doneButtonToAssetList56748162967628629
total96887610317010231031
Asset DetailsassetClickToPriceChart1279714821146148
total1279714821146148
Solana Asset DetailsassetClickToPriceChart88781091293109
total88781091293109
Import Srp HomeloginToHomeScreen1964185520938520072093
openAccountMenuAfterLogin40344644346
homeAfterImportWithNewWallet24672353264510324872645
total4400428145288844014528
Send TransactionsopenSendPageFromHome23173252232
selectTokenToSendFormLoaded26193983039
reviewTransactionToConfirmationPage1076841165632011911656
total1129883174233812531742
SwapopenSwapPageFromHome19191901919
fetchAndDisplaySwapQuotes268626822688326882688
total270527002708327082708
🌐 Dapp Page Load Benchmarks

Current Commit: c3d7cfe | Date: 3/8/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±39ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 723ms (±36ms) 🟢 | historical mean value: 727ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 81ms (±13ms) 🟢 | historical mean value: 81ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 39ms 1.02s 1.34s 1.08s 1.34s
domContentLoaded 723ms 36ms 697ms 993ms 748ms 993ms
firstPaint 81ms 13ms 64ms 192ms 92ms 192ms
firstContentfulPaint 81ms 13ms 64ms 192ms 92ms 192ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.15 MiB (100%)
  • ui: 8.2 MiB (100%)
  • common: 10.99 MiB (100%)

With useRoutes(), an unmatched URL returned null and the app shell
still rendered (ConfirmationHandler would navigate to the right place).
With createHashRouter, unmatched URLs trigger the built-in 404 error
boundary showing 'Unexpected Application Error! 404 Not Found'.

Add a catch-all '*' route that redirects to home, preserving the old
graceful behavior.

Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
@cursor cursor bot temporarily deployed to pr-comment March 8, 2026 07:16 Inactive
The catch-all '*' route redirected ALL unmatched URLs to home, which
broke E2E tests that open popups at specific routes (confirm, connect,
etc.) — they saw the homepage instead of their intended page.

Replace with errorElement on the Routes layout route. When no child
route matches, the data router's 404 error boundary now renders the
same Routes shell (app chrome, modals, ConfirmationHandler) with an
empty Outlet. This matches the old useRoutes() behavior where no match
returned null — the shell rendered and ConfirmationHandler navigated
to the correct route.

Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 8, 2026

Builds ready [89cdf8b]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2682622734268273
total2682622734268273
Confirm Txconfirm_tx6051602460781960656078
total6051602460781960656078
Bridge User Actionsbridge_load_page28126230617287306
bridge_load_asset_picker16610822743202227
bridge_search_token71569573315724733
total1126109811491911381149
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14831274190611015081684
load1237106115789112611419
domContentLoaded1229105615669112571399
domInteractive291891172776
firstPaint169771116122225298
backgroundConnect22419928315230257
firstReactRender21125972236
initialActions105113
loadScripts102283913559110501199
setupStore1363351522
numNetworkReqs3122100202284
Power User HomeuiStartup2957168012272213725685046
load12441058193518612941680
domContentLoaded12251053181917812731672
domInteractive4120209343893
firstPaint215781762215254414
backgroundConnect9802611026118004362642
firstReactRender25165072642
initialActions104114
loadScripts1005850155316710491422
setupStore1776281830
numNetworkReqs1203829963148248
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2192182190219219
srpButtonToSrpForm102941168104116
confirmSrpToPwForm22212202122
pwFormToMetricsScreen15151501515
metricsToWalletReadyScreen16161601616
doneButtonToHomeScreen62860167730650677
openAccountMenuToAccountListLoaded2923289929502129352950
total391039023914539143914
Onboarding New WalletcreateWalletToSocialScreen2182172191218219
srpButtonToPwForm1061041082106108
createPwToRecoveryScreen888088
skipBackupToMetricsScreen38364124041
agreeButtonToOnboardingSuccess15151501515
doneButtonToAssetList50548253118508531
total89086491619898916
Asset DetailsassetClickToPriceChart13010914915141149
total13010914915141149
Solana Asset DetailsassetClickToPriceChart79728868288
total79728868288
Import Srp HomeloginToHomeScreen1943183520488319952048
openAccountMenuAfterLogin46395145051
homeAfterImportWithNewWallet2420236624633824502463
total4513449445351745354535
Send TransactionsopenSendPageFromHome21172642526
selectTokenToSendFormLoaded26193773237
reviewTransactionToConfirmationPage8488438544849854
total8948839089900908
SwapopenSwapPageFromHome36284153941
fetchAndDisplaySwapQuotes267826752681226802681
total271627122722427162722
🌐 Dapp Page Load Benchmarks

Current Commit: 89cdf8b | Date: 3/8/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 985ms (±98ms) 🟢 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 696ms (±122ms) 🟢 | historical mean value: 727ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 86ms (±103ms) 🟢 | historical mean value: 81ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 985ms 98ms 954ms 1.93s 1.01s 1.93s
domContentLoaded 696ms 122ms 663ms 1.88s 707ms 1.88s
firstPaint 86ms 103ms 68ms 1.11s 84ms 1.11s
firstContentfulPaint 86ms 103ms 68ms 1.11s 84ms 1.11s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.15 MiB (100%)
  • ui: 8.2 MiB (100%)
  • common: 10.99 MiB (100%)

The errorElement approach rendered the Routes shell but with an empty
Outlet (no matched child), causing pages to not render their content.

Replace with a simple { path: '*', element: null } catch-all at the
end of routeConfig. This prevents the data router from throwing a 404
error boundary while keeping the Routes shell rendering normally with
ConfirmationHandler able to navigate to the correct route — matching
the old useRoutes() behavior where no match returned null.

Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
@cursor cursor bot temporarily deployed to pr-comment March 8, 2026 08:32 Inactive
@cursor cursor bot temporarily deployed to pr-comment March 8, 2026 09:00 Inactive
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 8, 2026

Builds ready [e9c3ee2]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account29126830917304309
total29126830917304309
Confirm Txconfirm_tx6046603060611460596061
total6046603060611460596061
Bridge User Actionsbridge_load_page2512452585258258
bridge_load_asset_picker18411327154213271
bridge_search_token73469980643764806
total1171109313229212351322
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14251201193911714621645
load1189986157410212271376
domContentLoaded1182984156510012231356
domInteractive291691162676
firstPaint161701200129209294
backgroundConnect20819124811211236
firstReactRender20143952230
initialActions402652624
loadScripts990798136710010271167
setupStore1372751622
numNetworkReqs312292202283
Power User HomeuiStartup20181659243114120822280
load11821049168114211881607
domContentLoaded11671038165213811711539
domInteractive3718221273494
firstPaint1707947881233317
backgroundConnect30227038124315340
firstReactRender251688112745
initialActions104113
loadScripts94684213981299451293
setupStore1693041724
numNetworkReqs68341824555169
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2192182211220221
srpButtonToSrpForm96959929799
confirmSrpToPwForm22212202222
pwFormToMetricsScreen16161601616
metricsToWalletReadyScreen17161811718
doneButtonToHomeScreen69159185193720851
openAccountMenuToAccountListLoaded27852486293417129072934
total3846370439899538743989
Onboarding New WalletcreateWalletToSocialScreen2202172232222223
srpButtonToPwForm1091051175107117
createPwToRecoveryScreen888088
skipBackupToMetricsScreen37363703737
agreeButtonToOnboardingSuccess16151601616
doneButtonToAssetList54448261154607611
total9428641043679951043
Asset DetailsassetClickToPriceChart1371281467139146
total1371281467139146
Solana Asset DetailsassetClickToPriceChart83788948589
total83788948589
Import Srp HomeloginToHomeScreen20151899223612320422236
openAccountMenuAfterLogin563588217388
homeAfterImportWithNewWallet2455231825368324982536
total4461441245365445364536
Send TransactionsopenSendPageFromHome20172532225
selectTokenToSendFormLoaded26203563235
reviewTransactionToConfirmationPage8468428503849850
total8928849026895902
SwapopenSwapPageFromHome38274474244
fetchAndDisplaySwapQuotes268126772686426852686
total2723270627361127302736
🌐 Dapp Page Load Benchmarks

Current Commit: e9c3ee2 | Date: 3/8/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 963ms (±40ms) 🟢 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 677ms (±38ms) 🟢 | historical mean value: 727ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±10ms) 🟢 | historical mean value: 81ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 963ms 40ms 941ms 1.24s 980ms 1.24s
domContentLoaded 677ms 38ms 660ms 943ms 690ms 943ms
firstPaint 76ms 10ms 64ms 164ms 84ms 164ms
firstContentfulPaint 76ms 10ms 64ms 164ms 84ms 164ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.15 MiB (100%)
  • ui: 8.2 MiB (100%)
  • common: 10.99 MiB (100%)

@cursor cursor bot temporarily deployed to pr-comment March 8, 2026 14:46 Inactive
@cursor cursor bot force-pushed the n3ps/create-router branch from 92fa47a to a2bf37b Compare March 8, 2026 15:16
@cursor cursor bot temporarily deployed to pr-comment March 8, 2026 15:16 Inactive
@cursor cursor bot force-pushed the n3ps/create-router branch from a2bf37b to f77c573 Compare March 8, 2026 15:43
@cursor cursor bot temporarily deployed to pr-comment March 8, 2026 15:43 Inactive
@cursor cursor bot temporarily deployed to pr-comment March 8, 2026 16:09 Inactive
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 8, 2026

Builds ready [f77c573]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2722632796275279
total2722632796275279
Confirm Txconfirm_tx6054603260892160476089
total6054603260892160476089
Bridge User Actionsbridge_load_page26119332054316320
bridge_load_asset_picker21415227341240273
bridge_search_token7557497625762762
total1273121913133412851313
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14471214172911014881663
load120399014389512441383
domContentLoaded119698714359512381370
domInteractive281892172577
firstPaint1586845172215253
backgroundConnect22519239926228257
firstReactRender24168292631
initialActions105124
loadScripts99080512179210261162
setupStore1263151423
numNetworkReqs3122100202284
Power User HomeuiStartup20301721305517920742275
load11781026203516611631586
domContentLoaded11631016198416011461579
domInteractive37201732636107
firstPaint1747241381244303
backgroundConnect30426574650310342
firstReactRender291877113053
initialActions108113
loadScripts94481316771529311333
setupStore1675571726
numNetworkReqs69361824655168
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2202182211220221
srpButtonToSrpForm95949619496
confirmSrpToPwForm22222202222
pwFormToMetricsScreen16151701617
metricsToWalletReadyScreen17151921819
doneButtonToHomeScreen61159264018613640
openAccountMenuToAccountListLoaded292229142928629282928
total3915389139352039353935
Onboarding New WalletcreateWalletToSocialScreen2182172191219219
srpButtonToPwForm1081061112109111
createPwToRecoveryScreen888088
skipBackupToMetricsScreen39384014040
agreeButtonToOnboardingSuccess16161601616
doneButtonToAssetList61951571886690718
total100989911098810801109
Asset DetailsassetClickToPriceChart1431401484148148
total1431401484148148
Solana Asset DetailsassetClickToPriceChart78777807878
total78777807878
Import Srp HomeloginToHomeScreen2045199121797820182179
openAccountMenuAfterLogin50406595665
homeAfterImportWithNewWallet26112453285115627322851
total46454487477112847704771
Send TransactionsopenSendPageFromHome20162951729
selectTokenToSendFormLoaded28193783437
reviewTransactionToConfirmationPage89184499660921996
total9498791097839851097
SwapopenSwapPageFromHome17161911819
fetchAndDisplaySwapQuotes268226792685226832685
total269926952703327002703
🌐 Dapp Page Load Benchmarks

Current Commit: f77c573 | Date: 3/8/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±40ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 733ms (±38ms) 🟢 | historical mean value: 727ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 81ms (±15ms) 🟢 | historical mean value: 81ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 40ms 1.02s 1.35s 1.06s 1.35s
domContentLoaded 733ms 38ms 712ms 1.02s 757ms 1.02s
firstPaint 81ms 15ms 64ms 220ms 88ms 220ms
firstContentfulPaint 81ms 15ms 64ms 220ms 88ms 220ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.15 MiB (100%)
  • ui: 8.2 MiB (100%)
  • common: 10.99 MiB (100%)

@cursor cursor bot force-pushed the n3ps/create-router branch from f77c573 to 3b70c4e Compare March 8, 2026 20:00
@cursor cursor bot temporarily deployed to pr-comment March 8, 2026 20:00 Inactive
@cursor cursor bot temporarily deployed to pr-comment March 8, 2026 20:27 Inactive
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 8, 2026

Builds ready [3b70c4e]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account28625732225309322
total28625732225309322
Confirm Txconfirm_tx605260416060760576060
total605260416060760576060
Bridge User Actionsbridge_load_page26122228928282289
bridge_load_asset_picker16414618217181182
bridge_search_token71269972711717727
total114011341143411431143
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14711225172311315071694
load12281036151310612671441
domContentLoaded12211025148710512601430
domInteractive2917101182679
firstPaint1587444977214262
backgroundConnect22019929013227240
firstReactRender21135372234
initialActions104113
loadScripts1018824127710510601231
setupStore1474261624
numNetworkReqs322293193180
Power User HomeuiStartup20411723247911921142264
load11851051175015011711530
domContentLoaded11701045172314211561479
domInteractive3421137183480
firstPaint187741659168248306
backgroundConnect30726642631320370
firstReactRender24155282541
initialActions108112
loadScripts95284314891389401271
setupStore1685061727
numNetworkReqs67361824455170
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2182172201219220
srpButtonToSrpForm96949929799
confirmSrpToPwForm22222202222
pwFormToMetricsScreen15151501515
metricsToWalletReadyScreen16161601616
doneButtonToHomeScreen66760075463731754
openAccountMenuToAccountListLoaded2943292329591429562959
total3977390640465740384046
Onboarding New WalletcreateWalletToSocialScreen2202182221220222
srpButtonToPwForm1131071163115116
createPwToRecoveryScreen999099
skipBackupToMetricsScreen38374013740
agreeButtonToOnboardingSuccess16161601616
doneButtonToAssetList569478779117617779
total966868118012210231180
Asset DetailsassetClickToPriceChart923914939108149
total923914939108149
Solana Asset DetailsassetClickToPriceChart87868818888
total87868818888
Import Srp HomeloginToHomeScreen1895188219141419141914
openAccountMenuAfterLogin512977176277
homeAfterImportWithNewWallet24022261267915324302679
total44084214461316946074613
Send TransactionsopenSendPageFromHome22192632526
selectTokenToSendFormLoaded22192732227
reviewTransactionToConfirmationPage86184690425847904
total90888594625914946
SwapopenSwapPageFromHome41335074750
fetchAndDisplaySwapQuotes269826902712927032712
total2739272327501027472750
🌐 Dapp Page Load Benchmarks

Current Commit: 3b70c4e | Date: 3/8/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±38ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 726ms (±37ms) 🟢 | historical mean value: 727ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 80ms (±11ms) 🟢 | historical mean value: 81ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 38ms 1.01s 1.31s 1.05s 1.31s
domContentLoaded 726ms 37ms 707ms 995ms 742ms 995ms
firstPaint 80ms 11ms 64ms 172ms 88ms 172ms
firstContentfulPaint 80ms 11ms 64ms 172ms 88ms 172ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.15 MiB (100%)
  • ui: 8.2 MiB (100%)
  • common: 10.99 MiB (100%)

- Add RouteErrorBoundary with errorElement on both root and inner layout
  routes to handle render errors (page crashes) at any level.
- Add catch-all '*' route that redirects to home instead of rendering
  null. On Firefox, some navigations produce URLs that temporarily don't
  match any route (different pushState/hash behavior from Chrome). The
  redirect ensures the app shell and ConfirmationHandler render so they
  can navigate to the correct route.
- Restore module-level createHashRouter (canonical React Router pattern).

Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
@cursor cursor bot force-pushed the n3ps/create-router branch from 3b70c4e to 0f29f41 Compare March 9, 2026 02:08
@cursor cursor bot temporarily deployed to pr-comment March 9, 2026 02:08 Inactive
@cursor cursor bot temporarily deployed to pr-comment March 9, 2026 02:34 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

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.

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 9, 2026

✨ Files requiring CODEOWNER review ✨

🔑 @MetaMask/accounts-engineers (8 files, +28 -28)
  • 📁 ui/
    • 📁 pages/
      • 📁 multichain-accounts/
        • 📁 multichain-account-address-list-page/
          • 📄 multichain-account-address-list-page.stories.tsx +1 -1
          • 📄 multichain-account-address-list-page.test.tsx +11 -11
          • 📄 multichain-account-address-list-page.tsx +2 -2
        • 📁 multichain-account-details-page/
          • 📄 multichain-account-details-page.stories.tsx +1 -1
          • 📄 multichain-account-details-page.test.tsx +6 -6
          • 📄 multichain-account-details-page.tsx +1 -1
        • 📁 multichain-account-private-key-list-page/
          • 📄 multichain-account-private-key-list-page.test.tsx +4 -4
          • 📄 multichain-account-private-key-list-page.tsx +2 -2

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 9, 2026

Builds ready [9ef5025]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2782752823278282
total2782752823278282
Confirm Txconfirm_tx6051603260661460666066
total6051603260661460666066
Bridge User Actionsbridge_load_page25522929022270290
bridge_load_asset_picker17011324058239240
bridge_search_token72770476125754761
total1152109112426612221242
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14841247203212215381670
load12441033179411112911409
domContentLoaded12371028174910812871400
domInteractive301794172775
firstPaint176761757180222368
backgroundConnect22520343625229252
firstReactRender21154162236
initialActions206225
loadScripts1030830151510510761181
setupStore1464261623
numNetworkReqs312291202284
Power User HomeuiStartup20891806253313921492325
load12171082175114912071655
domContentLoaded12031074174014811991640
domInteractive3821192253699
firstPaint1998253196255365
backgroundConnect31826953141327382
firstReactRender22165162335
initialActions106112
loadScripts97484315231449651417
setupStore1674451827
numNetworkReqs68361714455166
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2202182211221221
srpButtonToSrpForm97949929899
confirmSrpToPwForm22212202222
pwFormToMetricsScreen16151711717
metricsToWalletReadyScreen16151711717
doneButtonToHomeScreen62361064714619647
openAccountMenuToAccountListLoaded2925290629391429372939
total3951389640315540034031
Onboarding New WalletcreateWalletToSocialScreen2182162191219219
srpButtonToPwForm1061041081106108
createPwToRecoveryScreen888088
skipBackupToMetricsScreen36353603636
agreeButtonToOnboardingSuccess16151711617
doneButtonToAssetList56047163564604635
total9478531034699871034
Asset DetailsassetClickToPriceChart1471451481148148
total1471451481148148
Solana Asset DetailsassetClickToPriceChart81768648386
total81768648386
Import Srp HomeloginToHomeScreen196119531966619661966
openAccountMenuAfterLogin554071106071
homeAfterImportWithNewWallet2340224724327324092432
total4368428944285244224428
Send TransactionsopenSendPageFromHome18171901819
selectTokenToSendFormLoaded18162021920
reviewTransactionToConfirmationPage8498458595848859
total8868838934884893
SwapopenSwapPageFromHome38364013740
fetchAndDisplaySwapQuotes268526832689226842689
total272327202727327242727
🌐 Dapp Page Load Benchmarks

Current Commit: 9ef5025 | Date: 3/9/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±40ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 733ms (±37ms) 🟢 | historical mean value: 727ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 81ms (±12ms) 🟢 | historical mean value: 81ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 40ms 1.02s 1.34s 1.08s 1.34s
domContentLoaded 733ms 37ms 709ms 1.01s 766ms 1.01s
firstPaint 81ms 12ms 60ms 188ms 88ms 188ms
firstContentfulPaint 81ms 12ms 60ms 188ms 88ms 188ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.15 MiB (100%)
  • ui: 8.2 MiB (100%)
  • common: 10.99 MiB (100%)

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 9, 2026

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 9, 2026

Builds ready [7e369cc]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2742722762276276
total2742722762276276
Confirm Txconfirm_tx6047603160691460486069
total6047603160691460486069
Bridge User Actionsbridge_load_page21218923016222230
bridge_load_asset_picker22716725533250255
bridge_search_token74172576414748764
total1172112412053311991205
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14181169175610914621608
load118797814949812171379
domContentLoaded118097314909712131370
domInteractive2817102172575
firstPaint164691291137215325
backgroundConnect21619437020220245
firstReactRender21135262235
initialActions105124
loadScripts98178612929610151165
setupStore1374071626
numNetworkReqs322289202285
Power User HomeuiStartup20091609251513720622228
load11811053186515511791507
domContentLoaded11651038185615111581481
domInteractive3519158223577
firstPaint1787549288226326
backgroundConnect31626755650320397
firstReactRender23154262534
initialActions107113
loadScripts94382716231479361271
setupStore1573241822
numNetworkReqs68351794555167
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2202202200220220
srpButtonToSrpForm94929519595
confirmSrpToPwForm21212202222
pwFormToMetricsScreen15151501515
metricsToWalletReadyScreen16151601616
doneButtonToHomeScreen61458966429605664
openAccountMenuToAccountListLoaded2920289929461729192946
total3912386639713839393971
Onboarding New WalletcreateWalletToSocialScreen2182172201219220
srpButtonToPwForm1081081090109109
createPwToRecoveryScreen889089
skipBackupToMetricsScreen36353613636
agreeButtonToOnboardingSuccess15151611616
doneButtonToAssetList50248552213503522
total88987291516888915
Asset DetailsassetClickToPriceChart12711313911138139
total12711313911138139
Solana Asset DetailsassetClickToPriceChart88859238792
total88859238792
Import Srp HomeloginToHomeScreen19851825212811620852128
openAccountMenuAfterLogin45414934649
homeAfterImportWithNewWallet2321223224286723472428
total436443554376943764376
Send TransactionsopenSendPageFromHome23163372633
selectTokenToSendFormLoaded19182011820
reviewTransactionToConfirmationPage8468448471846847
total8938918952895895
SwapopenSwapPageFromHome35284153941
fetchAndDisplaySwapQuotes268526822693526832693
total2741272127692227662769
🌐 Dapp Page Load Benchmarks

Current Commit: 7e369cc | Date: 3/9/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±39ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 732ms (±36ms) 🟢 | historical mean value: 727ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 80ms (±14ms) 🟢 | historical mean value: 81ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 39ms 1.02s 1.33s 1.06s 1.33s
domContentLoaded 732ms 36ms 708ms 1.01s 745ms 1.01s
firstPaint 80ms 14ms 60ms 208ms 88ms 208ms
firstContentfulPaint 80ms 14ms 60ms 208ms 88ms 208ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.15 MiB (100%)
  • ui: 8.2 MiB (100%)
  • common: 10.99 MiB (100%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-L team-core-extension-ux Core Extension UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants