Home / Function/ addImportSpecifier() — react Function Reference

addImportSpecifier() — react Function Reference

Architecture documentation for the addImportSpecifier() function in Imports.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  dd08b3af_83bb_70f8_8837_798eff915e39["addImportSpecifier()"]
  1bba49a9_dc32_ad8e_e249_ee6b8eb56d16["ProgramContext"]
  dd08b3af_83bb_70f8_8837_798eff915e39 -->|defined in| 1bba49a9_dc32_ad8e_e249_ee6b8eb56d16
  77b776cd_a7c8_1d29_ba32_e5a39fa85dd9["insertGatedFunctionDeclaration()"]
  77b776cd_a7c8_1d29_ba32_e5a39fa85dd9 -->|calls| dd08b3af_83bb_70f8_8837_798eff915e39
  d8a73ffa_b16d_aa4e_3ae4_e3bcc29476e8["addMemoCacheImport()"]
  d8a73ffa_b16d_aa4e_3ae4_e3bcc29476e8 -->|calls| dd08b3af_83bb_70f8_8837_798eff915e39
  be5dd024_ebb7_729f_f653_2158dc13ee4c["newUid()"]
  dd08b3af_83bb_70f8_8837_798eff915e39 -->|calls| be5dd024_ebb7_729f_f653_2158dc13ee4c
  4663af75_e270_25e3_3415_1230be609d66["getOrInsertWith()"]
  dd08b3af_83bb_70f8_8837_798eff915e39 -->|calls| 4663af75_e270_25e3_3415_1230be609d66
  style dd08b3af_83bb_70f8_8837_798eff915e39 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Imports.ts lines 173–192

  addImportSpecifier(
    {source: module, importSpecifierName: specifier}: ExternalFunction,
    nameHint?: string,
  ): NonLocalImportSpecifier {
    const maybeBinding = this.imports.get(module)?.get(specifier);
    if (maybeBinding != null) {
      return {...maybeBinding};
    }

    const binding: NonLocalImportSpecifier = {
      kind: 'ImportSpecifier',
      name: this.newUid(nameHint ?? specifier),
      module,
      imported: specifier,
    };
    getOrInsertWith(this.imports, module, () => new Map()).set(specifier, {
      ...binding,
    });
    return binding;
  }

Domain

Subdomains

Frequently Asked Questions

What does addImportSpecifier() do?
addImportSpecifier() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Imports.ts.
Where is addImportSpecifier() defined?
addImportSpecifier() is defined in compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Imports.ts at line 173.
What does addImportSpecifier() call?
addImportSpecifier() calls 2 function(s): getOrInsertWith, newUid.
What calls addImportSpecifier()?
addImportSpecifier() is called by 2 function(s): addMemoCacheImport, insertGatedFunctionDeclaration.

Analyze Your Own Codebase

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

Try Supermodel Free