The React Compiler is being ported from TypeScript to Rust. The porting process involves several transformation passes that operate on the High-Level Intermediate Representation (HIR). These passes are categorized into different stages, including analysis passes (e.g., AnalyseFunctions, InferMutationAliasingEffects) and HIR passes (e.g., PropagateScopeDependenciesHIR, AlignReactiveScopesToBlockScopesHIR).
Key transformation stages include:
- Analysis Passes: Compute effects, mutation aliasing, and reactive places.
- HIR Passes: Manage reactive scopes, flatten loops, and propagate dependencies.
- Validation Passes: Ensure correctness by checking for patterns like
ValidateNoSetStateInRender or ValidateNoRefAccessInRender.