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
  47a275bd_2581_aeff_9124_e9298610ab3f["optimize()"]
  5e33e1e0_159e_45ee_a1cd_33a5b88f58de["createCompiler()"]
  5e33e1e0_159e_45ee_a1cd_33a5b88f58de -->|calls| 47a275bd_2581_aeff_9124_e9298610ab3f
  18126178_83e0_0b6d_addc_14cbe5457ac9["markStatic()"]
  47a275bd_2581_aeff_9124_e9298610ab3f -->|calls| 18126178_83e0_0b6d_addc_14cbe5457ac9
  730159c2_1493_882e_b97a_dc4fac64dcc1["markStaticRoots()"]
  47a275bd_2581_aeff_9124_e9298610ab3f -->|calls| 730159c2_1493_882e_b97a_dc4fac64dcc1
  style 47a275bd_2581_aeff_9124_e9298610ab3f 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)
}

Domain

Subdomains

Called By

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 1 function(s): createCompiler.

Analyze Your Own Codebase

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

Try Supermodel Free