Home / Function/ visitPrunedScope() — react Function Reference

visitPrunedScope() — react Function Reference

Architecture documentation for the visitPrunedScope() function in PromoteUsedTemporaries.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  db29a3b5_069a_8469_4b85_393df6b436e5["visitPrunedScope()"]
  0978ed10_d7af_9dac_ac08_cbaa51b0ff27["PromoteTemporaries"]
  db29a3b5_069a_8469_4b85_393df6b436e5 -->|defined in| 0978ed10_d7af_9dac_ac08_cbaa51b0ff27
  9e08bc54_4081_9437_d308_655eff9c1687["traversePrunedScope()"]
  db29a3b5_069a_8469_4b85_393df6b436e5 -->|calls| 9e08bc54_4081_9437_d308_655eff9c1687
  81fadb8d_22f1_6208_bbd3_8af4016beda9["promoteIdentifier()"]
  db29a3b5_069a_8469_4b85_393df6b436e5 -->|calls| 81fadb8d_22f1_6208_bbd3_8af4016beda9
  6170a433_a27a_7455_6589_a23a789d4771["visitPrunedScope()"]
  db29a3b5_069a_8469_4b85_393df6b436e5 -->|calls| 6170a433_a27a_7455_6589_a23a789d4771
  style db29a3b5_069a_8469_4b85_393df6b436e5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PromoteUsedTemporaries.ts lines 56–70

  override visitPrunedScope(
    scopeBlock: PrunedReactiveScopeBlock,
    state: State,
  ): void {
    for (const [, declaration] of scopeBlock.scope.declarations) {
      if (
        declaration.identifier.name == null &&
        state.pruned.get(declaration.identifier.declarationId)
          ?.usedOutsideScope === true
      ) {
        promoteIdentifier(declaration.identifier, state);
      }
    }
    this.traversePrunedScope(scopeBlock, state);
  }

Domain

Subdomains

Frequently Asked Questions

What does visitPrunedScope() do?
visitPrunedScope() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PromoteUsedTemporaries.ts.
Where is visitPrunedScope() defined?
visitPrunedScope() is defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PromoteUsedTemporaries.ts at line 56.
What does visitPrunedScope() call?
visitPrunedScope() calls 3 function(s): promoteIdentifier, traversePrunedScope, visitPrunedScope.

Analyze Your Own Codebase

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

Try Supermodel Free