You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Performance audit finding · Severity: Medium (tooling/ratchet) · Effort: Medium, then ongoing · Fix risk: Simple (non-prod builds only) · Test safety net: N/A (build gate)
Owner: @MetaMask/mobile-platform (suggested)
File: babel.config.js:67
Depends on: #31500 (logger triage — provides the actionable-error list this ratchet burns down)
What is this about?
panicThreshold controls when a React Compiler diagnostic fails the build instead of silently skipping the file. Mobile currently runs the implicit default ('none'): every diagnostic is a silent skip, so compiler coverage can regress without anyone noticing. The ratchet makes a non-production build progressively intolerant:
Setting
Build fails on
Use
'none' (current/default)
never — failed files silently skipped
production, permanently
'critical_errors'
compiler-internal invariant violations
CI/debug gate, first target
'all_errors'
every diagnostic incl. unsupported syntax
CI/debug gate, end state
The extension tracks the same ladder as MetaMask-planning#6552 (enable critical_errors, fix violations) and #6553 (all_errors); its enablement-run split (metamask-extension#38007: 31 actionable errors vs 7,024 unsupported of 7,308 files) shows the actionable set a ratchet has to clear is small once the Todo category is excluded.
Scenario
N/A — build tooling.
Design
N/A.
Technical Details
Add an env-gated Babel config path (or CI job) that sets panicThreshold: 'critical_errors' in the 'react-compiler' plugin options for non-production builds. Production stays 'none' permanently — one un-compilable file must never block a release for an optional optimization.
Repeat toward 'all_errors'. What remains after that is the unsupported (Todo) set, re-diffed on compiler upgrades — Todos that newly compile are free wins, new errors are regressions the gate now catches.
Threat Modeling Framework
N/A — non-production build gate; no runtime change.
Acceptance Criteria
Non-prod build passes at panicThreshold: 'critical_errors' and the gate runs in CI.
Follow-up ratchet to 'all_errors' tracked, with the remaining actionable-error count trending to zero.
What is this about?
panicThresholdcontrols when a React Compiler diagnostic fails the build instead of silently skipping the file. Mobile currently runs the implicit default ('none'): every diagnostic is a silent skip, so compiler coverage can regress without anyone noticing. The ratchet makes a non-production build progressively intolerant:'none'(current/default)'critical_errors''all_errors'The extension tracks the same ladder as MetaMask-planning#6552 (enable
critical_errors, fix violations) and #6553 (all_errors); its enablement-run split (metamask-extension#38007: 31 actionable errors vs 7,024 unsupported of 7,308 files) shows the actionable set a ratchet has to clear is small once theTodocategory is excluded.Scenario
N/A — build tooling.
Design
N/A.
Technical Details
panicThreshold: 'critical_errors'in the'react-compiler'plugin options for non-production builds. Production stays'none'permanently — one un-compilable file must never block a release for an optional optimization.Todo) errors surfaced by the Collect React Compiler coverage stats and triage actionable vs unsupported-syntax errors #31500 logger until thecritical_errorsgate passes; promote the gate to required CI.'all_errors'. What remains after that is the unsupported (Todo) set, re-diffed on compiler upgrades —Todos that newly compile are free wins, new errors are regressions the gate now catches.Threat Modeling Framework
N/A — non-production build gate; no runtime change.
Acceptance Criteria
panicThreshold: 'critical_errors'and the gate runs in CI.'all_errors'tracked, with the remaining actionable-error count trending to zero.'none').References
babel.config.js:67--reactCompilerDebug={all|critical|none})mms-performanceskill,mm-react-compiler-error-triage(perf: Augmentmms-performancewith frontend learnings from the Extension performance audit skills#49)