Skip to content

Conversation

@MajorLift
Copy link
Contributor

@MajorLift MajorLift commented Nov 3, 2025

Motivation

This commit enables React Compiler for Browserify builds, and for ESLint (via the react-compiler/react-compiler ruleset). We can expect long-term UI performance benefits and developer time savings from this change. The Compiler transparently adds memoization code for React components and hooks, among other optimizations, and enforces React best practices in new code.

Description

Because enabling React Compiler requires addressing all violations of the react-compiler/react-compiler rule, this commit contains a large number of formatting changes and renames that do not require close review, alongside refactors and logical changes that do.

I would suggest that reviewers primarily focus on whether a given change is problematic, rather than on whether it is necessary. If the motivation for any change is unclear, it's safe to assume that it fixes an error thrown in CI. The objective of this commit is to ship fixes that unblock React Compiler without introducing regressions in functionality or performance. Suggestions on implementing React best practices will be catalogued and addressed in follow-up PRs.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null (non-user facing but regressions possible)

Related issues

Manual testing steps

  1. Create browserify dev build with yarn start
  2. In ./dist/chrome open a file ui-3.js - ui-17.js.
  3. Search for "_reactCompilerRuntime.c".
  4. There should be many examples of React Compiler-optimized code e.g.
  const $ = (0, _reactCompilerRuntime.c)(22);
  const {
    pathname
  } = (0, _reactRouterDomV5Compat.useLocation)();
  const dispatch = (0, _reactRedux.useDispatch)();
  const t = (0, _useI18nContext.useI18nContext)();
  let t0;
  if ($[0] !== pathname) {
    t0 = (0, _snaps2.decodeSnapIdFromPathname)(pathname);
    $[0] = pathname;
    $[1] = t0;
  } else {
    t0 = $[1];
  }

The 10% bundle size increase is also an indication of the extra memoization being applied.

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.

Note

Enable React Compiler and its ESLint rule, updating build/config and policies, and refactor code/tests (hooks/memoization, APIs) to satisfy the compiler.

  • Build/Config:
    • Enable React Compiler via Babel (babel-plugin-react-compiler) for ui/{components,contexts,hooks,layouts,pages}; add react-compiler-runtime.
    • Enforce eslint-plugin-react-compiler rule; bump eslint-plugin-react and eslint-plugin-react-hooks.
    • Depcheck ignores updated.
  • Security/Policies (LavaMoat):
    • Allow react-compiler-runtime, babel-plugin-react-compiler, and updated ESLint deps across browserify/webpack/build-system policies.
  • Codebase Refactors (to satisfy compiler/ESLint):
    • Stabilize hooks and side-effects (memoization, dependency arrays, cleanup on unmount, debounce via refs, avoid conditional hooks).
    • Safer patterns and minor fixes (e.g., Array.isArray, optional chaining, immutable updates, prop/types tweaks, background method check).
    • Selector/API renames: useSafeChainsListValidationSelectorgetUseSafeChainsListValidation, use4ByteResolutionSelectorgetUse4ByteResolution, getIsEstimatedReturnLowuseGetIsEstimatedReturnLow, etc.
    • QR reader and polling logic refactored for stable timers and teardown.
    • Asset page/type utilities (isNativeAsset), balance handling made immutable.
  • Tests:
    • Update tests to use renderHook and adapted mocks for renamed selectors/components.

Written by Cursor Bugbot for commit 713aa39. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

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.

@metamaskbot metamaskbot added the team-extension-platform Extension Platform team label Nov 3, 2025
@socket-security
Copy link

socket-security bot commented Nov 3, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedreact-compiler-runtime@​1.0.01001007197100
Addedbabel-plugin-react-compiler@​1.0.01001007997100
Updatedeslint-plugin-react@​7.30.1 ⏵ 7.37.59910010084100
Addedeslint-plugin-react-compiler@​19.1.0-rc.21001009293100
Updatedeslint-plugin-react-hooks@​4.6.0 ⏵ 5.2.0100100100 +796100

View full report

@socket-security
Copy link

socket-security bot commented Nov 3, 2025

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring alerts on:

  • @babel/plugin-proposal-private-methods@7.18.6
  • string.prototype.repeat@1.0.0
  • async-function@1.0.0

View full report

@metamaskbot
Copy link
Collaborator

metamaskbot commented Nov 3, 2025

✨ Files requiring CODEOWNER review ✨

