Home / Function/ optimize() — vue Function Reference

optimize() — vue Function Reference

Architecture documentation for the optimize() function in optimizer.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  4dd348f6_49d4_7d90_cd43_a028cf7729f6["optimize()"]
  4a6c1fba_4814_b3d9_ff02_8fe63201f887["createCompiler()"]
  4a6c1fba_4814_b3d9_ff02_8fe63201f887 -->|calls| 4dd348f6_49d4_7d90_cd43_a028cf7729f6
  3db86199_9b4d_9828_3e37_09eaa549b4c0["assertCodegen()"]
  3db86199_9b4d_9828_3e37_09eaa549b4c0 -->|calls| 4dd348f6_49d4_7d90_cd43_a028cf7729f6
  aa905c19_18e1_1ec3_26d9_4dceaf61468a["markStatic()"]
  4dd348f6_49d4_7d90_cd43_a028cf7729f6 -->|calls| aa905c19_18e1_1ec3_26d9_4dceaf61468a
  721440da_6e85_f311_1dac_a7f02bbc932d["markStaticRoots()"]
  4dd348f6_49d4_7d90_cd43_a028cf7729f6 -->|calls| 721440da_6e85_f311_1dac_a7f02bbc932d
  style 4dd348f6_49d4_7d90_cd43_a028cf7729f6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/compiler/optimizer.ts lines 20–31

export function optimize(
  root: ASTElement | null | undefined,
  options: CompilerOptions
) {
  if (!root) return
  isStaticKey = genStaticKeysCached(options.staticKeys || '')
  isPlatformReservedTag = options.isReservedTag || no
  // first pass: mark all non-static nodes.
  markStatic(root)
  // second pass: mark static roots.
  markStaticRoots(root, false)
}

Subdomains

Frequently Asked Questions

What does optimize() do?
optimize() is a function in the vue codebase.
What does optimize() call?
optimize() calls 2 function(s): markStatic, markStaticRoots.
What calls optimize()?
optimize() is called by 2 function(s): assertCodegen, createCompiler.

Analyze Your Own Codebase

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

Try Supermodel Free