Home / Function/ definePlace() — react Function Reference

definePlace() — react Function Reference

Architecture documentation for the definePlace() function in EnterSSA.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  1bda4538_293e_48ce_ea89_3160033e51b6["definePlace()"]
  f11adc00_6af6_2575_4ee8_974e26f2a6ed["SSABuilder"]
  1bda4538_293e_48ce_ea89_3160033e51b6 -->|defined in| f11adc00_6af6_2575_4ee8_974e26f2a6ed
  e8a9db95_a3f8_ba5e_4289_87022b3ec4e0["defineContext()"]
  e8a9db95_a3f8_ba5e_4289_87022b3ec4e0 -->|calls| 1bda4538_293e_48ce_ea89_3160033e51b6
  8ec30eb2_4622_378f_f538_3070f7a38fae["enterSSAImpl()"]
  8ec30eb2_4622_378f_f538_3070f7a38fae -->|calls| 1bda4538_293e_48ce_ea89_3160033e51b6
  9038f078_e688_0fe0_26fd_2eb655330c6f["getPlace()"]
  1bda4538_293e_48ce_ea89_3160033e51b6 -->|calls| 9038f078_e688_0fe0_26fd_2eb655330c6f
  dde21261_8a25_cb71_4e56_b0eb6348704b["makeId()"]
  1bda4538_293e_48ce_ea89_3160033e51b6 -->|calls| dde21261_8a25_cb71_4e56_b0eb6348704b
  22130362_6f7b_966d_4373_b384767b7acf["state()"]
  1bda4538_293e_48ce_ea89_3160033e51b6 -->|calls| 22130362_6f7b_966d_4373_b384767b7acf
  cf8d627e_c2f0_6cd4_e5fc_35f3c7005b64["throwTodo()"]
  1bda4538_293e_48ce_ea89_3160033e51b6 -->|calls| cf8d627e_c2f0_6cd4_e5fc_35f3c7005b64
  e7a01d7c_c128_be66_a07d_007952a380da["printIdentifier()"]
  1bda4538_293e_48ce_ea89_3160033e51b6 -->|calls| e7a01d7c_c128_be66_a07d_007952a380da
  style 1bda4538_293e_48ce_ea89_3160033e51b6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/SSA/EnterSSA.ts lines 99–121

  definePlace(oldPlace: Place): Place {
    const oldId = oldPlace.identifier;
    if (this.#unknown.has(oldId)) {
      CompilerError.throwTodo({
        reason: `[hoisting] EnterSSA: Expected identifier to be defined before being used`,
        description: `Identifier ${printIdentifier(oldId)} is undefined`,
        loc: oldPlace.loc,
        suggestions: null,
      });
    }

    // Do not redefine context references.
    if (this.#context.has(oldId)) {
      return this.getPlace(oldPlace);
    }

    const newId = this.makeId(oldId);
    this.state().defs.set(oldId, newId);
    return {
      ...oldPlace,
      identifier: newId,
    };
  }

Subdomains

Frequently Asked Questions

What does definePlace() do?
definePlace() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/SSA/EnterSSA.ts.
Where is definePlace() defined?
definePlace() is defined in compiler/packages/babel-plugin-react-compiler/src/SSA/EnterSSA.ts at line 99.
What does definePlace() call?
definePlace() calls 5 function(s): getPlace, makeId, printIdentifier, state, throwTodo.
What calls definePlace()?
definePlace() is called by 2 function(s): defineContext, enterSSAImpl.

Analyze Your Own Codebase

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

Try Supermodel Free