Home / Function/ collectReactiveIdentifiersHIR() — react Function Reference

collectReactiveIdentifiersHIR() — react Function Reference

Architecture documentation for the collectReactiveIdentifiersHIR() function in ValidateExhaustiveDependencies.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  b0a60b4f_b441_1268_4d97_11d4cab39424["collectReactiveIdentifiersHIR()"]
  fe7a7397_dddc_7222_20d4_d5b1015466f1["ValidateExhaustiveDependencies.ts"]
  b0a60b4f_b441_1268_4d97_11d4cab39424 -->|defined in| fe7a7397_dddc_7222_20d4_d5b1015466f1
  46f23ae0_a9cb_8a6e_401f_cd99f2f91c00["validateExhaustiveDependencies()"]
  46f23ae0_a9cb_8a6e_401f_cd99f2f91c00 -->|calls| b0a60b4f_b441_1268_4d97_11d4cab39424
  10043bf1_f7ee_9ed9_307a_fe3edfd02b09["eachInstructionLValue()"]
  b0a60b4f_b441_1268_4d97_11d4cab39424 -->|calls| 10043bf1_f7ee_9ed9_307a_fe3edfd02b09
  b2fc2985_a7ba_9865_c2a3_2a7531f27d44["eachInstructionValueOperand()"]
  b0a60b4f_b441_1268_4d97_11d4cab39424 -->|calls| b2fc2985_a7ba_9865_c2a3_2a7531f27d44
  41232a25_deb6_6e83_05a8_ae9f961656f7["eachTerminalOperand()"]
  b0a60b4f_b441_1268_4d97_11d4cab39424 -->|calls| 41232a25_deb6_6e83_05a8_ae9f961656f7
  style b0a60b4f_b441_1268_4d97_11d4cab39424 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateExhaustiveDependencies.ts lines 935–957

function collectReactiveIdentifiersHIR(fn: HIRFunction): Set<IdentifierId> {
  const reactive = new Set<IdentifierId>();
  for (const block of fn.body.blocks.values()) {
    for (const instr of block.instructions) {
      for (const lvalue of eachInstructionLValue(instr)) {
        if (lvalue.reactive) {
          reactive.add(lvalue.identifier.id);
        }
      }
      for (const operand of eachInstructionValueOperand(instr.value)) {
        if (operand.reactive) {
          reactive.add(operand.identifier.id);
        }
      }
    }
    for (const operand of eachTerminalOperand(block.terminal)) {
      if (operand.reactive) {
        reactive.add(operand.identifier.id);
      }
    }
  }
  return reactive;
}

Domain

Subdomains

Frequently Asked Questions

What does collectReactiveIdentifiersHIR() do?
collectReactiveIdentifiersHIR() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateExhaustiveDependencies.ts.
Where is collectReactiveIdentifiersHIR() defined?
collectReactiveIdentifiersHIR() is defined in compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateExhaustiveDependencies.ts at line 935.
What does collectReactiveIdentifiersHIR() call?
collectReactiveIdentifiersHIR() calls 3 function(s): eachInstructionLValue, eachInstructionValueOperand, eachTerminalOperand.
What calls collectReactiveIdentifiersHIR()?
collectReactiveIdentifiersHIR() is called by 1 function(s): validateExhaustiveDependencies.

Analyze Your Own Codebase

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

Try Supermodel Free