🔑 @MetaMask/accounts-engineers (2 files, +8 -8)
  • 📁 ui/
    • 📁 components/
      • 📁 app/
        • 📁 identity/
          • 📁 backup-and-sync-features-toggles/
            • 📄 backup-and-sync-features-toggles.tsx +8 -7
      • 📁 multichain/
        • 📁 account-list-item-menu/
          • 📄 account-list-item-menu.js +0 -1

👨‍🔧 @MetaMask/core-extension-ux (1 files, +0 -1)
  • 📁 ui/
    • 📁 components/
      • 📁 multichain/
        • 📁 account-list-item-menu/
          • 📄 account-list-item-menu.js +0 -1

🫰 @MetaMask/core-platform (1 files, +3 -0)
  • 📁 ui/
    • 📁 components/
      • 📁 app/
        • 📁 snaps/
          • 📁 snap-ui-renderer/
            • 📄 snap-ui-renderer.js +3 -0

🎨 @MetaMask/design-system-engineers (2 files, +4 -1)
  • 📁 ui/
    • 📁 components/
      • 📁 component-library/
        • 📁 select-wrapper/
          • 📄 select-wrapper.stories.tsx +2 -1
        • 📁 text-field/
          • 📄 text-field.tsx +2 -0

🧩 @MetaMask/extension-devs (8 files, +623 -301)
  • 📁 lavamoat/
    • 📁 browserify/
      • 📁 beta/
        • 📄 policy.json +46 -38
      • 📁 experimental/
        • 📄 policy.json +46 -38
      • 📁 flask/
        • 📄 policy.json +46 -38
      • 📁 main/
        • 📄 policy.json +46 -38
    • 📁 build-system/
      • 📄 policy-override.json +17 -1
      • 📄 policy.json +346 -72
    • 📁 webpack/
      • 📁 mv2/
        • 📄 policy.json +38 -38
      • 📁 mv3/
        • 📄 policy.json +38 -38

💎 @MetaMask/metamask-assets (2 files, +2 -4)
  • 📁 ui/
    • 📁 components/
      • 📁 app/
        • 📁 assets/
          • 📁 token-cell/
            • 📄 token-cell.test.tsx +2 -2
          • 📁 token-list/
            • 📄 token-list.tsx +0 -2

📜 @MetaMask/policy-reviewers (8 files, +623 -301)
  • 📁 lavamoat/
    • 📁 browserify/
      • 📁 beta/
        • 📄 policy.json +46 -38
      • 📁 experimental/
        • 📄 policy.json +46 -38
      • 📁 flask/
        • 📄 policy.json +46 -38
      • 📁 main/
        • 📄 policy.json +46 -38
    • 📁 build-system/
      • 📄 policy-override.json +17 -1
      • 📄 policy.json +346 -72
    • 📁 webpack/
      • 📁 mv2/
        • 📄 policy.json +38 -38
      • 📁 mv3/
        • 📄 policy.json +38 -38

Tip

Follow the policy review process outlined in the LavaMoat Policy Review Process doc before expecting an approval from Policy Reviewers.


🔗 @MetaMask/supply-chain (8 files, +623 -301)
  • 📁 lavamoat/
    • 📁 browserify/
      • 📁 beta/
        • 📄 policy.json +46 -38
      • 📁 experimental/
        • 📄 policy.json +46 -38
      • 📁 flask/
        • 📄 policy.json +46 -38
      • 📁 main/
        • 📄 policy.json +46 -38
    • 📁 build-system/
      • 📄 policy-override.json +17 -1
      • 📄 policy.json +346 -72
    • 📁 webpack/
      • 📁 mv2/
        • 📄 policy.json +38 -38
      • 📁 mv3/
        • 📄 policy.json +38 -38

@MajorLift MajorLift changed the base branch from main to jongsun/chore/251030-enable-rules-of-hooks November 3, 2025 19:48
@metamaskbot
Copy link
Collaborator

