6//! Port of OutlineJsx from TypeScript.
7//!
8▶//! Outlines JSX expressions in callbacks into separate component functions.
9//! This pass is conditional on `env.config.enable_jsx_outlining` (defaults to false).
10
· · ·
14use react_compiler_hir::environment::Environment;
15use react_compiler_hir::{
16▶ BasicBlock, BlockId, BlockKind, EvaluationOrder, FunctionId, HIR, HirFunction, IdentifierId,
17 IdentifierName, Instruction, InstructionId, InstructionKind, InstructionValue, JsxAttribute,
18 JsxTag, LValuePattern, NonLocalBinding, ObjectPattern, ObjectProperty, ObjectPropertyKey,
· · ·
19▶ ObjectPropertyOrSpread, ObjectPropertyType, ParamPattern, Pattern, Place, ReactFunctionType,
20 ReturnVariant, Terminal,
21};
· · ·
22
23▶/// Outline JSX expressions in inner functions into separate outlined components.
24///
25/// Ported from TS `outlineJSX` in `Optimization/OutlineJsx.ts`.
· · ·
26▶pub fn outline_jsx(func: &mut HirFunction, env: &mut Environment) {
27 let mut outlined_fns: Vec<HirFunction> = Vec::new();
28 outline_jsx_impl(func, env, &mut outlined_fns);
+ 57 more matches in this file