Home / Function/ traverseScopeIdentifiers() — react Function Reference

traverseScopeIdentifiers() — react Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  130a4090_669d_40b7_28ec_e7c937c9c3b3["traverseScopeIdentifiers()"]
  a4a59234_8b6b_31f7_3cdd_2c065b60eae1["PromoteAllInstancedOfPromotedTemporaries"]
  130a4090_669d_40b7_28ec_e7c937c9c3b3 -->|defined in| a4a59234_8b6b_31f7_3cdd_2c065b60eae1
  9ecb747f_cf74_313d_4cec_4c32788af678["visitScope()"]
  9ecb747f_cf74_313d_4cec_4c32788af678 -->|calls| 130a4090_669d_40b7_28ec_e7c937c9c3b3
  b0eda56d_bc25_e1f0_6478_37239f37dbc3["visitPrunedScope()"]
  b0eda56d_bc25_e1f0_6478_37239f37dbc3 -->|calls| 130a4090_669d_40b7_28ec_e7c937c9c3b3
  81fadb8d_22f1_6208_bbd3_8af4016beda9["promoteIdentifier()"]
  130a4090_669d_40b7_28ec_e7c937c9c3b3 -->|calls| 81fadb8d_22f1_6208_bbd3_8af4016beda9
  style 130a4090_669d_40b7_28ec_e7c937c9c3b3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PromoteUsedTemporaries.ts lines 125–150

  traverseScopeIdentifiers(scope: ReactiveScope, state: State): void {
    for (const [, decl] of scope.declarations) {
      if (
        decl.identifier.name === null &&
        state.promoted.has(decl.identifier.declarationId)
      ) {
        promoteIdentifier(decl.identifier, state);
      }
    }
    for (const dep of scope.dependencies) {
      if (
        dep.identifier.name === null &&
        state.promoted.has(dep.identifier.declarationId)
      ) {
        promoteIdentifier(dep.identifier, state);
      }
    }
    for (const reassignment of scope.reassignments) {
      if (
        reassignment.name === null &&
        state.promoted.has(reassignment.declarationId)
      ) {
        promoteIdentifier(reassignment, state);
      }
    }
  }

Domain

Subdomains

Frequently Asked Questions

What does traverseScopeIdentifiers() do?
traverseScopeIdentifiers() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PromoteUsedTemporaries.ts.
Where is traverseScopeIdentifiers() defined?
traverseScopeIdentifiers() is defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PromoteUsedTemporaries.ts at line 125.
What does traverseScopeIdentifiers() call?
traverseScopeIdentifiers() calls 1 function(s): promoteIdentifier.
What calls traverseScopeIdentifiers()?
traverseScopeIdentifiers() is called by 2 function(s): visitPrunedScope, visitScope.

Analyze Your Own Codebase

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

Try Supermodel Free