Builds ready [3eabf52]
UI Startup Metrics (1311 ± 102 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup13111129155710213891480
load112996813479412041293
domContentLoaded112296113389311991280
domInteractive2314128162151
firstPaint591101134544711231260
backgroundConnect2302192638235246
firstReactRender3120167163548
getState2185072433
initialActions61688617
loadScripts8987381112939701052
setupStore1072631115
numNetworkReqs1367921676
BrowserifyPower User HomeuiStartup20351747278138325552781
load1067914149821113611498
domContentLoaded1059907149021013471490
domInteractive271570174470
firstPaint59819713693749461369
backgroundConnect23621626916252269
firstReactRender27253122731
getState17715029032182290
initialActions51133513
loadScripts834684124120011001241
setupStore1392861228
numNetworkReqs15910331889308318
WebpackStandard HomeuiStartup8266851224948421075
load60454293480608846
domContentLoaded59653590876602820
domInteractive16114981438
firstPaint20855882212169819
backgroundConnect271279133061
firstReactRender28176283336
getState1262841418
initialActions3015349
loadScripts59353390075600812
setupStore1052131216
numNetworkReqs1467519872
WebpackPower User HomeuiStartup13321178194623515311946
load69359610171347801017
domContentLoaded669586916112745916
domInteractive251373205073
firstPaint36983980307619980
backgroundConnect761821472183214
firstReactRender28245982659
getState1396616326154163
initialActions31143514
loadScripts664584905109734905
setupStore96265926
numNetworkReqs1499828675271286
FirefoxBrowserifyStandard HomeuiStartup14771294197313415431743
load1265111316299413221440
domContentLoaded1265111316299413221440
domInteractive1213545460124231
firstPaint------
backgroundConnect4324135205283
firstReactRender26216462644
getState10419720826
initialActions41273312
loadScripts1240109316009013021414
setupStore1265571133
numNetworkReqs1266816761
BrowserifyPower User HomeuiStartup25952290331732928443317
load14731258190520416491905
domContentLoaded14731257190520416481905
domInteractive22796523159362523
firstPaint------
backgroundConnect742717845124178
firstReactRender433267105267
getState15010821034189210
initialActions11146153046
loadScripts14441231187520216231875
setupStore3871705048170
numNetworkReqs1397033599236335
WebpackStandard HomeuiStartup15991412210212716311918
load1365121116268713991541
domContentLoaded1365121116258713991540
domInteractive973023934112158
firstPaint------
backgroundConnect4622134205388
firstReactRender312274133072
getState84436916
initialActions51407417
loadScripts1337119416048313711502
setupStore177207231342
numNetworkReqs1367018767
WebpackPower User HomeuiStartup24872135314734228453147
load14481253179918316771799
domContentLoaded14471253179918316761799
domInteractive1227228866183288
firstPaint------
backgroundConnect1063125275213252
firstReactRender463192185892
getState1197317624134176
initialActions11263161163
loadScripts14121233174017216381740
setupStore3861043677104
numNetworkReqs13461338106240338
📊 Page Load Benchmark Results

Current Commit: 3eabf52 | Date: 11/3/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±64ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 737ms (±62ms) 🟢 | historical mean value: 726ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±15ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 64ms 1.02s 1.37s 1.26s 1.37s
domContentLoaded 737ms 62ms 706ms 1.03s 940ms 1.03s
firstPaint 78ms 15ms 60ms 216ms 88ms 216ms
firstContentfulPaint 78ms 15ms 60ms 216ms 88ms 216ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 68 Bytes (0%)
  • ui: 497.07 KiB (7%)
  • common: 38.75 KiB (0.45%)

@MajorLift MajorLift marked this pull request as ready for review November 4, 2025 12:24
@MajorLift MajorLift requested review from a team as code owners November 4, 2025 12:24
@github-project-automation github-project-automation bot moved this to Needs dev review in PR review queue Nov 4, 2025
@MajorLift MajorLift added the needs-qa Label will automate into QA workspace label Nov 5, 2025
@MajorLift
Copy link
Contributor Author

@david0xd I've addressed or closed all cursorbot comments. Almost all of them are pointing out issues with the preexisting code not new additions from this PR. Some of them are plain wrong. Hopefully this makes things less noisy.😅

},
},
plugins: ['react'],
plugins: ['react', 'react-compiler'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is react-compiler the right plugin? https://react.dev/blog/2025/10/07/react-compiler-1 says

Compiler-powered lint rules ship in eslint-plugin-react-hooks’s recommended and recommended-latest preset.

and

If you have already installed eslint-plugin-react-compiler, you can now remove it and use eslint-plugin-react-hooks@latest. Many thanks to @michaelfaith for contributing to this improvement!

Copy link
Contributor Author

@MajorLift MajorLift Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was planning to do this in a separate PR since there would be some noisy diffs e.g. removing eslint-disable-next-line react-compiler/react-compiler. More importantly, our eslint-plugin-react-hooks is two major versions behind. I haven't looked into what the breaking changes are between ours and the latest version, but I'm cautious about attempting that upgrade here.

For this PR we're using eslint-plugin-react-compiler@19.1.0-rc.2. Based on its changelog, it appears that eslint-plugin-react-hooks just adds the existing react compiler lint rules without altering them, so we shouldn't be missing anything functionality-wise for now.

@metamaskbot
Copy link
Collaborator

Builds ready [e839433]
UI Startup Metrics (1251 ± 99 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1251107314699913321400
load107492312579011501201
domContentLoaded106891912518811421190
domInteractive231476142066
firstPaint52076126841510271204
backgroundConnect21319228111217231
firstReactRender30196293549
getState331867113958
initialActions103111
loadScripts860718103286934984
setupStore1162431218
numNetworkReqs1257821577
BrowserifyPower User HomeuiStartup18561539276526120192442
load999885150815410061446
domContentLoaded98687814931539801432
domInteractive36151733827144
firstPaint5138114953949231407
backgroundConnect21920225411224238
firstReactRender80441351687114
getState17113034546191298
initialActions102112
loadScripts78167712851517781225
setupStore1994792540
numNetworkReqs1106727548122217
WebpackStandard HomeuiStartup834724102773871985
load61755780860624775
domContentLoaded61255380259620768
domInteractive2414113192175
firstPaint21473780150196594
backgroundConnect1253981530
firstReactRender3021112103339
getState291474113744
initialActions104111
loadScripts60955179357617758
setupStore1272941419
numNetworkReqs1257719570
WebpackPower User HomeuiStartup13551129197622115101808
load6535751010105673953
domContentLoaded643571986103658944
domInteractive34161683528142
firstPaint259851013195232670
backgroundConnect1475971727
firstReactRender7950108128898
getState13010826832128215
initialActions104112
loadScripts640569977101656935
setupStore18974112339
numNetworkReqs926520233100185
FirefoxBrowserifyStandard HomeuiStartup12381073160211112971485
load105092711997311241175
domContentLoaded104992211997411241175
domInteractive60311683282137
firstPaint------
backgroundConnect3621173203776
firstReactRender23186982338
getState12614216931
initialActions102122
loadScripts102991211747110951155
setupStore125108131034
numNetworkReqs1156616660
BrowserifyPower User HomeuiStartup26341799363137128783437
load1202982165017212231585
domContentLoaded1201982165017312221585
domInteractive14734565133156509
firstPaint------
backgroundConnect185241067213196788
firstReactRender89421612399141
getState22290890230176840
initialActions3040538
loadScripts1160958158916411831548
setupStore1167818177110653
numNetworkReqs89592033985195
WebpackStandard HomeuiStartup15681353285319316011894
load13331158259916213741553
domContentLoaded13321158259916213741553
domInteractive8829139413799159
firstPaint------
backgroundConnect49212023048129
firstReactRender29217663139
getState137175171322
initialActions103123
loadScripts13031120258115713511470
setupStore166208261253
numNetworkReqs1256817666
WebpackPower User HomeuiStartup28262127379535130493503
load13901097192920714591801
domContentLoaded13901097192920714591801
domInteractive14129651149135508
firstPaint------
backgroundConnect17024828178214608
firstReactRender85381251895115
getState26782928266217876
initialActions3048537
loadScripts13531080189920514171772
setupStore1236780195100749
numNetworkReqs91612124282203
📊 Page Load Benchmark Results

Current Commit: e839433 | Date: 11/21/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±41ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 719ms (±38ms) 🟢 | historical mean value: 728ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±12ms) 🟢 | historical mean value: 79ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 41ms 1.00s 1.33s 1.06s 1.33s
domContentLoaded 719ms 38ms 694ms 998ms 741ms 998ms
firstPaint 77ms 12ms 60ms 172ms 92ms 172ms
firstContentfulPaint 77ms 12ms 60ms 172ms 92ms 172ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 74 Bytes (0%)
  • ui: 797.98 KiB (11.42%)
  • common: 40.39 KiB (0.46%)

"react": "^17.0.2",
"react-beautiful-dnd": "^13.1.1",
"react-chartjs-2": "^5.2.0",
"react-compiler-runtime": "^1.0.0",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Incorrect semver range for react-compiler-runtime dependency (Bugbot Rules)

The react-compiler-runtime dependency uses ^1.0.0 which allows minor and patch version updates. However, as noted in the PR discussion, this package is in the 0.x version range where breaking changes can occur at any time per semver conventions. The version should be pinned to exactly 0.2.0 (without the caret) to prevent unexpected breaking changes from being automatically installed.

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope that discussion was about a different package (react-compiler-webpack) that's no longer added in this PR. ^1.0.0 is not in the 0.x range so the note about using an exact version doesn't apply here. Please stop bringing this up.

@MajorLift
Copy link
Contributor Author

@metamaskbot update-policies

@MajorLift MajorLift force-pushed the jongsun/build/251103-enable-react-compiler branch from e628f03 to e839433 Compare November 21, 2025 17:30
@metamaskbot
Copy link
Collaborator

No policy changes

@metamaskbot
Copy link
Collaborator

Builds ready [e839433]
UI Startup Metrics (1215 ± 101 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12151042150010112931412
load104590612739011141197
domContentLoaded103889012688911061189
domInteractive241498172170
firstPaint49396126240110231158
backgroundConnect2081922328212226
firstReactRender29205393747
getState30156093350
initialActions103112
loadScripts836668106688904978
setupStore1174441118
numNetworkReqs1257720573
BrowserifyPower User HomeuiStartup18731530266226020172497
load1009879184817810131495
domContentLoaded99487218301769941455
domInteractive36171913728150
firstPaint52710218494229141482
backgroundConnect22219926712228246
firstReactRender75471401580109
getState17512833942194263
initialActions105112
loadScripts79067116071727901253
setupStore201070102640
numNetworkReqs1456930051185266
WebpackStandard HomeuiStartup8267271109848641007
load61455680960624775
domContentLoaded60955280159621771
domInteractive241392192181
firstPaint25073785176240632
backgroundConnect1153781429
firstReactRender2920114103239
getState301375123654
initialActions103112
loadScripts60655079257619762
setupStore1272941420
numNetworkReqs1257720573
WebpackPower User HomeuiStartup14171185204122415911903
load66658110811206771006
domContentLoaded6565741073120658995
domInteractive36171853828145
firstPaint298711044222388674
backgroundConnect1576881729
firstReactRender8148108118896
getState1529928639169263
initialActions105112
loadScripts6535721065118656985
setupStore241075143456
numNetworkReqs926419634101188
FirefoxBrowserifyStandard HomeuiStartup12301055169912612731529
load104191112718210901209
domContentLoaded104091112718210891209
domInteractive56292343778140
firstPaint------
backgroundConnect3618175223873
firstReactRender22183742234
getState1169611924
initialActions102012
loadScripts102089512497910671181
setupStore126159171028
numNetworkReqs1257017665
BrowserifyPower User HomeuiStartup27232017380934428553634
load1191970173016612191544
domContentLoaded1190964173016712181544
domInteractive13633623126141483
firstPaint------
backgroundConnect196291075238203807
firstReactRender86391732194126
getState24684908245214859
initialActions2113226
loadScripts1158951167916311951501
setupStore1086789168117656
numNetworkReqs89592184282202
WebpackStandard HomeuiStartup14511277195513415061767
load1236108415729813061400
domContentLoaded1235108415729813061395
domInteractive64271853486141
firstPaint------
backgroundConnect42211212244117
firstReactRender27217572838
getState136170211023
initialActions102012
loadScripts1209106815469012751347
setupStore14593181061
numNetworkReqs1257217663
WebpackPower User HomeuiStartup28392022394538330343612
load13851117215720715321785
domContentLoaded13851117215720715301784
domInteractive13328624140143543
firstPaint------
backgroundConnect17527865196201643
firstReactRender86391912394122
getState20581928223169813
initialActions4150867
loadScripts13451094204820114941718
setupStore1285779211102757
numNetworkReqs91572174382202
📊 Page Load Benchmark Results

Current Commit: e839433 | Date: 11/21/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±52ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 740ms (±50ms) 🟢 | historical mean value: 731ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 79ms (±12ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 52ms 1.02s 1.32s 1.10s 1.32s
domContentLoaded 740ms 50ms 704ms 1.01s 773ms 1.01s
firstPaint 79ms 12ms 60ms 176ms 96ms 176ms
firstContentfulPaint 79ms 12ms 60ms 176ms 96ms 176ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 74 Bytes (0%)
  • ui: 800.88 KiB (11.46%)
  • common: 40.51 KiB (0.46%)

cursor[bot]

This comment was marked as off-topic.

@metamaskbot
Copy link
Collaborator

Builds ready [2576d4f]
UI Startup Metrics (1206 ± 101 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12061039153810112711370
load103989413489910941230
domContentLoaded103289013389710871225
domInteractive231492152067
firstPaint513140135240810231180
backgroundConnect2081922398211224
firstReactRender29196083545
getState341658104051
initialActions105112
loadScripts8306881131998871022
setupStore1272741423
numNetworkReqs1257820573
BrowserifyPower User HomeuiStartup19281595348329420682471
load1044905217019910421534
domContentLoaded1027896214619710171517
domInteractive42173105430187
firstPaint57210121604619551535
backgroundConnect22920730014234253
firstReactRender79451141388103
getState17713235546193289
initialActions108113
loadScripts81669318691928101310
setupStore21951102746
numNetworkReqs92651883195179
WebpackStandard HomeuiStartup8587611080829091044
load63557890768643814
domContentLoaded63157488367638808
domInteractive2615132222282
firstPaint23590891164208619
backgroundConnect1264181131
firstReactRender30214453339
getState311481113948
initialActions103112
loadScripts62857287064636799
setupStore1252941519
numNetworkReqs1257719569
WebpackPower User HomeuiStartup14541216262423915731925
load67758913821326851025
domContentLoaded66658213741316671015
domInteractive38172094129167
firstPaint274891032181284650
backgroundConnect1583971930
firstReactRender8154112128898
getState15412330336165251
initialActions105112
loadScripts66458013651296651006
setupStore24970163558
numNetworkReqs1206926542134228
FirefoxBrowserifyStandard HomeuiStartup13031113173011813681517
load110196013548111511248
domContentLoaded110096013548211511248
domInteractive64322083684146
firstPaint------
backgroundConnect4023195243999
firstReactRender24185372439
getState136136161048
initialActions103122
loadScripts107594212467311211208
setupStore1166481026
numNetworkReqs1256616662
BrowserifyPower User HomeuiStartup27031672386938129483441
load12121003183818412401663
domContentLoaded12111002183718312401648
domInteractive15234674147180555
firstPaint------
backgroundConnect23823968247398825
firstReactRender84321361993126
getState22840883233184837
initialActions208137
loadScripts1169983180117611931610
setupStore1097789165102589
numNetworkReqs89572074082198
WebpackStandard HomeuiStartup14521293195614114941813
load12391076158110712921431
domContentLoaded12381076158010612911431
domInteractive60271633481129
firstPaint------
backgroundConnect42211212244103
firstReactRender28216872838
getState126137151025
initialActions103012
loadScripts1213106015639912681389
setupStore12574121041
numNetworkReqs1256817666
WebpackPower User HomeuiStartup29262274380730731263540
load14001070194720715761803
domContentLoaded13991070194720815761803
domInteractive13329586133147497
firstPaint------
backgroundConnect17727910185222622
firstReactRender86401521894114
getState333821022296635877
initialActions3159627
loadScripts13611054190920314501755
setupStore113577118091710
numNetworkReqs90522184484208
📊 Page Load Benchmark Results

Current Commit: 2576d4f | Date: 11/21/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.02s (±37ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 712ms (±34ms) 🟢 | historical mean value: 733ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 73ms (±10ms) 🟢 | historical mean value: 81ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.02s 37ms 1.00s 1.30s 1.05s 1.30s
domContentLoaded 712ms 34ms 691ms 971ms 724ms 971ms
firstPaint 73ms 10ms 56ms 160ms 80ms 160ms
firstContentfulPaint 73ms 10ms 56ms 160ms 80ms 160ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 74 Bytes (0%)
  • ui: 801.21 KiB (11.46%)
  • common: 40.51 KiB (0.46%)

@MajorLift
Copy link
Contributor Author

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policy update failed. You can review the logs or retry the policy update here

@MajorLift
Copy link
Contributor Author

MajorLift commented Nov 21, 2025

The repository-health-checks job is failing on the non-blocking dedupe check because...

Running yarn dedupe breaks "Update LavaMoat webpack policy" with the following error:

Run yarn webpack --env production --no-cache --generatePolicy
/home/runner/work/metamask-extension/metamask-extension/node_modules/async-function/require.mjs:2
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from==="object"||typeof from==="function"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:true}):target,mod));var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:true}),mod);var require_exports={};__export(require_exports,{default:()=>require_default,"module.exports":()=>import_index.default});module.exports=__toCommonJS(require_exports);var import_index=__toESM(require("./index.js"));var require_default=import_index.default;0&&(module.exports={"module.exports"});
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

