Home / Class/ Visitor Class — react Architecture

Visitor Class — react Architecture

Architecture documentation for the Visitor class in PruneTemporaryLValues.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  511a9204_797f_cc4a_5802_f24410c130cb["Visitor"]
  3d902967_8874_4cce_367f_23c9a916116a["PruneTemporaryLValues.ts"]
  511a9204_797f_cc4a_5802_f24410c130cb -->|defined in| 3d902967_8874_4cce_367f_23c9a916116a
  822e192b_3693_5f93_99fc_6111d5e20561["visitPlace()"]
  511a9204_797f_cc4a_5802_f24410c130cb -->|method| 822e192b_3693_5f93_99fc_6111d5e20561
  de24fdaf_4501_a945_7e26_bfe72dbe5b85["visitInstruction()"]
  511a9204_797f_cc4a_5802_f24410c130cb -->|method| de24fdaf_4501_a945_7e26_bfe72dbe5b85

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PruneTemporaryLValues.ts lines 39–55

class Visitor extends ReactiveFunctionVisitor<LValues> {
  override visitPlace(id: InstructionId, place: Place, state: LValues): void {
    state.delete(place.identifier.declarationId);
  }
  override visitInstruction(
    instruction: ReactiveInstruction,
    state: LValues,
  ): void {
    this.traverseInstruction(instruction, state);
    if (
      instruction.lvalue !== null &&
      instruction.lvalue.identifier.name === null
    ) {
      state.set(instruction.lvalue.identifier.declarationId, instruction);
    }
  }
}

Domain

Frequently Asked Questions

What is the Visitor class?
Visitor is a class in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PruneTemporaryLValues.ts.
Where is Visitor defined?
Visitor is defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PruneTemporaryLValues.ts at line 39.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free