55 matches across 1 files for func main lang:Markdown lang:Markdown path:compiler/docs/rust-port/rust-port-0005-babel-plugin.md
snippet_mode: auto · sorted by relevance
compiler/docs/rust-port/rust-port-0005-babel-plugin.md MARKDOWN 55 matches · showing 5 view file →
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
71. **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
11All 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
Search syntax
auth loginboth terms (AND is implicit)
auth OR logineither term
NOT path:vendorexclude matches
"exact phrase"quoted exact match
/func\s+Test/regex
handler~1fuzzy (Levenshtein 1)
file:*_test.gofilename glob
path:pkg/auth/**full path glob
lang:golanguage filter

Search any public repo from your terminal

This page calls POST /api/v1/code_search. Same tool, available over MCP for Claude/Cursor/Copilot.