SyntaxError: Unexpected string
    at wrapSafe (node:internal/modules/cjs/loader:1692:18)
    at Module._compile (node:internal/modules/cjs/loader:1735:20)
    at Object.transformer (/home/runner/work/metamask-extension/metamask-extension/node_modules/tsx/dist/register-DCnOAxY2.cjs:2:1186)
    at Module.load (node:internal/modules/cjs/loader:1481:32)
    at Module._load (node:internal/modules/cjs/loader:1300:12)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
    at Module.require (node:internal/modules/cjs/loader:1504:12)
    at require (node:internal/modules/helpers:152:16)
    at Object.<anonymous> (/home/runner/work/metamask-extension/metamask-extension/node_modules/get-intrinsic/index.js:154:24)

Node.js v24.11.1

@metamaskbot
Copy link
Collaborator

Builds ready [d0321db]
UI Startup Metrics (1227 ± 118 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12271055173311812911419
load105191014039911161219
domContentLoaded104490613949711041204
domInteractive231487152170
firstPaint54489124142110431198
backgroundConnect21419826812218238
firstReactRender28195183445
getState3316116133751
initialActions105112
loadScripts835699115593898992
setupStore1152841120
numNetworkReqs1257821575
BrowserifyPower User HomeuiStartup19341596253125521362428
load1028895156915810351489
domContentLoaded1013890155315710121468
domInteractive40162694829173
firstPaint5139315643909381102
backgroundConnect22720526712233249
firstReactRender79451381583117
getState18213631545206295
initialActions105112
loadScripts80269113321568011257
setupStore19760102737
numNetworkReqs1246728053161224
WebpackStandard HomeuiStartup8567481075829051052
load63457486064640802
domContentLoaded62957085063635797
domInteractive251599172273
firstPaint233105811163209636
backgroundConnect1364191432
firstReactRender3120117123542
getState311364113848
initialActions104111
loadScripts62656884161633786
setupStore1273141420
numNetworkReqs1257820571
WebpackPower User HomeuiStartup14481193215222216201911
load67057711031176771000
domContentLoaded6595721095116656987
domInteractive36162173929144
firstPaint285911045211275719
backgroundConnect1575571829
firstReactRender8148115128598
getState15512226930168229
initialActions102112
loadScripts6565701085114654978
setupStore23966143453
numNetworkReqs1476730154192265
FirefoxBrowserifyStandard HomeuiStartup12381070171211912811511
load105292712677411021213
domContentLoaded105192712607411021212
domInteractive59321793084117
firstPaint------
backgroundConnect3922151244091
firstReactRender23186672242
getState106779920
initialActions102012
loadScripts102791212476710671158
setupStore1167610929
numNetworkReqs1156815655
BrowserifyPower User HomeuiStartup27431944352132129653334
load12911073177118013941681
domContentLoaded12901073177018013941681
domInteractive15838674154167598
firstPaint------
backgroundConnect254311061253427801
firstReactRender85511421995125
getState24787878243205817
initialActions318238
loadScripts12251051168316912541650
setupStore1038741150104597
numNetworkReqs87562063985189
WebpackStandard HomeuiStartup14721320206013914981782
load1251113215348612851435
domContentLoaded1250113215348612851434
domInteractive67291813185112
firstPaint------
backgroundConnect44202843345110
firstReactRender27216962935
getState146139181242
initialActions103122
loadScripts1224110814127612601388
setupStore136160171236
numNetworkReqs1256917663
WebpackPower User HomeuiStartup28862061379137030783589
load13801101189721415171834
domContentLoaded13801100189621415161834
domInteractive13630662153133556
firstPaint------
backgroundConnect17425881191218648
firstReactRender84411521893117
getState251841533276205902
initialActions318237
loadScripts13441082185720914671802
setupStore1655794227136757
numNetworkReqs90582134382203
📊 Page Load Benchmark Results

Current Commit: d0321db | Date: 11/21/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±78ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 732ms (±74ms) 🟢 | historical mean value: 731ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 81ms (±12ms) 🟢 | historical mean value: 80ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 78ms 977ms 1.39s 1.30s 1.39s
domContentLoaded 732ms 74ms 676ms 1.06s 970ms 1.06s
firstPaint 81ms 12ms 64ms 184ms 96ms 184ms
firstContentfulPaint 81ms 12ms 64ms 184ms 96ms 184ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 53 Bytes (0%)
  • ui: 753.39 KiB (10.7%)
  • common: 38.3 KiB (0.44%)

@MajorLift MajorLift enabled auto-merge November 21, 2025 20:21
@MajorLift MajorLift disabled auto-merge November 21, 2025 20:21
) {
if (action.ownerId === undefined) {
return state;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Inconsistent undefined handling breaks SET_ALERT_CONFIRMED action

The reducer returns early when action.ownerId is undefined for all action types, but SetAlertConfirmedAction has ownerId typed as string (not string | undefined). This creates an inconsistency where the early return check applies to an action type that should never have an undefined ownerId. If setAlertConfirmed is somehow called with an undefined value that gets coerced, the SET_ALERT_CONFIRMED case will be unreachable, silently failing to update the confirmed state without any error.

Fix in Cursor Fix in Web

@MajorLift MajorLift force-pushed the jongsun/build/251103-enable-react-compiler branch from 95de3a7 to 713aa39 Compare November 23, 2025 08:14
) {
if (action.ownerId === undefined) {
return state;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Reducer silently ignores valid SET_ALERT_CONFIRMED actions

The reducer now returns early when action.ownerId is undefined for all action types, but SetAlertConfirmedAction has ownerId typed as string (not string | undefined), meaning it can never be undefined. However, the early return applies to all actions including SET_ALERT_CONFIRMED. If a SET_ALERT_CONFIRMED action somehow has an undefined ownerId at runtime (despite the type), it will silently return the unchanged state instead of processing the action. This inconsistency between the type definition and runtime check creates a potential silent failure mode where alert confirmations could be lost without any error indication.

Fix in Cursor Fix in Web

@metamaskbot
Copy link
Collaborator

Builds ready [713aa39]
UI Startup Metrics (1208 ± 110 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12081050156811012611433
load1041905139110211141249
domContentLoaded1035902138310111101239
domInteractive2314111172075
firstPaint60295139942610311180
backgroundConnect2091902519212229
firstReactRender28195183345
getState3215100113556
initialActions106112
loadScripts83269711661009081026
setupStore1172241120
numNetworkReqs1257720573
BrowserifyPower User HomeuiStartup18871554334630720732449
load1023883208819710281504
domContentLoaded1007876204319410061487
domInteractive36171873930166
firstPaint5358820994409341487
backgroundConnect22519934919229255
firstReactRender7646124128197
getState17513136144189284
initialActions103112
loadScripts80067717751887971270
setupStore19765112341
numNetworkReqs1296829656175270
WebpackStandard HomeuiStartup8327411148818701000
load61656481060618777
domContentLoaded61156080459615769
domInteractive231385172173
firstPaint22381766146218600
backgroundConnect1263281828
firstReactRender28204863238
getState311399133747
initialActions103111
loadScripts60855879057613759
setupStore1254451417
numNetworkReqs1257820573
WebpackPower User HomeuiStartup14571201260823315851949
load67957814421326871005
domContentLoaded6695691428131671996
domInteractive36171863831154
firstPaint273811002191267664
backgroundConnect1584271928
firstReactRender8150117118897
getState15712529134165239
initialActions103112
loadScripts6665671417129669987
setupStore211067122948
numNetworkReqs1476830359200280
FirefoxBrowserifyStandard HomeuiStartup12071059177410812511444
load103592014798110771172
domContentLoaded103492014788110771172
domInteractive54311402872120
firstPaint------
backgroundConnect3218120143562
firstReactRender21184342233
getState106688820
initialActions103122
loadScripts101590614547610561150
setupStore95326929
numNetworkReqs1157116663
BrowserifyPower User HomeuiStartup26361859379534328103457
load1169953167518611951604
domContentLoaded1168948167518611951604
domInteractive12932552125132486
firstPaint------
backgroundConnect187221008227183754
firstReactRender82361621889112
getState25385868249215838
initialActions3038427
loadScripts1130935163618011431525
setupStore1307828195115747
numNetworkReqs90592184286207
WebpackStandard HomeuiStartup14241264193912814911701
load1204107214758812751377
domContentLoaded1203107214758812751377
domInteractive53241322980115
firstPaint------
backgroundConnect4422198274496
firstReactRender27198082837
getState126132141118
initialActions102012
loadScripts1178105513988112511323
setupStore155182231147
numNetworkReqs1256817664
WebpackPower User HomeuiStartup28002104376834230053492
load14061107202621915601812
domContentLoaded14061106202521915601805
domInteractive13230783146131523
firstPaint------
backgroundConnect15325644149198507
firstReactRender85411512093121
getState25886918257217847
initialActions318237
loadScripts13631092198421214701778
setupStore1407774220104764
numNetworkReqs89602184084203
📊 Page Load Benchmark Results

Current Commit: 713aa39 | Date: 11/23/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±65ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 741ms (±62ms) 🟢 | historical mean value: 731ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±10ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 65ms 1.02s 1.34s 1.29s 1.34s
domContentLoaded 741ms 62ms 706ms 1.02s 959ms 1.02s
firstPaint 78ms 10ms 64ms 168ms 88ms 168ms
firstContentfulPaint 78ms 10ms 64ms 168ms 88ms 168ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 53 Bytes (0%)
  • ui: 753.39 KiB (10.7%)
  • common: 38.3 KiB (0.44%)

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

Labels

needs-qa Label will automate into QA workspace size-XL team-extension-platform Extension Platform team

Projects

Status: Needs dev review

Development

Successfully merging this pull request may close these issues.

6 participants