AliasVisitor Class — react Architecture
Architecture documentation for the AliasVisitor class in PruneInitializationDependencies.ts from the react codebase.
Entity Profile
Dependency Diagram
graph TD 5e7d48c5_557f_060b_3b88_ed38a5805056["AliasVisitor"] a4218b71_262a_ca43_13e7_98514ab3bd4e["PruneInitializationDependencies.ts"] 5e7d48c5_557f_060b_3b88_ed38a5805056 -->|defined in| a4218b71_262a_ca43_13e7_98514ab3bd4e e1291b8d_d23d_3a82_5ffa_61cb16b82596["visitInstruction()"] 5e7d48c5_557f_060b_3b88_ed38a5805056 -->|method| e1291b8d_d23d_3a82_5ffa_61cb16b82596
Relationship Graph
Source Code
compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PruneInitializationDependencies.ts lines 232–271
class AliasVisitor extends ReactiveFunctionVisitor {
scopeIdentifiers: DisjointSet<IdentifierId> = new DisjointSet<IdentifierId>();
scopePaths: Map<IdentifierId, Map<PropertyLiteral, IdentifierId>> = new Map();
override visitInstruction(instr: ReactiveInstruction): void {
if (
instr.value.kind === 'StoreLocal' ||
instr.value.kind === 'StoreContext'
) {
this.scopeIdentifiers.union([
instr.value.lvalue.place.identifier.id,
instr.value.value.identifier.id,
]);
} else if (
instr.value.kind === 'LoadLocal' ||
instr.value.kind === 'LoadContext'
) {
instr.lvalue &&
this.scopeIdentifiers.union([
instr.lvalue.identifier.id,
instr.value.place.identifier.id,
]);
} else if (instr.value.kind === 'PropertyLoad') {
instr.lvalue &&
update(
this.scopePaths,
instr.value.object.identifier.id,
instr.value.property,
instr.lvalue.identifier.id,
);
} else if (instr.value.kind === 'PropertyStore') {
update(
this.scopePaths,
instr.value.object.identifier.id,
instr.value.property,
instr.value.value.identifier.id,
);
}
}
}
Domain
Defined In
Source
Frequently Asked Questions
What is the AliasVisitor class?
AliasVisitor is a class in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PruneInitializationDependencies.ts.
Where is AliasVisitor defined?
AliasVisitor is defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PruneInitializationDependencies.ts at line 232.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free