Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
292 commits
Select commit Hold shift + click to select a range
3e4deb9
[rust-compiler] Implement M7+M8: short-circuit/ternary and remaining …
Mar 16, 2026
8c6e32b
[rust-compiler] Implement M9+M10: function expressions, recursive low…
Mar 16, 2026
2c8bc4a
[rust-compiler] Implement M12: switch, try/catch, for-of/in, optional…
Mar 16, 2026
2845aa1
[rust-compiler] Implement M11: destructuring and complex assignments
Mar 16, 2026
2811c3b
[rust-compiler] Implement M13: polish, remove all todo!() stubs
Mar 16, 2026
6912c76
[rust-compiler] Update plan doc status: M1-M13 complete
Mar 16, 2026
864201a
[rust-compiler] Fix review issues: plan alignment and TS fidelity imp…
Mar 16, 2026
97b23ae
[rust-compiler] Fix review round 2: UpdateExpression member targets, …
Mar 16, 2026
cb4a9fc
[rust-compiler] Add debugLogIRs support for debug variant
Mar 16, 2026
1fb0ecf
[rust-compiler] Add distilled architecture guide for Rust port
Mar 16, 2026
c55f6dd
[rust-compiler] Integrate entrypoint with HIR lowering pipeline
Mar 16, 2026
9fc07e7
[rust-compiler] Update skills and agents for compiler-review
Mar 16, 2026
bc13054
[rust-compiler] Align entrypoint types with TypeScript architecture
Mar 16, 2026
19a74eb
[compiler] Add printDebugHIR() for exhaustive HIR debug output
Mar 16, 2026
581fcc1
[rust-compiler] Align debug_print.rs with TS DebugPrintHIR.ts
Mar 16, 2026
2bb2dd6
[rust-compiler] Align entrypoint orchestration with TypeScript archit…
Mar 16, 2026
e78207c
[rust-compiler] Add Babel plugin-based test infrastructure for Rust port
Mar 16, 2026
bf8ea03
[rust-compiler] Validate pass name in test-rust-port script
Mar 16, 2026
bbd7d98
[rust-compiler] Build native module automatically in test-rust-port
Mar 16, 2026
206443c
[rust-compiler] Compare logger error events in test-rust-port
Mar 16, 2026
22a78a9
[rust-compiler] Align build_hir.rs and hir_builder.rs with TypeScript…
Mar 16, 2026
a9e481a
[rust-compiler] Add /compiler-port skill and port-pass agent
Mar 16, 2026
ab6c4e6
[rust-compiler] Update port-pass agent to reference architecture guide
Mar 17, 2026
75fe14e
[rust-compiler] Fix HIR lowering debug output and scope resolution (5…
Mar 17, 2026
83c69de
[rust-compiler] Fix HIR lowering loc handling, type annotations, func…
Mar 17, 2026
7852f32
[compiler] Update test-rust-port.ts to unify log comparison and deepe…
Mar 17, 2026
c381ce6
[rust-compiler] Fix HIR lowering assignments, locs, context identifie…
Mar 17, 2026
8441f29
[rust-compiler] Compute context identifiers in Rust via AST visitor i…
Mar 17, 2026
48cf874
[rust-compiler] Port PruneMaybeThrows pass to Rust
Mar 17, 2026
3528422
[rust-compiler] Port validateContextVariableLValues and validateUseMemo
Mar 17, 2026
683b569
[rust-compiler] Port dropManualMemoization and inlineImmediatelyInvok…
Mar 17, 2026
195d5d3
[rust-compiler] WIP: Add ordered_log to CompileResult and Compilation…
Mar 17, 2026
6b6879a
[rust-compiler] Fix HIR lowering: 68 more tests passing (1535/1717)
Mar 17, 2026
14a1f29
[rust-compiler] Fix HIR lowering: assignment expressions, for-in/for-…
Mar 17, 2026
a08ca7d
[rust-compiler] Fix hoisting, JSX member expressions, try-catch, and …
Mar 17, 2026
565e30c
[rust-compiler] Add reference locs for constant violations and bindin…
Mar 17, 2026
ef66c72
[rust-compiler] Fix identifier declaration loc for no-init variable d…
Mar 17, 2026
e322cbd
[rust-compiler] Fix type casts, function type inference, fbt duplicat…
Mar 17, 2026
3cb806e
[rust-compiler] Fix 10 HIR test failures across multiple categories
Mar 17, 2026
d6ac8a9
[rust-compiler] Fix 22 HIR lowering test failures
Mar 17, 2026
8a3b5b2
[rust-compiler] Fix 3 more HIR lowering test failures
Mar 17, 2026
541d3c8
[rust-compiler] Fix 6 HIR lowering test failures
Mar 17, 2026
8bb4de1
[rust-compiler] Fix final 5 HIR lowering failures and address review …
Mar 17, 2026
1481703
[rust-compiler] Port EnterSSA pass to Rust
Mar 17, 2026
566b1d7
[rust-compiler] Port EliminateRedundantPhi pass to Rust
Mar 17, 2026
cdc9a1e
[rust-compiler] Port ConstantPropagation pass to Rust
Mar 17, 2026
43dc63b
[rust-compiler] Port InferTypes pass to Rust
Mar 17, 2026
3a3c9fe
[rust-compiler] Port Environment configuration system to Rust
Mar 17, 2026
83f9fbd
[rust-compiler] Fix TypeId allocation in HirBuilder to use environmen…
Mar 17, 2026
1fec9db
[rust-compiler] Eliminate referenceLocs and jsxReferencePositions fro…
Mar 18, 2026
dd040c2
[rust-compiler] Fix PruneMaybeThrows and ValidateUseMemo passes
Mar 18, 2026
dd95d56
[compiler] Document scope serialization approach
Mar 18, 2026
0d450e7
[rust-compiler] Port OptimizePropsMethodCalls, ValidateHooksUsage, an…
Mar 18, 2026
7df32f3
[rust-compiler] Add enableValidations guard to pipeline validation pa…
Mar 18, 2026
81a5b6a
[rust-compiler] Compare full compiler error details in test-rust-port
Mar 18, 2026
8e48c0b
[rust-compiler] Deserialize full EnvironmentConfig from JS to Rust
Mar 18, 2026
ea7144e
[rust-compiler] Add compiler-orchestrator skill and update compiler-c…
Mar 18, 2026
9ee8262
[rust-compiler] Add compiler-orchestrator log file
Mar 18, 2026
e374085
[rust-compiler] Move orchestrator analysis into subagents
Mar 18, 2026
d19abc2
[rust-compiler] Update compiler-orchestrator skill to delegate all wo…
Mar 18, 2026
1a5726d
[rust-compiler] Add frontier detection and optional pass arg to test-…
Mar 18, 2026
8f8987e
[rust-compiler] Update skills to use test-rust-port frontier detection
Mar 18, 2026
23eed4a
[rust-compiler] Fix reserved word error reporting in BabelPlugin
Mar 18, 2026
42ec187
[rust-compiler] Update test-rust-port frontier message for explicit p…
Mar 18, 2026
53a2221
[rust-compiler] Print inner functions in debug HIR output
Mar 19, 2026
2b6a1a6
[rust-compiler] Add --json, --failures, --no-color, --limit flags to …
Mar 19, 2026
781f93d
[rust-compiler] Fix inner function lowering to pass all HIR tests
Mar 19, 2026
c3f1106
[rust-compiler] Fix PruneMaybeThrows validation pass failures and unr…
Mar 19, 2026
278a266
[rust-compiler] Fix SSA error handling and early bailout to match TS …
Mar 19, 2026
9fda07b
[rust-compiler] Fix ConstantPropagation source location for PostfixUp…
Mar 19, 2026
d40dafb
[rust-compiler] update test script
Mar 19, 2026
3de82b2
[rust-compiler] Fix InferTypes/OptimizePropsMethodCalls test failures
Mar 19, 2026
4a7610b
[rust-compiler] Fix InferTypes pass — resolve 708 test failures
Mar 19, 2026
92cc807
[rust-compiler] Port AnalyseFunctions pass (skeleton with inner funct…
Mar 19, 2026
bcbe15d
[rust-compiler] Port InferMutationAliasingEffects pass
Mar 19, 2026
c77a05d
[rust-compiler] Port InferMutationAliasingEffects pass
Mar 19, 2026
0e7034b
[rust-compiler] Fix InferMutationAliasingEffects effect inference and…
Mar 19, 2026
ea727ae
[rust-compiler] Add aliasing signature configs and fix Apply effect h…
Mar 19, 2026
9dcf335
[rust-compiler] Add aliasing signature configs and fix Apply effects …
Mar 19, 2026
49b5ba1
[rust-compiler] Port DeadCodeElimination pass
Mar 19, 2026
a2bb51d
[rust-compiler] Port InferMutationAliasingRanges pass and add 2nd Pru…
Mar 19, 2026
7139a92
[rust-compiler] Port InferReactivePlaces, RewriteInstructionKinds, an…
Mar 19, 2026
346f3c7
[rust-compiler] Fix InferReactiveScopeVariables scope output and orde…
Mar 19, 2026
25c437a
[rust-compiler] Fix InferReactivePlaces pass — 1047 to 1271 passing (…
Mar 19, 2026
205cea1
[rust-compiler] Fix InferReactivePlaces context variable propagation,…
Mar 19, 2026
0da51ce
[rust-compiler] Fix InferMutationAliasingEffects Apply effects and In…
Mar 19, 2026
737d36c
[rust-compiler] Fix InferReactivePlaces to match TS phi operand and c…
Mar 19, 2026
21648a2
[rust-compiler] Fix InferMutationAliasingEffects and InferMutationAli…
Mar 19, 2026
d985686
[rust-compiler] Require compiler-review before committing in orchestr…
Mar 19, 2026
26d3851
[rust-compiler] Add comprehensive port fidelity review for all Rust c…
Mar 19, 2026
90e5f27
[rust-compiler] Fix top correctness bug risks from port fidelity review
Mar 19, 2026
14232c1
[rust-compiler] Fix InferMutationAliasingRanges FunctionExpression/Ob…
Mar 19, 2026
aa30183
[rust-compiler] Fix AnalyseFunctions pass — all tests passing
Mar 20, 2026
192f97a
[rust-compiler] Add debug logs after assert/validate calls and derive…
Mar 20, 2026
1c1a9ec
[rust-compiler] Fix While terminal successors and InferMutationAliasi…
Mar 20, 2026
9302416
[compiler] Format Pipeline.ts with prettier
Mar 20, 2026
2e57fe8
[rust-compiler] Fix remaining test failures — all 1717 fixtures passi…
Mar 20, 2026
943fd89
[rust-compiler] Update orchestrator log — all passes clean through In…
Mar 20, 2026
1bc57b1
[rust-compiler] Port MemoizeFbtAndMacroOperandsInSameScope pass
Mar 20, 2026
54ddb09
[rust-compiler] Port NameAnonymousFunctions pass and outlineJSX stub
Mar 20, 2026
e0260c7
[rust-compiler] Port OutlineFunctions pass
Mar 20, 2026
de8156c
[rust-compiler] Port AlignMethodCallScopes pass
Mar 20, 2026
567fa48
[rust-compiler] Port AlignObjectMethodScopes pass
Mar 20, 2026
18753f7
[rust-compiler] Port PruneUnusedLabelsHIR pass
Mar 20, 2026
8d23a10
[rust-compiler] Port AlignReactiveScopesToBlockScopesHIR pass
Mar 20, 2026
477ce8b
[rust-compiler] Port MergeOverlappingReactiveScopesHIR pass
Mar 20, 2026
246f0d5
[rust-compiler] Port BuildReactiveScopeTerminalsHIR pass
Mar 20, 2026
49ae06d
[rust-compiler] Port FlattenReactiveLoopsHIR pass
Mar 20, 2026
6e67447
[rust-compiler] Port FlattenScopesWithHooksOrUseHIR pass
Mar 20, 2026
f1b96a9
[rust-compiler] Port PropagateScopeDependenciesHIR pass
Mar 20, 2026
5124041
[rust-compiler] Update orchestrator log — all 31 HIR passes ported
Mar 20, 2026
e857979
[rust-compiler] Port validation passes to fix InferReactivePlaces tes…
Mar 20, 2026
a37f902
[rust-compiler] Update Rust port review documents for all crates
Mar 20, 2026
83d900f
[rust-compiler] Fix OutlineFunctions debug printing, validation passe…
Mar 20, 2026
8d76fdd
[rust-compiler] Fix ANALYSIS.md issues: globals callee effects, infer…
Mar 20, 2026
352aae6
[rust-compiler] Implement assumed-invoked function hoisting in Propag…
Mar 20, 2026
a71e431
[rust-compiler] Port validation passes and fix InferReactivePlaces tr…
Mar 20, 2026
c97b2a9
[rust-compiler] Port ValidateExhaustiveDependencies and isolate false…
Mar 20, 2026
ef64f46
[rust-compiler] plan files
Mar 20, 2026
57fe26e
[rust-compiler] Fix VED pipeline guard — always run ValidateExhaustiv…
Mar 20, 2026
1f8e4fe
[rust-compiler] Fix OutlineFunctions name ordering and PropagateScope…
Mar 20, 2026
dcb1b1d
[rust-compiler] Update orchestrator log — 1637/1717 passing (95.3%)
Mar 20, 2026
c68738b
[rust-compiler] Update orchestrator log with current per-pass status
Mar 20, 2026
02e5fd5
[rust-compiler] Update orchestrator FIX mode to use parallel diagnosis
Mar 20, 2026
cc34c81
[rust-compiler] Port validateNoDerivedComputationsInEffects_exp valid…
Mar 20, 2026
1dbfcdb
[rust-compiler] Update orchestrator log — 1650/1717 passing (96.1%)
Mar 20, 2026
ae52a66
[rust-compiler] Fix ValidateNoSetStateInEffects — port createControlD…
Mar 20, 2026
3a5ba6e
[rust-compiler] Fix validation passes — resolve 7 InferReactivePlaces…
Mar 21, 2026
b37fc6c
[rust-compiler] Fix operand ordering, port ValidateStaticComponents a…
Mar 21, 2026
5745b62
[rust-compiler] Fix VED, PSDH, AlignObjectMethod — 1695/1717 passing …
Mar 21, 2026
1169dd7
[rust-compiler] Update orchestrator log — 1695/1717 passing (98.7%)
Mar 21, 2026
5f6df1e
[rust-compiler] Fix PSDH assumed-invoked functions and outline_jsx is…
Mar 21, 2026
c5b1b6b
[rust-compiler] Update orchestrator log — 1700/1717 passing (99.0%)
Mar 21, 2026
cc5980a
[rust-compiler] Fix OutlineFunctions and MergeOverlappingReactiveScop…
Mar 21, 2026
589e0d0
[rust-compiler] Update orchestrator log — 1709/1717 passing (99.5%)
Mar 21, 2026
3e69dac
[rust-compiler] Fix PropagateScopeDependenciesHIR — 1713/1717 passing…
Mar 21, 2026
0dcd166
[rust-compiler] Update orchestrator log — 1713/1717 passing (99.8%)
Mar 21, 2026
429cb52
[rust-compiler] Add reactive types, react_compiler_reactive_scopes cr…
Mar 20, 2026
b85703d
[compiler] Add DebugPrintReactiveFunction and update test-rust-port.t…
Mar 20, 2026
49d57b0
[rust-compiler] Update skill files with reactive pass table and crate…
Mar 20, 2026
19f32d4
[rust-compiler] Fix BuildReactiveFunction switch case scheduling and …
Mar 20, 2026
4433948
[rust-compiler] Fix reactive debug printer format to match TS output
Mar 20, 2026
7ffc073
[compiler] Fix DebugPrintReactiveFunction crash on non-reactive outli…
Mar 20, 2026
00c8b83
[rust-compiler] Add HIR function formatting bridge for inner function…
Mar 20, 2026
92a03c2
[rust-compiler] Fix outlined function blank line in reactive printer
Mar 20, 2026
ccdb7a1
[rust-compiler] Fix StoreLocal→LoadLocal conversion in BuildReactiveF…
Mar 20, 2026
679bf84
[rust-compiler] Fix for-loop continue block to use update when present
Mar 20, 2026
f66b43a
[rust-compiler] Update reactive function plan status
Mar 20, 2026
2259b8b
[rust-compiler] Fix BuildReactiveFunction port fidelity issues
Mar 20, 2026
fd8b962
[rust-compiler] Port all reactive passes after BuildReactiveFunction
Mar 21, 2026
b42fa74
[rust-compiler] Remove no-op (generated) normalization from test-rust…
Mar 21, 2026
45b7e91
[rust-compiler] Fix identifier allocation order in PropagateEarlyReturns
Mar 21, 2026
295a538
[rust-compiler] Consume block IDs in dominator computation to match T…
Mar 22, 2026
5d5eb25
[rust-compiler] Add aggregated review summary and clean up stale revi…
Mar 21, 2026
e3618e9
[rust-compiler] Fix review summary to align with Rust port architectu…
Mar 22, 2026
c9e7ffa
[rust-compiler] Fix type inference bugs: context vars, StartMemoize d…
Mar 22, 2026
e3c80a2
[rust-compiler] Fix enter_ssa getIdAt unsealed fallback to match TS n…
Mar 22, 2026
bb67fe1
[rust-compiler] Fix saturating_sub loop bounds in MergeReactiveScopes…
Mar 22, 2026
ac3cbd4
[rust-compiler] Fix ConstantPropagation JS semantics: reserved words …
Mar 22, 2026
88bf21f
[rust-compiler] Replace String plugin options with proper enums for C…
Mar 22, 2026
6a35bff
[rust-compiler] Rewrite validate_no_ref_access_in_render for structur…
Mar 22, 2026
2d92776
[rust-compiler] Rewrite validate_no_freezing and validate_locals_not_…
Mar 22, 2026
ea1baa4
Revert "[rust-compiler] Fix enter_ssa getIdAt unsealed fallback to ma…
Mar 22, 2026
9a78bdc
Revert "[rust-compiler] Replace String plugin options with proper enu…
Mar 22, 2026
ff71379
[rust-compiler] Update review summary with implementation status
Mar 22, 2026
bdc3cbb
[rust-compiler] Convert ~55 panic!() calls to Err(CompilerDiagnostic)…
Mar 22, 2026
20af628
[rust-compiler] Fix review issues: propagate errors instead of .ok().…
Mar 22, 2026
554deeb
[rust-compiler] Add react_compiler_oxc crate — OXC frontend for React…
Mar 23, 2026
56250e9
[rust-compiler] Add react_compiler_swc crate — SWC frontend for React…
Mar 23, 2026
1aeb60b
[rust-compiler] Port CodegenReactiveFunction — final codegen pass
Mar 23, 2026
1ef842e
[rust-compiler] Wire CodegenReactiveFunction into pipeline
Mar 23, 2026
048c9be
[rust-compiler] Compare final code output in test-rust-port.ts
Mar 23, 2026
947f4af
[rust-compiler] Add e2e test infrastructure for all compiler frontends
Mar 23, 2026
ba1d0f4
[rust-compiler] Add progress output to test-e2e.ts
Mar 23, 2026
e4f9e9a
[rust-compiler] Fix RenameVariables scoping, ExtractScopeDeclarations…
Mar 23, 2026
d450cfa
[rust-compiler] Add Result support to ReactiveFunctionTransform, fix …
Mar 23, 2026
4035b12
[rust-compiler] Fix codegen application: comment dedup, outlined plac…
Mar 24, 2026
598d8e7
[rust-compiler] Update orchestrator log for codegen application, remo…
Mar 24, 2026
d0f42da
[rust-compiler] Fix outlined function ordering, type annotation prese…
Mar 25, 2026
2601907
[rust-compiler] Implement function gating codegen
Mar 25, 2026
1a4d44c
[rust-compiler] Port ValidatePreservedManualMemoization pass
Mar 25, 2026
fa6b594
[rust-compiler] Fix codegen invariants, enum passthrough, error handling
Mar 25, 2026
526eced
[rust-compiler] Fix code comparison failures in function discovery, r…
Mar 25, 2026
1a481dd
[rust-compiler] Compile outlined JSX functions through full pipeline,…
Mar 25, 2026
4e14cea
[rust-compiler] Fix 11 code comparison failures, add instrumentation …
Mar 25, 2026
c1738a4
[rust-compiler] Fix last 5 test failures: all 1717 tests now pass
Mar 25, 2026
0c4a252
[rust-compiler] Update orchestrator log — all 1717 pass + code tests …
Mar 25, 2026
577ba65
[rust-compiler] Fix all Rust compiler warnings
Mar 25, 2026
1ca66fd
[rust-compiler] remove outdated review docs
Mar 26, 2026
21cabc2
[rust-compiler] Support moduleTypeProvider in Rust compiler port
Mar 23, 2026
c548d7c
[rust-compiler] Port HIR visitors from TypeScript to Rust
Mar 27, 2026
4c8f50d
[rust-compiler] Replace local visitor copies with canonical react_com…
Mar 27, 2026
9411bad
[rust-compiler] Fix reactive scopes visitors to match canonical visit…
Mar 27, 2026
60d13da
[rust-compiler] Add env access to reactive function visitor/transform…
Mar 28, 2026
70beafb
[rust-compiler] Require env in reactive visitor traits, use canonical…
Mar 28, 2026
6440a20
[rust-compiler] Replace local visitor copies with canonical react_com…
Mar 29, 2026
80e02f2
[rust-compiler] Add test-rust-port.sh to compiler-verify skill
Mar 29, 2026
055d064
[rust-compiler] Add react_compiler_utils crate with generic DisjointSet
Mar 29, 2026
c179e00
[rust-compiler] Consolidate duplicated helper logic across Rust crates
Mar 29, 2026
43dab2c
[rust-compiler] Use visitor/transform infra in MergeReactiveScopesTha…
Mar 29, 2026
4d78455
[rust-compiler] Use ReactiveFunctionTransform in PropagateEarlyReturns
Mar 29, 2026
8aa9a2d
[rust-compiler] Use ReactiveFunctionVisitor in PruneNonEscapingScopes
Mar 29, 2026
ce1dae3
[rust-compiler] Use ReactiveFunctionTransform in PruneNonReactiveDepe…
Mar 29, 2026
812160e
[rust-compiler] Use ReactiveFunctionVisitor in PruneUnusedLvalues
Mar 29, 2026
70dfa72
[rust-compiler] Use ReactiveFunctionVisitor in RenameVariables
Mar 29, 2026
4529d49
[rust-compiler] Use ReactiveFunctionTransform in StabilizeBlockIds
Mar 29, 2026
42670e2
[rust-compiler] Use ReactiveFunctionVisitor for CountMemoBlockVisitor…
Mar 29, 2026
270963d
[rust-compiler] Remove redundant mark_predecessors call in PruneMaybe…
Mar 29, 2026
2d007e1
[rust-compiler] Add missing default branch error in ValidateContextVa…
Mar 29, 2026
08475c9
[rust-compiler] Align naming in ValidateUseMemo with TS original
Mar 29, 2026
a23e4ff
[rust-compiler] Align InlineIIFEs with TS original
Mar 29, 2026
2176f50
[rust-compiler] Fix phi processing order in EliminateRedundantPhi
Mar 29, 2026
65823b5
[rust-compiler] Fix TemplateLiteral undefined handling in ConstantPro…
Mar 29, 2026
b8f796d
[rust-compiler] Fix hook-name fallback in InferTypes resolve_property…
Mar 29, 2026
e890a67
[rust-compiler] Fix missing lvalue kind assignments in ValidateHooksU…
Mar 29, 2026
0c21a5d
[rust-compiler] Move is_props_type to shared HIR utility
Mar 29, 2026
d5ae445
[rust-compiler] Align InferMutationAliasingEffects with TS original
Mar 29, 2026
940c8bf
[rust-compiler] Remove unused parameter in DeadCodeElimination
Mar 29, 2026
9151ac3
[rust-compiler] Align validation passes with TS originals
Mar 29, 2026
a4e4a6a
[rust-compiler] Fix retainWhere dedup logic and rename in ValidateExh…
Mar 29, 2026
bac3935
[rust-compiler] Add missing source locations to invariant errors in R…
Mar 29, 2026
4e9945c
[rust-compiler] Consolidate visit_operands in MemoizeFbt to match TS
Mar 29, 2026
9dfe047
[rust-compiler] Add missing invariants in OutlineJsx, use mem::replac…
Mar 29, 2026
003df5c
[rust-compiler] Fix range accumulation bug in AlignMethodCallScopes
Mar 29, 2026
4553f54
[rust-compiler] Use shift_remove instead of swap_remove in PruneUnuse…
Mar 29, 2026
86c832a
[rust-compiler] Align BuildReactiveFunction with TS original
Mar 29, 2026
6c00393
[rust-compiler] Separate reason/description in AssertScopeInstruction…
Mar 29, 2026
ffe767b
[rust-compiler] Add missing invariant checks in PruneNonEscapingScopes
Mar 29, 2026
a4c0480
[rust-compiler] Use HashSet instead of HashMap<K,()> in PruneUnusedLV…
Mar 29, 2026
535f0f4
[rust-compiler] Align PruneHoistedContexts and ValidatePreservedManua…
Mar 29, 2026
7ba4e22
[rust-compiler] Add performance profiling infrastructure and conditio…
Mar 29, 2026
4841cac
[rust-compiler] Eliminate double AST serialization with RawValue
Mar 29, 2026
531be75
[rust-compiler] Remove debug_logs/ordered_log duplication
Mar 29, 2026
c805900
[rust-compiler] Remove debugLogs field from bridge types
Mar 29, 2026
880de91
[rust-compiler] Replace regex with string matching in suppressions, a…
Mar 29, 2026
4f1bb1d
[rust-compiler] Static base registries for ShapeRegistry and GlobalRe…
Mar 29, 2026
2a9a107
[rust-compiler] Fix OXC and SWC frontend compilation and wiring
Mar 29, 2026
473fdb3
[rust-compiler] Add --rust option to snap test command
Mar 29, 2026
719539b
[compiler] Normalize CompileError logger events to plain objects
Mar 30, 2026
9539418
[rust-compiler] Fix JSX source locations and BabelPlugin AST replacement
Mar 30, 2026
ea1bd85
[rust-compiler] Add identifierName to logger source locations
Mar 30, 2026
8e7fbd7
[rust-compiler] Fix snap test failures: FBT crashes, error formatting…
Mar 30, 2026
75ff31b
[rust-compiler] Fix identifierName in validation diagnostics and erro…
Mar 30, 2026
21ea2af
[rust-compiler] Fix exhaustive-deps hints and error formatting in cod…
Mar 30, 2026
b81dc57
[rust-compiler] Fix 30 snap test failures across validation, codegen,…
Mar 30, 2026
ea0c690
[compiler] Format TS files with prettier
Mar 30, 2026
dee9356
[rust-compiler] Fix remaining snap failures — 1717/1718 passing
Mar 30, 2026
265c7d5
[rust-compiler] Add Rust port gap analysis document
Mar 30, 2026
5a1f818
[rust-compiler] Fix critical gaps in transitive freeze and Unsupporte…
Mar 30, 2026
62cabcc
[rust-compiler] Fix error handling in inferMutationAliasingEffects to…
Mar 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ chrome-user-data
/tmp
/.worktrees
.claude/*.local.*
.claude/worktrees

packages/react-devtools-core/dist
packages/react-devtools-extensions/chrome/build
Expand Down
5 changes: 5 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ React is a JavaScript library for building user interfaces.

- **React**: All files outside `/compiler/`
- **React Compiler**: `/compiler/` directory (has its own instructions)

## Current Active Work

- **Rust Compiler Port**: Plans in `compiler/docs/rust-port/`, implementation in `compiler/crates/`
- Branch: `rust-research`
54 changes: 54 additions & 0 deletions compiler/.claude/agents/analyze-pass-impact.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: analyze-pass-impact
description: Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across all compiler phases. Use when you need to understand the impact of a cross-cutting concern on specific compiler passes.
model: opus
color: blue
---

You are a React Compiler pass analysis specialist. Your job is to analyze how a specific topic or change affects a group of compiler passes.

## Your Process

1. **Read the pass documentation** for each pass in your assigned group from `compiler/packages/babel-plugin-react-compiler/docs/passes/`

2. **Read the pass implementation source** in `compiler/packages/babel-plugin-react-compiler/src/`. Check these directories:
- `src/HIR/` — IR definitions, utilities, lowering
- `src/Inference/` — Effect inference (aliasing, mutation, types)
- `src/Validation/` — Validation passes
- `src/Optimization/` — Optimization passes
- `src/ReactiveScopes/` — Reactive scope analysis
- `src/Entrypoint/Pipeline.ts` — Pass ordering and invocation

3. **Read the port conventions** from `compiler/docs/rust-port/rust-port-architecture.md`

4. **For each pass**, analyze the topic's impact and produce a structured report

## Output Format

For each pass in your group, report:

```
### <Pass Name> (<pass-number>)
**Purpose**: <1-line description>
**Impact**: none | minor | moderate | significant
**Details**: <If impact is not "none", explain specifically what changes are needed>
**Key locations**: <file:line references to relevant code>
```

At the end, provide a brief summary:
```
### Phase Summary
- Passes with no impact: <list>
- Passes with minor impact: <list>
- Passes with moderate impact: <list>
- Passes with significant impact: <list>
- Key insight: <1-2 sentences about the most important finding>
```

## Guidelines

- Be concrete, not speculative. Reference specific code patterns you found.
- "Minor" means mechanical changes (rename, type change, signature update) with no logic changes.
- "Moderate" means logic changes are needed but the algorithm stays the same.
- "Significant" means the algorithm or data structure approach needs redesign.
- Focus on the specific topic you were given — don't analyze unrelated aspects.
78 changes: 78 additions & 0 deletions compiler/.claude/agents/compiler-review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
name: compiler-review
description: Reviews Rust port code for port fidelity, convention compliance, and error handling. Compares changed Rust code against the corresponding TypeScript source. Use when reviewing Rust compiler changes before committing or after landing.
model: opus
color: green
---

You are a React Compiler Rust port reviewer. Your job is to review Rust code in `compiler/crates/` for port fidelity, convention compliance, and correct error handling by comparing it against the original TypeScript source.

## Input

You will receive a diff of changed Rust files. For each changed file, you must:

1. **Read the architecture guide**: `compiler/docs/rust-port/rust-port-architecture.md`
2. **Identify the corresponding TypeScript file** using the mapping below
3. **Read the full corresponding TypeScript file**
4. **Review the changed Rust code** against the TS source and architecture guide

## Rust Crate -> TypeScript Path Mapping

| Rust Crate | TypeScript Path |
|---|---|
| `react_compiler_hir` | `src/HIR/` (excluding `BuildHIR.ts`, `HIRBuilder.ts`) |
| `react_compiler_lowering` | `src/HIR/BuildHIR.ts`, `src/HIR/HIRBuilder.ts` |
| `react_compiler` | `src/Babel/`, `src/Entrypoint/` |
| `react_compiler_diagnostics` | `src/CompilerError.ts` |
| `react_compiler_<name>` | `src/<Name>/` (1:1, e.g., `react_compiler_optimization` -> `src/Optimization/`) |

Within a crate, Rust filenames use `snake_case.rs` corresponding to `PascalCase.ts` or `camelCase.ts` in the TS source. When multiple TS files exist in the mapped folder, match by comparing exported types/functions to the Rust file's contents.

The TypeScript source root is `compiler/packages/babel-plugin-react-compiler/src/`.

## Review Checklist

### Port Fidelity
- Same high-level data flow as the TypeScript (only deviate where strictly necessary for arenas/borrow checker)
- Same grouping of logic: types, functions, struct methods should correspond to the TS file's exports
- Algorithms and control flow match the TS logic structurally
- No unnecessary additions, removals, or reorderings vs the TS

### Convention Compliance
- Arena patterns: `IdentifierId`, `ScopeId`, `FunctionId`, `TypeId` used correctly (not inline data)
- `Place` is cloned, not shared by reference
- `EvaluationOrder` (not `InstructionId`) for evaluation ordering
- `InstructionId` for indexing into `HirFunction.instructions`
- `IndexMap`/`IndexSet` where iteration order matters
- `env: &mut Environment` passed separately from `func: &mut HirFunction`
- Environment fields accessed directly (not via sub-structs) for sliced borrows
- Side maps use ID-keyed `HashMap`/`HashSet` (not reference-identity maps)
- Naming: `snake_case` for functions/variables, `PascalCase` for types (matching Rust conventions)

### Error Handling
- Non-null assertions (`!` in TS) -> `.unwrap()` or similar panic
- `CompilerError.invariant()`, `CompilerError.throwTodo()`, `throw` -> `Result<_, CompilerDiagnostic>` with `Err(...)`
- `pushDiagnostic()` with invariant errors -> `return Err(...)`
- `env.recordError()` or non-invariant `pushDiagnostic()` -> accumulate on `Environment` (keep as-is)

## Output Format

Produce a numbered list of issues. For each issue:

```
N. [CATEGORY] file_path:line_number — Description of the issue
Expected: what should be there (with TS reference if applicable)
Found: what is actually there
```

Categories: `FIDELITY`, `CONVENTION`, `ERROR_HANDLING`

If no issues are found, report "No issues found."

## Guidelines

- Focus only on the changed lines and their immediate context — don't review unchanged code
- Be concrete: reference specific lines in both the Rust and TS source
- Don't flag intentional deviations that are necessary for Rust's ownership model (arenas, two-phase collect/apply, `std::mem::replace`, etc.)
- Don't flag style preferences that aren't covered by the architecture guide
- Don't suggest adding comments, docs, or type annotations beyond what the TS has
97 changes: 97 additions & 0 deletions compiler/.claude/agents/port-pass.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
name: port-pass
description: Ports a single compiler pass from TypeScript to Rust, including crate setup, implementation, pipeline wiring, and test-fix loop until all fixtures pass.
model: opus
color: orange
---

You are a Rust compiler port specialist. Your job is to port a single React Compiler pass from TypeScript to Rust, then iterate on test failures until all fixtures pass.

## Input

You will receive:
- **Pass name**: The exact name from Pipeline.ts log entries
- **TypeScript source**: The full content of the TS file(s) to port
- **Target crate**: Name and path of the Rust crate to add code to
- **Implementation plan**: What files to create, types needed, pipeline wiring
- **Architecture guide**: Key patterns and conventions
- **Current pipeline.rs**: How existing passes are wired
- **Existing crate structure**: Files already in the target crate (if any)

## Phases

### Phase 1: Setup
- Understand the TypeScript source thoroughly
- Identify all types, functions, and their dependencies
- Note which types already exist in Rust (from HIR crate, etc.)

### Phase 2: New Types
- Add any new types needed by this pass
- Place them in the appropriate crate (usually the target crate or `react_compiler_hir`)
- IMPORTANT: Follow the data modeling guidelines in docs/rust-port/rust-port-architecture.md for arena types (non-exhaustive types to pay extra attention to: `Identifier`, `HirFunction`, `ReactiveScope`, `Environment` etc)

### Phase 3: Crate Setup (if new crate needed)
- Create `Cargo.toml` with appropriate dependencies
- Create `src/lib.rs` with module declarations
- Add the crate to the workspace `Cargo.toml`
- Add the crate as a dependency of `react_compiler`

### Phase 4: Port the Pass
- Create the Rust file(s) corresponding to the TypeScript source
- Follow the translation guidelines from docs/rust-port/rust-port-architecture.md

Key conventions:
- **Place is Clone**: `Place` stores `IdentifierId`, making it cheap to clone
- **env separate from func**: Pass `env: &mut Environment` separately from `func: &mut HirFunction`
- **Reactive passes**: Reactive passes take `&mut ReactiveFunction` + `&Environment` or `&mut Environment` (not `&mut HirFunction`)
- **Flat environment fields**: Access env fields directly for sliced borrows
- **Two-phase collect/apply**: When you can't mutate through stored references, collect IDs first, then apply mutations
- **Ordered maps**: Use `IndexMap`/`IndexSet` where TS uses `Map`/`Set` and iteration order matters
- **Error handling**: Non-fatal errors accumulate on `env`; fatal errors return `Err`
- **Structural similarity**: Target ~85-95% correspondence with TypeScript. A developer should be able to view TS and Rust side-by-side

### Phase 5: Wire Pipeline
- Add the pass call to `compiler/crates/react_compiler/src/entrypoint/pipeline.rs`
- Follow the existing pattern: call the pass function, then log with `debug_print` and `context.log_debug`
- Match the exact ordering from Pipeline.ts
- Add necessary `use` imports

### Phase 6: Test-Fix Loop

This is the core of your work. You must achieve 0 test failures.

**Commands:**
- Full suite: `bash compiler/scripts/test-rust-port.sh <PassName>`
- Single fixture: `bash compiler/scripts/test-rust-port.sh <PassName> <path-to-fixture.js>`

**Process:**
1. Run the full test suite
2. If failures exist, pick ONE specific failing fixture from the output
3. Run that single fixture in isolation to see the full diff
4. Read the diff carefully — it shows TS output vs Rust output line by line
5. Identify the root cause in the Rust code and fix it
6. Re-run the single fixture to confirm the fix
7. Re-run the full suite to check overall progress
8. Repeat from step 2 until 0 failures

**Discipline:**
- Fix one fixture at a time — don't try to fix multiple issues at once
- Always verify a fix works on the single fixture before running the full suite
- Never stop early — the goal is exactly 0 failures
- If a fix causes regressions, investigate and fix those too

**Common failure patterns:**
- Missing match arms (Rust requires exhaustive matching)
- Wrong iteration order (need `IndexMap` instead of `HashMap`)
- Range off-by-one errors (mutable range start/end)
- Formatting diffs (debug print format doesn't match TS)
- Event mismatches (CompileError/CompileSkip events differ)
- Missing handling for edge cases the TS handles implicitly
- Identifier/scope lookups that should go through the arena

## Output

When done, report:
- Files created/modified with brief descriptions
- Final test results (should be 0 failed)
- Any notable translation decisions made
25 changes: 25 additions & 0 deletions compiler/.claude/rules/commit-convention.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
description: Compiler commit message convention
globs:
- compiler/**/*.js
- compiler/**/*.jsx
- compiler/**/*.ts
- compiler/**/*.tsx
- compiler/**/*.rs
- compiler/**/*.json
- compiler/**/*.md
---

When committing changes in the compiler directory, follow this convention:

- **Rust port work** (files in `compiler/crates/` and/or `compiler/docs/rust-port`): prefix with `[rust-compiler]`
- **TS compiler work** (files in `compiler/packages/`): prefix with `[compiler]`

Format:
```
[prefix] Title

Summary of changes (1-3 sentences).
```

Use `/compiler-commit` to automatically verify and commit with the correct convention.
11 changes: 11 additions & 0 deletions compiler/.claude/rules/multi-step-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
description: Ensure all steps in multi-step user instructions are completed
globs:
- compiler/**/*
---

When the user gives multi-step instructions (e.g., "implement X, then /review, then /compiler-commit"):
- Track all steps as a checklist
- Complete ALL steps before responding
- Before declaring done, re-read the original prompt to verify nothing was missed
- If interrupted mid-way, note which steps remain
9 changes: 9 additions & 0 deletions compiler/.claude/rules/pass-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
description: Read pass documentation before modifying compiler passes
globs:
- compiler/packages/babel-plugin-react-compiler/src/**/*.ts
---

Before modifying a compiler pass, read its documentation in `compiler/packages/babel-plugin-react-compiler/docs/passes/`. Pass docs explain the pass's role in the pipeline, its inputs/outputs, and key invariants.

Pass docs are numbered to match pipeline order (e.g., `08-inferMutationAliasingEffects.md`). Check `Pipeline.ts` if you're unsure which doc corresponds to the code you're modifying.
13 changes: 13 additions & 0 deletions compiler/.claude/rules/plan-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
description: Guidelines for editing Rust port plan documents
globs:
- compiler/docs/rust-port/*.md
---

When editing plan documents in `compiler/docs/rust-port/`:

- Use `/plan-update <doc-path> <topic>` for deep research across all compiler passes before making significant updates
- Read the architecture guide (`rust-port-architecture.md`) for context
- Reference specific pass docs from `compiler/packages/babel-plugin-react-compiler/docs/passes/` when discussing pass behavior
- Update the "Current status" line at the top of plan docs after changes
- Keep plan docs as the source of truth — if implementation diverges from the plan, update the plan
23 changes: 23 additions & 0 deletions compiler/.claude/rules/rust-port.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
description: Conventions for Rust port code in compiler/crates
globs:
- compiler/crates/**/*.rs
- compiler/crates/**/Cargo.toml
---

When working on Rust code in `compiler/crates/`:

- Follow patterns from `compiler/docs/rust-port/rust-port-architecture.md`
- Use arenas + copyable IDs instead of shared references: `IdentifierId`, `ScopeId`, `FunctionId`, `TypeId`
- Pass `env: &mut Environment` separately from `func: &mut HirFunction`
- Use two-phase collect/apply when you can't mutate through stored references
- Run `bash compiler/scripts/test-babel-ast.sh` to test AST round-tripping
- Use `/port-pass <name>` when porting a new compiler pass
- Use `/compiler-verify` before committing to run both Rust and TS tests
- Keep Rust code structurally close to the TypeScript (~85-95% correspondence)

Before declaring work complete on a plan doc:
- Re-read the original user prompt to ensure all requested steps are done
- Check the plan doc for any "Remaining Work" items
- Verify test-babel-ast.sh passes with the expected fixture count
- Update the plan doc's status section
7 changes: 6 additions & 1 deletion compiler/.claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
"allow": [
"Bash(yarn snap:*)",
"Bash(yarn snap:build)",
"Bash(node scripts/enable-feature-flag.js:*)"
"Bash(node scripts/enable-feature-flag.js:*)",
"Bash(yarn workspace babel-plugin-react-compiler lint:*)",
"Bash(yarn prettier-all:*)",
"Bash(bash compiler/scripts/test-babel-ast.sh:*)",
"Bash(cargo test:*)",
"Bash(cargo check:*)"
],
"deny": [
"Skill(extract-errors)",
Expand Down
Loading
Loading