Home / Function/ simplifyIdentifiersRenameRef() — react Function Reference

simplifyIdentifiersRenameRef() — react Function Reference

Architecture documentation for the simplifyIdentifiersRenameRef() function in minimize.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  d376631b_9d83_dc76_f2ee_4c9d62137454["simplifyIdentifiersRenameRef()"]
  9c061da8_dbf8_4168_823d_991654a3c55d["minimize.ts"]
  d376631b_9d83_dc76_f2ee_4c9d62137454 -->|defined in| 9c061da8_dbf8_4168_823d_991654a3c55d
  a7ee1f5a_4bf8_7201_de45_83f6328fc3fa["collectUniqueIdentifierNames()"]
  d376631b_9d83_dc76_f2ee_4c9d62137454 -->|calls| a7ee1f5a_4bf8_7201_de45_83f6328fc3fa
  7a9af496_ef6a_d9e8_8eaf_1f386f49e4b3["cloneAst()"]
  d376631b_9d83_dc76_f2ee_4c9d62137454 -->|calls| 7a9af496_ef6a_d9e8_8eaf_1f386f49e4b3
  b99ea007_79df_8b89_65e1_348b6793732f["renameAllIdentifiers()"]
  d376631b_9d83_dc76_f2ee_4c9d62137454 -->|calls| b99ea007_79df_8b89_65e1_348b6793732f
  style d376631b_9d83_dc76_f2ee_4c9d62137454 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/snap/src/minimize.ts lines 1959–1971

function* simplifyIdentifiersRenameRef(ast: t.File): Generator<t.File> {
  const names = collectUniqueIdentifierNames(ast);

  if (names.has('ref')) {
    // Only rename if ref_ doesn't already exist
    if (!names.has('ref_')) {
      const cloned = cloneAst(ast);
      if (renameAllIdentifiers(cloned, 'ref', 'ref_')) {
        yield cloned;
      }
    }
  }
}

Domain

Subdomains

Frequently Asked Questions

What does simplifyIdentifiersRenameRef() do?
simplifyIdentifiersRenameRef() is a function in the react codebase, defined in compiler/packages/snap/src/minimize.ts.
Where is simplifyIdentifiersRenameRef() defined?
simplifyIdentifiersRenameRef() is defined in compiler/packages/snap/src/minimize.ts at line 1959.
What does simplifyIdentifiersRenameRef() call?
simplifyIdentifiersRenameRef() calls 3 function(s): cloneAst, collectUniqueIdentifierNames, renameAllIdentifiers.

Analyze Your Own Codebase

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

Try Supermodel Free