5Create a new, minimal Babel plugin package (`babel-plugin-react-compiler-rust`) that serves as a thin JavaScript shim over the Rust compiler. The JS side does only three things:
6
7▶1. **Pre-filter**: Quick name-based scan for potential React functions (capitalized or hook-like names)
82. **Invoke Rust**: Serialize the Babel AST, scope info, and resolved options to JSON; call the Rust compiler via NAPI
93. **Apply result**: Replace the program AST with the Rust-returned AST and forward logger events
· · ·
10
11▶All complex logic — function detection, compilation mode decisions, directives, suppressions, gating rewrites, import insertion, outlined functions — lives in Rust. This ensures the logic is implemented once and reused across future OXC and SWC integrations.
12
13**Current status**: Implementation complete. All entrypoint logic ported to Rust: compile_program orchestration, shouldSkipCompilation, findFunctionsToCompile, getReactFunctionType/getComponentOrHookLike (with all name heuristics, callsHooksOrCreatesJsx, returnsNonNode, isValidComponentParams), directive parsing, suppression detection/filtering, ProgramContext (uid generation, import tracking), gating rewrites, import insertion. The actual per-function compilation (compileFn) returns a skip event pending full pipeline implementation.
· · ·
13▶**Current status**: Implementation complete. All entrypoint logic ported to Rust: compile_program orchestration, shouldSkipCompilation, findFunctionsToCompile, getReactFunctionType/getComponentOrHookLike (with all name heuristics, callsHooksOrCreatesJsx, returnsNonNode, isValidComponentParams), directive parsing, suppression detection/filtering, ProgramContext (uid generation, import tracking), gating rewrites, import insertion. The actual per-function compilation (compileFn) returns a skip event pending full pipeline implementation.
14
15**Prerequisites**: [rust-port-0001-babel-ast.md](rust-port-0001-babel-ast.md) (complete), [rust-port-0002-scope-types.md](rust-port-0002-scope-types.md) (complete), core compilation pipeline in Rust (in progress).
· · ·
42│ │ │ │
43│ │ - shouldSkipCompilation │ │
44▶│ │ - findFunctionsToCompile │ │
45│ │ (all compilation modes, directives, │ │
46│ │ forwardRef/memo, suppressions, etc.) │ │
· · ·
48│ │ - gating rewrites │ │
49│ │ - import insertion │ │
50▶│ │ - outlined function insertion │ │
51│ │ - panicThreshold handling │ │
52│ │ │ │
+ 50 more matches in this file