Home / Function/ getExistingImports() — react Function Reference

getExistingImports() — react Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  9863ad63_8ce7_66b3_fe68_e73a382edd72["getExistingImports()"]
  2a7e50cd_6171_085d_277c_6ced6ddd7148["Imports.ts"]
  9863ad63_8ce7_66b3_fe68_e73a382edd72 -->|defined in| 2a7e50cd_6171_085d_277c_6ced6ddd7148
  e19f561e_cb2d_6161_2ab6_1c6533ed4958["addImportsToProgram()"]
  e19f561e_cb2d_6161_2ab6_1c6533ed4958 -->|calls| 9863ad63_8ce7_66b3_fe68_e73a382edd72
  bc43c24e_a9e2_572f_1f44_69845bcab74e["isNonNamespacedImport()"]
  9863ad63_8ce7_66b3_fe68_e73a382edd72 -->|calls| bc43c24e_a9e2_572f_1f44_69845bcab74e
  style 9863ad63_8ce7_66b3_fe68_e73a382edd72 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Imports.ts lines 224–236

function getExistingImports(
  program: NodePath<t.Program>,
): Map<string, NodePath<t.ImportDeclaration>> {
  const existingImports = new Map<string, NodePath<t.ImportDeclaration>>();
  program.traverse({
    ImportDeclaration(path) {
      if (isNonNamespacedImport(path)) {
        existingImports.set(path.node.source.value, path);
      }
    },
  });
  return existingImports;
}

Domain

Subdomains

Frequently Asked Questions

What does getExistingImports() do?
getExistingImports() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Imports.ts.
Where is getExistingImports() defined?
getExistingImports() is defined in compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Imports.ts at line 224.
What does getExistingImports() call?
getExistingImports() calls 1 function(s): isNonNamespacedImport.
What calls getExistingImports()?
getExistingImports() is called by 1 function(s): addImportsToProgram.

Analyze Your Own Codebase

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

Try Supermodel Free