markStatic() — vue Function Reference
Architecture documentation for the markStatic() function in optimizer.ts from the vue codebase.
Entity Profile
Dependency Diagram
graph TD 18126178_83e0_0b6d_addc_14cbe5457ac9["markStatic()"] 47a275bd_2581_aeff_9124_e9298610ab3f["optimize()"] 47a275bd_2581_aeff_9124_e9298610ab3f -->|calls| 18126178_83e0_0b6d_addc_14cbe5457ac9 1d58f861_680d_2954_a51b_ed19382bb3ee["isStatic()"] 18126178_83e0_0b6d_addc_14cbe5457ac9 -->|calls| 1d58f861_680d_2954_a51b_ed19382bb3ee style 18126178_83e0_0b6d_addc_14cbe5457ac9 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
Source
Frequently Asked Questions
What does markStatic() do?
markStatic() is a function in the vue codebase.
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