@vue/compiler-dom
Advanced tools
Comparing version 3.5.0-alpha.2 to 3.5.0-alpha.3
/** | ||
* @vue/compiler-dom v3.5.0-alpha.2 | ||
* @vue/compiler-dom v3.5.0-alpha.3 | ||
* (c) 2018-present Yuxi (Evan) You and Vue contributors | ||
@@ -352,4 +352,3 @@ * @license MIT | ||
const { modifiers } = dir; | ||
if (!modifiers.length) | ||
return baseResult; | ||
if (!modifiers.length) return baseResult; | ||
let { key, value: handlerExp } = baseResult.props[0]; | ||
@@ -450,2 +449,3 @@ const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc); | ||
} | ||
const isParentCached = parent.type === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !shared.isArray(parent.codegenNode.children) && parent.codegenNode.children.type === 20; | ||
let nc = 0; | ||
@@ -464,10 +464,21 @@ let ec = 0; | ||
]); | ||
replaceHoist(currentChunk[0], staticCall, context); | ||
if (currentChunk.length > 1) { | ||
for (let i2 = 1; i2 < currentChunk.length; i2++) { | ||
replaceHoist(currentChunk[i2], null, context); | ||
if (isParentCached) { | ||
parent.codegenNode.children.value = compilerCore.createArrayExpression([staticCall]); | ||
} else { | ||
currentChunk[0].codegenNode.value = staticCall; | ||
if (currentChunk.length > 1) { | ||
const deleteCount = currentChunk.length - 1; | ||
children.splice(currentIndex - currentChunk.length + 1, deleteCount); | ||
const cacheIndex = context.cached.indexOf( | ||
currentChunk[currentChunk.length - 1].codegenNode | ||
); | ||
if (cacheIndex > -1) { | ||
for (let i2 = cacheIndex; i2 < context.cached.length; i2++) { | ||
const c = context.cached[i2]; | ||
if (c) c.index -= deleteCount; | ||
} | ||
context.cached.splice(cacheIndex - deleteCount + 1, deleteCount); | ||
} | ||
return deleteCount; | ||
} | ||
const deleteCount = currentChunk.length - 1; | ||
children.splice(currentIndex - currentChunk.length + 1, deleteCount); | ||
return deleteCount; | ||
} | ||
@@ -480,10 +491,9 @@ } | ||
const child = children[i]; | ||
const hoisted = getHoistedNode(child); | ||
if (hoisted) { | ||
const node = child; | ||
const result = analyzeNode(node); | ||
const isCached = isParentCached || getCachedNode(child); | ||
if (isCached) { | ||
const result = analyzeNode(child); | ||
if (result) { | ||
nc += result[0]; | ||
ec += result[1]; | ||
currentChunk.push(node); | ||
currentChunk.push(child); | ||
continue; | ||
@@ -499,3 +509,7 @@ } | ||
}; | ||
const getHoistedNode = (node) => (node.type === 1 && node.tagType === 0 || node.type == 12) && node.codegenNode && node.codegenNode.type === 4 && node.codegenNode.hoisted; | ||
const getCachedNode = (node) => { | ||
if ((node.type === 1 && node.tagType === 0 || node.type === 12) && node.codegenNode && node.codegenNode.type === 20) { | ||
return node.codegenNode; | ||
} | ||
}; | ||
const dataAriaRE = /^(data|aria)-/; | ||
@@ -505,6 +519,2 @@ const isStringifiableAttr = (name, ns) => { | ||
}; | ||
const replaceHoist = (node, replacement, context) => { | ||
const hoistToReplace = node.codegenNode.hoisted; | ||
context.hoists[context.hoists.indexOf(hoistToReplace)] = replacement; | ||
}; | ||
const isNonStringifiable = /* @__PURE__ */ shared.makeMap( | ||
@@ -528,2 +538,3 @@ `caption,thead,tr,th,tbody,td,tfoot,colgroup,col` | ||
function walk(node2) { | ||
const isOptionTag = node2.tag === "option" && node2.ns === 0; | ||
for (let i = 0; i < node2.props.length; i++) { | ||
@@ -541,2 +552,5 @@ const p = node2.props[i]; | ||
} | ||
if (isOptionTag && compilerCore.isStaticArgOf(p.arg, "value") && p.exp && p.exp.ast && p.exp.ast.type !== "StringLiteral") { | ||
return bail(); | ||
} | ||
} | ||
@@ -683,8 +697,6 @@ } | ||
if (parent in knownInvalidChildren) { | ||
if (knownInvalidChildren[parent].has(child)) | ||
return false; | ||
if (knownInvalidChildren[parent].has(child)) return false; | ||
} | ||
if (child in knownInvalidParents) { | ||
if (knownInvalidParents[child].has(parent)) | ||
return false; | ||
if (knownInvalidParents[child].has(parent)) return false; | ||
} | ||
@@ -691,0 +703,0 @@ return true; |
/** | ||
* @vue/compiler-dom v3.5.0-alpha.2 | ||
* @vue/compiler-dom v3.5.0-alpha.3 | ||
* (c) 2018-present Yuxi (Evan) You and Vue contributors | ||
@@ -334,4 +334,3 @@ * @license MIT | ||
const { modifiers } = dir; | ||
if (!modifiers.length) | ||
return baseResult; | ||
if (!modifiers.length) return baseResult; | ||
let { key, value: handlerExp } = baseResult.props[0]; | ||
@@ -386,2 +385,3 @@ const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc); | ||
} | ||
const isParentCached = parent.type === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !shared.isArray(parent.codegenNode.children) && parent.codegenNode.children.type === 20; | ||
let nc = 0; | ||
@@ -400,10 +400,21 @@ let ec = 0; | ||
]); | ||
replaceHoist(currentChunk[0], staticCall, context); | ||
if (currentChunk.length > 1) { | ||
for (let i2 = 1; i2 < currentChunk.length; i2++) { | ||
replaceHoist(currentChunk[i2], null, context); | ||
if (isParentCached) { | ||
parent.codegenNode.children.value = compilerCore.createArrayExpression([staticCall]); | ||
} else { | ||
currentChunk[0].codegenNode.value = staticCall; | ||
if (currentChunk.length > 1) { | ||
const deleteCount = currentChunk.length - 1; | ||
children.splice(currentIndex - currentChunk.length + 1, deleteCount); | ||
const cacheIndex = context.cached.indexOf( | ||
currentChunk[currentChunk.length - 1].codegenNode | ||
); | ||
if (cacheIndex > -1) { | ||
for (let i2 = cacheIndex; i2 < context.cached.length; i2++) { | ||
const c = context.cached[i2]; | ||
if (c) c.index -= deleteCount; | ||
} | ||
context.cached.splice(cacheIndex - deleteCount + 1, deleteCount); | ||
} | ||
return deleteCount; | ||
} | ||
const deleteCount = currentChunk.length - 1; | ||
children.splice(currentIndex - currentChunk.length + 1, deleteCount); | ||
return deleteCount; | ||
} | ||
@@ -416,10 +427,9 @@ } | ||
const child = children[i]; | ||
const hoisted = getHoistedNode(child); | ||
if (hoisted) { | ||
const node = child; | ||
const result = analyzeNode(node); | ||
const isCached = isParentCached || getCachedNode(child); | ||
if (isCached) { | ||
const result = analyzeNode(child); | ||
if (result) { | ||
nc += result[0]; | ||
ec += result[1]; | ||
currentChunk.push(node); | ||
currentChunk.push(child); | ||
continue; | ||
@@ -435,3 +445,7 @@ } | ||
}; | ||
const getHoistedNode = (node) => (node.type === 1 && node.tagType === 0 || node.type == 12) && node.codegenNode && node.codegenNode.type === 4 && node.codegenNode.hoisted; | ||
const getCachedNode = (node) => { | ||
if ((node.type === 1 && node.tagType === 0 || node.type === 12) && node.codegenNode && node.codegenNode.type === 20) { | ||
return node.codegenNode; | ||
} | ||
}; | ||
const dataAriaRE = /^(data|aria)-/; | ||
@@ -441,6 +455,2 @@ const isStringifiableAttr = (name, ns) => { | ||
}; | ||
const replaceHoist = (node, replacement, context) => { | ||
const hoistToReplace = node.codegenNode.hoisted; | ||
context.hoists[context.hoists.indexOf(hoistToReplace)] = replacement; | ||
}; | ||
const isNonStringifiable = /* @__PURE__ */ shared.makeMap( | ||
@@ -464,2 +474,3 @@ `caption,thead,tr,th,tbody,td,tfoot,colgroup,col` | ||
function walk(node2) { | ||
const isOptionTag = node2.tag === "option" && node2.ns === 0; | ||
for (let i = 0; i < node2.props.length; i++) { | ||
@@ -477,2 +488,5 @@ const p = node2.props[i]; | ||
} | ||
if (isOptionTag && compilerCore.isStaticArgOf(p.arg, "value") && p.exp && p.exp.ast && p.exp.ast.type !== "StringLiteral") { | ||
return bail(); | ||
} | ||
} | ||
@@ -479,0 +493,0 @@ } |
/** | ||
* @vue/compiler-dom v3.5.0-alpha.2 | ||
* @vue/compiler-dom v3.5.0-alpha.3 | ||
* (c) 2018-present Yuxi (Evan) You and Vue contributors | ||
@@ -363,4 +363,3 @@ * @license MIT | ||
const { modifiers } = dir; | ||
if (!modifiers.length) | ||
return baseResult; | ||
if (!modifiers.length) return baseResult; | ||
let { key, value: handlerExp } = baseResult.props[0]; | ||
@@ -476,8 +475,6 @@ const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc); | ||
if (parent in knownInvalidChildren) { | ||
if (knownInvalidChildren[parent].has(child)) | ||
return false; | ||
if (knownInvalidChildren[parent].has(child)) return false; | ||
} | ||
if (child in knownInvalidParents) { | ||
if (knownInvalidParents[child].has(parent)) | ||
return false; | ||
if (knownInvalidParents[child].has(parent)) return false; | ||
} | ||
@@ -484,0 +481,0 @@ return true; |
{ | ||
"name": "@vue/compiler-dom", | ||
"version": "3.5.0-alpha.2", | ||
"version": "3.5.0-alpha.3", | ||
"description": "@vue/compiler-dom", | ||
@@ -54,5 +54,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"@vue/shared": "3.5.0-alpha.2", | ||
"@vue/compiler-core": "3.5.0-alpha.2" | ||
"@vue/shared": "3.5.0-alpha.3", | ||
"@vue/compiler-core": "3.5.0-alpha.3" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
634188
15996
+ Added@vue/compiler-core@3.5.0-alpha.3(transitive)
+ Added@vue/shared@3.5.0-alpha.3(transitive)
- Removed@vue/compiler-core@3.5.0-alpha.2(transitive)
- Removed@vue/shared@3.5.0-alpha.2(transitive)
Updated@vue/shared@3.5.0-alpha.3