@vue/compiler-dom 3.5.13 → 3.5.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-dom v3.5.13
2
+ * @vue/compiler-dom v3.5.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -694,6 +694,9 @@ const ignoreSideEffectTags = (node, context) => {
694
694
  };
695
695
 
696
696
  function isValidHTMLNesting(parent, child) {
697
+ if (parent === "template") {
698
+ return true;
699
+ }
697
700
  if (parent in onlyValidChildren) {
698
701
  return onlyValidChildren[parent].has(child);
699
702
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-dom v3.5.13
2
+ * @vue/compiler-dom v3.5.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-dom v3.5.13
2
+ * @vue/compiler-dom v3.5.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1669,7 +1669,7 @@ function isForStatement(stmt) {
1669
1669
  }
1670
1670
  function walkForStatement(stmt, isVar, onIdent) {
1671
1671
  const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
1672
- if (variable && variable.type === "VariableDeclaration" && (variable.kind === "var" ? isVar : !isVar)) {
1672
+ if (variable && variable.type === "VariableDeclaration" && (variable.kind === "var" ? isVar : false)) {
1673
1673
  for (const decl of variable.declarations) {
1674
1674
  for (const id of extractIdentifiers(decl.id)) {
1675
1675
  onIdent(id);
@@ -2286,7 +2286,7 @@ const tokenizer = new Tokenizer(stack, {
2286
2286
  "COMPILER_V_BIND_SYNC",
2287
2287
  currentOptions,
2288
2288
  currentProp.loc,
2289
- currentProp.rawName
2289
+ currentProp.arg.loc.source
2290
2290
  )) {
2291
2291
  currentProp.name = "model";
2292
2292
  currentProp.modifiers.splice(syncIndex, 1);
@@ -2862,6 +2862,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
2862
2862
  }
2863
2863
  }
2864
2864
  let cachedAsArray = false;
2865
+ const slotCacheKeys = [];
2865
2866
  if (toCache.length === children.length && node.type === 1) {
2866
2867
  if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
2867
2868
  node.codegenNode.children = getCacheExpression(
@@ -2871,6 +2872,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
2871
2872
  } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
2872
2873
  const slot = getSlotNode(node.codegenNode, "default");
2873
2874
  if (slot) {
2875
+ slotCacheKeys.push(context.cached.length);
2874
2876
  slot.returns = getCacheExpression(
2875
2877
  createArrayExpression(slot.returns)
2876
2878
  );
@@ -2880,6 +2882,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
2880
2882
  const slotName = findDir(node, "slot", true);
2881
2883
  const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
2882
2884
  if (slot) {
2885
+ slotCacheKeys.push(context.cached.length);
2883
2886
  slot.returns = getCacheExpression(
2884
2887
  createArrayExpression(slot.returns)
2885
2888
  );
@@ -2889,9 +2892,18 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
2889
2892
  }
2890
2893
  if (!cachedAsArray) {
2891
2894
  for (const child of toCache) {
2895
+ slotCacheKeys.push(context.cached.length);
2892
2896
  child.codegenNode = context.cache(child.codegenNode);
2893
2897
  }
2894
2898
  }
2899
+ if (slotCacheKeys.length && node.type === 1 && node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
2900
+ node.codegenNode.children.properties.push(
2901
+ createObjectProperty(
2902
+ `__`,
2903
+ createSimpleExpression(JSON.stringify(slotCacheKeys), false)
2904
+ )
2905
+ );
2906
+ }
2895
2907
  function getCacheExpression(value) {
2896
2908
  const exp = context.cache(value);
2897
2909
  if (inFor && context.hmr) {
@@ -5080,9 +5092,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
5080
5092
  hasDynamicKeys = true;
5081
5093
  if (exp) {
5082
5094
  if (isVBind) {
5083
- pushRefVForMarker();
5084
- pushMergeArg();
5085
5095
  {
5096
+ pushMergeArg();
5086
5097
  {
5087
5098
  const hasOverridableKeys = mergeArgs.some((arg2) => {
5088
5099
  if (arg2.type === 15) {
@@ -5112,6 +5123,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
5112
5123
  continue;
5113
5124
  }
5114
5125
  }
5126
+ pushRefVForMarker();
5127
+ pushMergeArg();
5115
5128
  mergeArgs.push(exp);
5116
5129
  } else {
5117
5130
  pushMergeArg({
@@ -5620,8 +5633,7 @@ const transformModel$1 = (dir, node, context) => {
5620
5633
  context.onError(createCompilerError(44, exp.loc));
5621
5634
  return createTransformProps();
5622
5635
  }
5623
- const maybeRef = false;
5624
- if (!expString.trim() || !isMemberExpression(exp) && !maybeRef) {
5636
+ if (!expString.trim() || !isMemberExpression(exp) && true) {
5625
5637
  context.onError(
5626
5638
  createCompilerError(42, exp.loc)
5627
5639
  );
@@ -6384,6 +6396,9 @@ const ignoreSideEffectTags = (node, context) => {
6384
6396
  };
6385
6397
 
6386
6398
  function isValidHTMLNesting(parent, child) {
6399
+ if (parent === "template") {
6400
+ return true;
6401
+ }
6387
6402
  if (parent in onlyValidChildren) {
6388
6403
  return onlyValidChildren[parent].has(child);
6389
6404
  }