mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
7d11445d8e3145d69ca1352bd21bad0ed15fd141
We currently have multiple flags for targeting which functions to compile, but they are actually mutually exclusive. This PR consolidates to a single `compilationMode: 'annotation' | 'infer' | 'all'` flag: * Annotation compiles only functions that explicitly opt-in with "use forget" * Infer compiles explicitly opted-in functions (via "use forget") as well as any known/inferred components or hooks: * Component declarations * Component or hook-like functions (same rules as the ESLint plugin but with an extra check for whether it uses JSX or calls a hook) * All compiles all top-level functions. We should get rid of this in a follow-up and make tests use infer mode by default, and add explicit opt-ins where necessary. In all modes, "use no forget" always takes precedence and can be used to opt-out. The default mode is now "infer".
Languages
JavaScript
48.8%
Rust
26.4%
TypeScript
22.7%
HTML
1%
CSS
0.8%
Other
0.3%