Home / Function/ isStatic() — vue Function Reference

isStatic() — vue Function Reference

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

Function typescript VueCore GlobalAPI calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  52c32634_36a9_cf7b_cb3e_b809636e8a93["isStatic()"]
  c66d4aaa_9814_c96c_1d3f_ef17ed6ab384["optimizer.ts"]
  52c32634_36a9_cf7b_cb3e_b809636e8a93 -->|defined in| c66d4aaa_9814_c96c_1d3f_ef17ed6ab384
  9fc163b0_7973_42d1_4dec_178d72bbafa1["markStatic()"]
  9fc163b0_7973_42d1_4dec_178d72bbafa1 -->|calls| 52c32634_36a9_cf7b_cb3e_b809636e8a93
  8d3b1e3d_cddb_043d_a6ce_f911e2845e1c["isDirectChildOfTemplateFor()"]
  52c32634_36a9_cf7b_cb3e_b809636e8a93 -->|calls| 8d3b1e3d_cddb_043d_a6ce_f911e2845e1c
  style 52c32634_36a9_cf7b_cb3e_b809636e8a93 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/compiler/optimizer.ts lines 103–122

function isStatic(node: ASTNode): boolean {
  if (node.type === 2) {
    // expression
    return false
  }
  if (node.type === 3) {
    // text
    return true
  }
  return !!(
    node.pre ||
    (!node.hasBindings && // no dynamic bindings
      !node.if &&
      !node.for && // not v-if or v-for or v-else
      !isBuiltInTag(node.tag) && // not a built-in
      isPlatformReservedTag(node.tag) && // not a component
      !isDirectChildOfTemplateFor(node) &&
      Object.keys(node).every(isStaticKey))
  )
}

Domain

Subdomains

Called By

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free