Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
435 commits
Select commit Hold shift + click to select a range
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
56fd61e
[rust-compiler] Fix function discovery to recurse into nested statements
Mar 31, 2026
8178b8d
[rust-compiler] Fix edge cases in nested function discovery
Mar 31, 2026
ba3ae49
[rust-compiler] Refactor function discovery to use AstWalker visitor
Mar 31, 2026
dd914d0
[rust-compiler] Add MutVisitor trait and refactor AST mutation to use…
Mar 31, 2026
2d31511
[rust-compiler] Fix inner function debug log flushing and todo error …
Mar 31, 2026
bb970d0
[rust-compiler] Fix CompilerDiagnostic::todo() to produce ErrorDetail…
Mar 31, 2026
27fd176
[rust-compiler] Fix function name inference to match TS parent-checki…
Mar 31, 2026
bed0a9a
[compiler] Update compiler-verify skill to include yarn snap --rust
Apr 1, 2026
9507cbc
[rust-compiler] Fix OXC frontend compilation and e2e test failures
Mar 30, 2026
14a056b
[rust-compiler] Fix SWC frontend optional chaining and blank line han…
Mar 30, 2026
699a850
[rust-compiler] Fix SWC frontend directives, parenthesization, and as…
Mar 30, 2026
8f51441
[rust-compiler] Fix SWC type annotations, unicode escaping, object fo…
Mar 30, 2026
66ac88c
[rust-compiler] Fix remaining SWC e2e failures and add test normaliza…
Mar 30, 2026
b533d50
[rust-compiler] Fix OXC optional chaining, object methods, comments, …
Mar 30, 2026
1a1b6ae
[rust-compiler] Fix OXC scope info, rest params, class decl, and test…
Mar 31, 2026
880a8ae
[rust-compiler] Fix remaining OXC failures: default params, TS enums,…
Mar 31, 2026
cd5a1ea
[compiler] Fix lint errors and add test script for Rust plugin package
Apr 1, 2026
9942fae
[rust-compiler] Port ValidateSourceLocations to Rust compiler
Apr 1, 2026
9581133
[rust-compiler] Fix ValidateSourceLocations error count discrepancy
Apr 1, 2026
6672405
[compiler] Fix SSR fixture pragma to use correct outputMode
Apr 1, 2026
efd5077
[rust-compiler] Port OptimizeForSSR pass
Apr 1, 2026
2d2ff35
[compiler] Fix eslint plugins to work with flattened CompileErrorDeta…
Apr 1, 2026
dceabf6
[rust-compiler] Move error formatting to Rust and fix JSXAttribute lo…
Apr 1, 2026
7b9fa07
[compiler] Remove dead JS error formatting code and @babel/code-frame…
Apr 1, 2026
c30ef15
[rust-compiler] Extend test-e2e with event comparison and fix bugs
Apr 1, 2026
b2cbb08
[rust-compiler] Fix e2e diagnostic event mismatches (123→2 failures)
Apr 2, 2026
8a36ba6
[rust-compiler] Use record_error(...)? for short-circuiting on Invari…
Apr 2, 2026
b9c4ef3
[rust-compiler] Fix last 2 e2e failures: PipelineError events and cod…
Apr 2, 2026
962581c
[rust-compiler] Fix e2e test formatting normalization with two-pass P…
Apr 3, 2026
cdd59c4
[rust-compiler] Fix OXC e2e source locations and test normalization
Apr 3, 2026
58400e9
[compiler] Add code/events breakdown to test-e2e.sh output
Apr 3, 2026
54bd672
[compiler] Fix TS2345 error in eslint-plugin-react-hooks build
Apr 4, 2026
ce8ea15
[compiler] Fix missing snap script in babel-plugin-react-compiler-rust
Apr 4, 2026
374ef56
[compiler] Add Rust CI workflow
Apr 4, 2026
e97ec5a
[compiler] Fix babel-plugin-react-compiler-rust CI: build snap before…
Apr 4, 2026
72adadf
[compiler] Fix Rust CI: build snap tool before running yarn snap --rust
Apr 5, 2026
8ef671f
[compiler] Increase playground test retry count
Apr 5, 2026
55d6ff6
[rust-compiler] Tools for internal testing
Apr 11, 2026
a3ab3aa
[rust-compiler] UnsupportedNode node_type population
mvitousek Apr 23, 2026
eb9debe
[rust-compiler] format_js_string extraction with \b/\f escapes
mvitousek Apr 23, 2026
3c192bc
[rust-compiler] Bridge: sanitize lone surrogates in JSON, with escape…
mvitousek May 8, 2026
9e31cbe
[rust-compiler] Align Array/Math built-in method shapes with TS
mvitousek May 8, 2026
d6b9735
[rust-compiler] Add visitor hooks for ClassDeclaration/ClassExpression
mvitousek May 8, 2026
41495c9
[rust-compiler] Fix fn_type classification with DFS-last-return and c…
mvitousek May 8, 2026
e830ef2
[rust-compiler] Add node_to_scope_end for hoisting range detection
mvitousek May 8, 2026
535fd98
[rust-compiler] Float precision — parse from extra.raw
mvitousek May 8, 2026
fbd55f4
[rust-compiler] C0-only control char escaping
mvitousek May 8, 2026
ba1a729
[rust-compiler] Hoisting decl_start conditional filtering
mvitousek May 8, 2026
8e1cbf0
[rust-compiler] Class body JSON walking for identifier indexing
mvitousek May 8, 2026
6d57944
[rust-compiler] PromoteUsedTemporaries recursive nested fn visiting
mvitousek May 8, 2026
d9affe7
[rust-compiler] IndexMap determinism in InferMutationAliasingRanges
mvitousek May 8, 2026
b3342e8
[rust-compiler] Scope range sync — only sync identifiers with matchin…
mvitousek May 8, 2026
c311ba0
[rust-compiler] IndexSet determinism in InferMutationAliasingEffects …
mvitousek May 8, 2026
f80900b
[rust-compiler] Dynamic function discovery traversal + FunctionExpres…
mvitousek May 8, 2026
26d43d5
[rust-compiler] Fix synthetic IIFE scope resolution, JSX collection, …
mvitousek May 8, 2026
5e52b48
[rust-compiler] Fix scope.ts: skip zero-width nodes in nodeToScope + …
mvitousek May 8, 2026
a29a5cd
[rust-compiler] Detect component/hook declarations in prefilter
mvitousek May 8, 2026
1e59562
[rust-compiler] Convert assert!() to graceful error returns for fault…
mvitousek May 8, 2026
fbd8e82
[rust-compiler] Disable JSON recursion limit for deeply nested ASTs
mvitousek May 8, 2026
bbe2295
[rust-compiler] Wire cross-function UID collision avoidance through P…
mvitousek May 8, 2026
a274ac2
[rust-compiler] Use shared format_js_number in constant propagation
mvitousek May 8, 2026
df6860a
[rust-compiler] Fix UID generation indentation and simplify unwrap
mvitousek May 8, 2026
d348c56
[rust-compiler] Fix NumericLiteral precision + graceful missing ident…
mvitousek May 8, 2026
d99acce
[rust-compiler] Fix synthetic identifier resolution for match express…
mvitousek May 8, 2026
b0ed028
[compiler][rust] Fix fbt scope range sync in MemoizeFbtAndMacroOperan…
mvitousek May 8, 2026
4b348d3
[compiler][rust] Sync identifier mutable_ranges after scope merging i…
mvitousek May 8, 2026
6718759
[compiler][rust] Add repro fixtures for scope range sync fixes
mvitousek May 8, 2026
bf8c9fa
[compiler][rust] Add repro fixtures for bug fix commits
mvitousek May 8, 2026
a9080f1
[rust-compiler] Include type annotation references in scope data for …
mvitousek May 8, 2026
499f39e
[compiler][rust] Fix SIGSEGV in BuildReactiveFunction by converting r…
mvitousek May 8, 2026
30f1ba7
[rust-compiler] Fix optional chaining preserved in dependency checks
mvitousek May 8, 2026
e38f2e4
[rust-compiler] Skip type alias declarations in hoisting analysis
mvitousek May 8, 2026
9f222ed
[compiler][rust] Handle hoisted instruction kinds in codegen for valu…
mvitousek May 8, 2026
2ec4428
[rust-compiler] Fix hoisting to not emit DeclareContext before contro…
mvitousek May 8, 2026
506e305
[compiler][rust] Fix naming suffix order by giving inner functions in…
mvitousek May 8, 2026
5963faf
[rust-compiler] Fix is_binding_in_block_direct_statements to match by…
mvitousek May 8, 2026
21ccaf2
[react-compiler-rust] Fix duplicate declaration crashes by removing h…
mvitousek May 8, 2026
2a91267
[rust-compiler] Fix code divergences: scope position-0 guard, unused …
mvitousek May 8, 2026
63b5469
[react-compiler-rust] Fix _temp<N> naming by merging UIDs on compilat…
mvitousek May 8, 2026
49003e8
[react-compiler-rust] Fix numeric-literal-computed-property-assignmen…
mvitousek May 8, 2026
7e26eb8
[react-compiler-rust] Fix unused import { c as _c } when no compiled …
mvitousek May 8, 2026
7692af2
[rust-compiler] Node-ID resolution, OXC/SWC scope support, and contex…
mvitousek May 8, 2026
1ed7dd7
[rust-compiler] Fix OSS test snapshots and scope.ts type error
mvitousek May 11, 2026
f29f741
[rust-compiler] Add export default enum support to ExportDefaultDecl
mvitousek May 11, 2026
9a3f985
[rust-compiler] Handle TS cast wrappers as assignment targets (#36492)
poteto May 20, 2026
cfcbe9d
[rust-compiler] Dedup async-reassignment immutability diagnostic (#36…
poteto May 20, 2026
4b4acc9
[rust-compiler] Match TS behavior for TypeScript this parameters (#36…
poteto May 20, 2026
8fec1bf
[rust-compiler] Fix non-exhaustive PatternLike match in scope_resolut…
poteto May 20, 2026
85066da
[rust-compiler] Fix off-by-one in SWC source-location conversion (#36…
poteto May 21, 2026
09806e8
[rust-compiler] Preserve trailing and pragma comments in SWC frontend…
poteto May 21, 2026
e3ee07a
[rust-compiler] Populate loc on SWC-extracted comments (#36504)
poteto May 21, 2026
00fe3bc
[rust-compiler] Preserve TS type annotations on SWC binding identifie…
poteto May 21, 2026
9602762
[rust-compiler] Preserve TS type on SWC cast-wrapper expressions (#36…
poteto May 21, 2026
0d9885c
[rust-compiler] Emit loc.column/index as UTF-16 code units in SWC fro…
poteto May 21, 2026
bc0bfba
[rust-compiler] Treat redeclared functions as one binding in SWC scop…
poteto May 21, 2026
a94a01c
[rust-compiler] Apply compiler renames to SWC module after conversion…
poteto May 21, 2026
f98a683
[rust-compiler] Inject CLI filename into PluginOptions for SWC and OX…
poteto May 21, 2026
4f4c002
[rust-compiler] Document remaining e2e parity TODOs (#36511)
poteto May 21, 2026
f4d10fd
[rust-compiler] Bump round_trip test thread stack to 32 MiB in CI (#3…
poteto May 21, 2026
a858270
[rust-compiler] Add Rust backend support to ESLint plugin
May 29, 2026
c3a739c
[rust-compiler] Add export default function scope mapping, --dump-sco…
May 29, 2026
e49c252
[rust-compiler] Complete node-ID migration: remove position-based keying
May 29, 2026
8c3a94f
[rust-compiler] Fix remaining position-based identity lookups (Codex …
May 29, 2026
78e256c
[rust-compiler] Fix 108 WWW regressions: revert IdentifierLocIndex to…
May 29, 2026
8d3790f
[rust-compiler] Complete forward migration: IdentifierLocIndex keyed …
May 29, 2026
7f8305e
[rust-compiler] Phase 1: Set declaration_node_id in OXC/SWC, fix HirB…
May 29, 2026
eb66f46
[rust-compiler] Phase 2: Migrate hoisting + find_context to ref_node_…
May 29, 2026
ceca065
[rust-compiler] Phase 3: Remove dead position-based code
May 29, 2026
ce60bff
[rust-compiler] Fix type annotation refs dropped by node-ID migration
May 29, 2026
1934ac1
[rust-compiler] Extend IdentifierLocIndex walker for type annotations
May 29, 2026
1f0821d
[rust-compiler] Fix iteration-order sensitivity in gather_captured_co…
May 29, 2026
6f34465
[rust-compiler] Fix HoistInfo: use node_id for identifier_locs lookup
May 29, 2026
fe2b130
[rust-compiler] Stop populating reference_to_binding in OXC/SWC/outlined
May 29, 2026
5d113df
[rust-compiler] Add missing OXC AST node handlers (ImportExpression, …
May 29, 2026
397c174
[rust-compiler] Implement apply_renames for OXC frontend
Jun 2, 2026
75f6a2b
[rust-compiler] Add unique IDs to MutableRange for exact identity mat…
Jun 2, 2026
4f22df8
[rust-compiler] Populate original_node at all UnsupportedNode sites
Jun 3, 2026
8b880f2
[rust-compiler] Preserve explicit `predicate: null` in function-like …
poteto Jun 6, 2026
b7b9877
[rust-compiler] Allow Flow `TypeCastExpression` in `PatternLike` (#36…
poteto Jun 6, 2026
0dc7f2e
[rust-compiler] Green the snap suite: Flow match parsing + fixture ne…
poteto Jun 7, 2026
be5a50f
[rust-compiler] Fix scope test: skip serializing empty node-ID maps
Jun 5, 2026
68a64ec
[rust-compiler] Fix scope_resolution_rename: populate node IDs in tes…
Jun 5, 2026
c9a79ac
[rust-compiler] Fix JSX outlining: set node_id on identifiers and use…
Jun 6, 2026
e8da36c
[rust-compiler] Fix UnsupportedNode codegen: handle Expression nodes …
Jun 6, 2026
b62e66e
[rust-compiler] Add FunctionExpression predicate, rename fixtures, up…
Jun 8, 2026
0e1e6b8
[rust-compiler] Preserve explicit `predicate: null` in function-like …
poteto Jun 7, 2026
2b4c9bb
[rust-compiler] Flow match syntax: parse, test, and format for real
poteto Jun 7, 2026
b0b76d9
[rust-compiler] Add TDD fixtures for TS module-interop statements
poteto Jun 4, 2026
da55d8a
[rust-compiler] Tolerate unknown statement kinds at the AST boundary
poteto Jun 4, 2026
3a5e2ba
[rust-compiler] Preserve TS module-interop statements in the SWC fron…
poteto Jun 6, 2026
a82b589
Merge branch 'main' into rust-research
poteto Jun 8, 2026
0dbd252
[playground] Rehydrate logged compile error details into class instances
poteto Jun 7, 2026
12f7b57
[compiler] Print non-finite numbers faithfully in DebugPrintHIR
poteto Jun 7, 2026
d9546c1
[rust-compiler] Resolve function-decl names from the function's own s…
poteto Jun 8, 2026
c47eaa3
[compiler] Capture lowercase JSX tags that shadow locals; EnterSSA to…
poteto Jun 8, 2026
a57184c
[rust-compiler] Drop converged entries from snap TS skip list
poteto Jun 8, 2026
03397ff
[compiler] Fix multiline-comment-style lint in DebugPrintHIR
poteto Jun 8, 2026
6993fae
[rust-compiler] Context-variable and capture parity with TS traverse …
poteto Jun 8, 2026
c83f20b
[rust-compiler] Converge catch-param fixtures: error.bug names, snaps…
poteto Jun 8, 2026
90bdbc6
[rust-compiler] Fix has_local_binding to use scope_info instead of us…
Jun 8, 2026
49e1b18
[rust-compiler] Fix 8 pre-existing test failures: hermes-parser, snap…
Jun 8, 2026
b1568d6
[rust-compiler] Fix method-call-scope-merge eval snapshot for CI Node…
Jun 9, 2026
d9001e5
[rust-compiler] Replace toSorted() with [...arr].sort() in method-cal…
Jun 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
68 changes: 68 additions & 0 deletions .github/workflows/compiler_rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: React Compiler (Rust)

on:
push:
branches: [main]
pull_request:
paths:
- compiler/**
- .github/workflows/compiler_rust.yml

permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

env:
TZ: /usr/share/zoneinfo/America/Los_Angeles
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1

defaults:
run:
working-directory: compiler

jobs:
rust:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# --- Rust toolchain ---
- uses: dtolnay/rust-toolchain@stable

- name: Cache cargo registry and build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
compiler/target
key: cargo-${{ runner.os }}-${{ hashFiles('compiler/Cargo.lock') }}
restore-keys: cargo-${{ runner.os }}-

# --- Node (needed for test scripts) ---
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: yarn
cache-dependency-path: compiler/yarn.lock

- name: Restore cached node_modules
uses: actions/cache@v4
id: node_modules
with:
path: '**/node_modules'
key: compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('compiler/yarn.lock') }}

- run: yarn install --frozen-lockfile
if: steps.node_modules.outputs.cache-hit != 'true'

# --- Build & test ---
- run: cargo check
- run: cargo build
- run: bash scripts/test-babel-ast.sh
- run: bash scripts/test-rust-port.sh
- run: yarn workspace snap run build
- run: yarn snap --rust
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ chrome-user-data
/tmp
/.worktrees
.claude/*.local.*
.claude/worktrees

packages/react-devtools-core/dist
packages/react-devtools-extensions/chrome/build
Expand Down
11 changes: 11 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,16 @@ module.exports = {
parser: 'typescript',
},
},
{
// Flow `match` syntax fixtures: prettier's built-in Flow parser cannot
// parse the experimental syntax, hermes-parser can.
files: [
'compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/match-*',
],
options: {
parser: 'hermes',
plugins: ['prettier-plugin-hermes-parser'],
},
},
],
};
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:
Comment thread
josephsavona marked this conversation as resolved.
- 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
Loading
Loading