Home / Function/ emitLoadGlobals() — react Function Reference

emitLoadGlobals() — react Function Reference

Architecture documentation for the emitLoadGlobals() function in OutlineJsx.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  95c42a01_f55a_6d2d_20cd_137cc1fe34d6["emitLoadGlobals()"]
  158befb1_050c_87d2_b4ec_54305bac5a4f["OutlineJsx.ts"]
  95c42a01_f55a_6d2d_20cd_137cc1fe34d6 -->|defined in| 158befb1_050c_87d2_b4ec_54305bac5a4f
  c201bbda_dc3c_7b58_7ce0_7d61d25ef972["emitOutlinedFn()"]
  c201bbda_dc3c_7b58_7ce0_7d61d25ef972 -->|calls| 95c42a01_f55a_6d2d_20cd_137cc1fe34d6
  53244187_914c_cc90_5880_7bfc1fc9c0bb["push()"]
  95c42a01_f55a_6d2d_20cd_137cc1fe34d6 -->|calls| 53244187_914c_cc90_5880_7bfc1fc9c0bb
  style 95c42a01_f55a_6d2d_20cd_137cc1fe34d6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Optimization/OutlineJsx.ts lines 386–403

function emitLoadGlobals(
  jsx: Array<JsxInstruction>,
  globals: LoadGlobalMap,
): Array<Instruction> | null {
  const instructions: Array<Instruction> = [];
  for (const {value} of jsx) {
    // Add load globals instructions for jsx tags
    if (value.tag.kind === 'Identifier') {
      const loadGlobalInstr = globals.get(value.tag.identifier.id);
      if (!loadGlobalInstr) {
        return null;
      }
      instructions.push(loadGlobalInstr);
    }
  }

  return instructions;
}

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does emitLoadGlobals() do?
emitLoadGlobals() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Optimization/OutlineJsx.ts.
Where is emitLoadGlobals() defined?
emitLoadGlobals() is defined in compiler/packages/babel-plugin-react-compiler/src/Optimization/OutlineJsx.ts at line 386.
What does emitLoadGlobals() call?
emitLoadGlobals() calls 1 function(s): push.
What calls emitLoadGlobals()?
emitLoadGlobals() is called by 1 function(s): emitOutlinedFn.

Analyze Your Own Codebase

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

Try Supermodel Free