Skip to content

feat: Extends performance domain with React Compiler error triage - #145

Closed
MajorLift wants to merge 4 commits into
MetaMask:mainfrom
MajorLift:add/react-compiler-triage
Closed

MajorLift wants to merge 4 commits into
MetaMask:mainfrom
MajorLift:add/react-compiler-triage

Conversation

@MajorLift

@MajorLift MajorLift commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Motivation

The React Compiler fails open: a component it cannot compile ships unoptimized with a green build and no warning, and raising panicThreshold to 'all_errors' to find those components returns an error list that mixes unsupported-syntax noise with real bugs. Its memoization is also not guaranteed to preserve the identity a useEffect dependency needs, so removing a useMemo the compiler seems to make redundant can silently change when an effect fires.

Overview

Extends the mobile performance skill with a React Compiler error-triage reference and an effect-dependency exception.

  • references/mm-react-compiler-error-triage.md tells the agent to sort compiler errors into unsupported (the compiler's Todo category) and actionable errors, and to ratchet panicThreshold in non-production builds rather than set it once.
  • references/mm-react-compiler.md now describes the compiler as running app-wide on its default target: '19', as set up in metamask-mobile#31171 (fully enable React Compiler), in place of the path allowlist and the target: '18' rule, and tells the agent to keep any useMemo or useCallback whose output is a useEffect dependency.

`mm-react-compiler-error-triage` — sorting compiler errors into `Todo`
and unsupported versus actionable, ratcheting `panicThreshold`, and the
`useMemo`/`useCallback` exception for effect dependencies, whose output the
compiler's memoization does not preserve.

Split out of #43: compiler adoption is a different subject from the render
antipattern scans, and nothing in either scan cites it.
`babel-plugin-react-compiler` 1.0.0 logs `CompileSuccess` for every function
in a file whose top-level directive then discards the transform. Only a
directive inside one function's body logs `CompileSkip`. The compiled count
therefore rises with opt-outs and is read against the opt-out count.
…s it

metamask-mobile#31171 (enable the React Compiler across the Metro bundle)
replaced the two-path allowlist. The plugin now applies to every file
except under Jest, with no `target` override, so its default of React 19
applies. The triage reference also named two internal planning tickets.
…ng it

Removing the directive and re-running the compiler settles it: zero new
errors means the directive was masking nothing.
@MajorLift
MajorLift marked this pull request as ready for review September 15, 2026 20:02
@MajorLift MajorLift closed this by deleting the head repository Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant