Home / Function/ hasMemoCacheFunctionImport() — react Function Reference

hasMemoCacheFunctionImport() — react Function Reference

Architecture documentation for the hasMemoCacheFunctionImport() function in Program.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  36291a8f_e44c_5f09_4a36_e0708d0af350["hasMemoCacheFunctionImport()"]
  9aa4477d_960b_1ea1_b6d9_36076aaa70bd["Program.ts"]
  36291a8f_e44c_5f09_4a36_e0708d0af350 -->|defined in| 9aa4477d_960b_1ea1_b6d9_36076aaa70bd
  9e49688f_6b43_84fe_0dd2_18e5142c1f71["shouldSkipCompilation()"]
  9e49688f_6b43_84fe_0dd2_18e5142c1f71 -->|calls| 36291a8f_e44c_5f09_4a36_e0708d0af350
  style 36291a8f_e44c_5f09_4a36_e0708d0af350 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts lines 999–1023

function hasMemoCacheFunctionImport(
  program: NodePath<t.Program>,
  moduleName: string,
): boolean {
  let hasUseMemoCache = false;
  program.traverse({
    ImportSpecifier(path) {
      const imported = path.get('imported');
      let importedName: string | null = null;
      if (imported.isIdentifier()) {
        importedName = imported.node.name;
      } else if (imported.isStringLiteral()) {
        importedName = imported.node.value;
      }
      if (
        importedName === 'c' &&
        path.parentPath.isImportDeclaration() &&
        path.parentPath.get('source').node.value === moduleName
      ) {
        hasUseMemoCache = true;
      }
    },
  });
  return hasUseMemoCache;
}

Domain

Subdomains

Frequently Asked Questions

What does hasMemoCacheFunctionImport() do?
hasMemoCacheFunctionImport() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts.
Where is hasMemoCacheFunctionImport() defined?
hasMemoCacheFunctionImport() is defined in compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts at line 999.
What calls hasMemoCacheFunctionImport()?
hasMemoCacheFunctionImport() is called by 1 function(s): shouldSkipCompilation.

Analyze Your Own Codebase

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

Try Supermodel Free