Home / Function/ markStatic() — vue Function Reference

markStatic() — vue Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  ea97fb1f_8393_c30f_027b_052e24cd5a51["markStatic()"]
  62546a34_f736_9139_cfec_7d596f17642d["optimizer.ts"]
  ea97fb1f_8393_c30f_027b_052e24cd5a51 -->|defined in| 62546a34_f736_9139_cfec_7d596f17642d
  8f748a9a_ff71_2969_6535_4a7b190ab72e["optimize()"]
  8f748a9a_ff71_2969_6535_4a7b190ab72e -->|calls| ea97fb1f_8393_c30f_027b_052e24cd5a51
  e4e07c76_033f_8a05_db91_26039099f986["isStatic()"]
  ea97fb1f_8393_c30f_027b_052e24cd5a51 -->|calls| e4e07c76_033f_8a05_db91_26039099f986
  style ea97fb1f_8393_c30f_027b_052e24cd5a51 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/compiler/optimizer.ts lines 40–70

function markStatic(node: ASTNode) {
  node.static = isStatic(node)
  if (node.type === 1) {
    // do not make component slot content static. this avoids
    // 1. components not able to mutate slot nodes
    // 2. static slot content fails for hot-reloading
    if (
      !isPlatformReservedTag(node.tag) &&
      node.tag !== 'slot' &&
      node.attrsMap['inline-template'] == null
    ) {
      return
    }
    for (let i = 0, l = node.children.length; i < l; i++) {
      const child = node.children[i]
      markStatic(child)
      if (!child.static) {
        node.static = false
      }
    }
    if (node.ifConditions) {
      for (let i = 1, l = node.ifConditions.length; i < l; i++) {
        const block = node.ifConditions[i].block
        markStatic(block)
        if (!block.static) {
          node.static = false
        }
      }
    }
  }
}

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does markStatic() do?
markStatic() is a function in the vue codebase, defined in src/compiler/optimizer.ts.
Where is markStatic() defined?
markStatic() is defined in src/compiler/optimizer.ts at line 40.
What does markStatic() call?
markStatic() calls 1 function(s): isStatic.
What calls markStatic()?
markStatic() is called by 1 function(s): optimize.

Analyze Your Own Codebase

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

Try Supermodel Free