@vue/compiler-dom 3.4.30 → 3.4.32

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.4.30
2
+ * @vue/compiler-dom v3.4.32
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.4.30
2
+ * @vue/compiler-dom v3.4.32
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -430,12 +430,12 @@ var VueCompilerDOM = (function (exports) {
430
430
  loc: locStub
431
431
  };
432
432
  }
433
- function createCacheExpression(index, value, isVNode = false) {
433
+ function createCacheExpression(index, value, isVOnce = false) {
434
434
  return {
435
435
  type: 20,
436
436
  index,
437
437
  value,
438
- isVNode,
438
+ isVOnce,
439
439
  loc: locStub
440
440
  };
441
441
  }
@@ -2753,7 +2753,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
2753
2753
  const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
2754
2754
  if (constantType > 0) {
2755
2755
  if (constantType >= 2) {
2756
- child.codegenNode.patchFlag = -1 + (` /* HOISTED */` );
2756
+ child.codegenNode.patchFlag = -1;
2757
2757
  child.codegenNode = context.hoist(child.codegenNode);
2758
2758
  hoistedCount++;
2759
2759
  continue;
@@ -2761,8 +2761,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
2761
2761
  } else {
2762
2762
  const codegenNode = child.codegenNode;
2763
2763
  if (codegenNode.type === 13) {
2764
- const flag = getPatchFlag(codegenNode);
2765
- if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) {
2764
+ const flag = codegenNode.patchFlag;
2765
+ if ((flag === void 0 || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) {
2766
2766
  const props = getNodeProps(child);
2767
2767
  if (props) {
2768
2768
  codegenNode.props = context.hoist(props);
@@ -2826,8 +2826,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
2826
2826
  if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject" && node.tag !== "math") {
2827
2827
  return 0;
2828
2828
  }
2829
- const flag = getPatchFlag(codegenNode);
2830
- if (!flag) {
2829
+ if (codegenNode.patchFlag === void 0) {
2831
2830
  let returnType2 = 3;
2832
2831
  const generatedPropsType = getGeneratedPropsConstantType(node, context);
2833
2832
  if (generatedPropsType === 0) {
@@ -2969,10 +2968,6 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
2969
2968
  return codegenNode.props;
2970
2969
  }
2971
2970
  }
2972
- function getPatchFlag(node) {
2973
- const flag = node.patchFlag;
2974
- return flag ? parseInt(flag, 10) : void 0;
2975
- }
2976
2971
 
2977
2972
  function createTransformContext(root, {
2978
2973
  filename = "",
@@ -3170,7 +3165,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
3170
3165
  helper(FRAGMENT),
3171
3166
  void 0,
3172
3167
  root.children,
3173
- patchFlag + (` /* ${patchFlagText} */` ),
3168
+ patchFlag,
3174
3169
  void 0,
3175
3170
  void 0,
3176
3171
  true,
@@ -3663,6 +3658,17 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
3663
3658
  disableTracking,
3664
3659
  isComponent
3665
3660
  } = node;
3661
+ let patchFlagString;
3662
+ if (patchFlag) {
3663
+ {
3664
+ if (patchFlag < 0) {
3665
+ patchFlagString = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`;
3666
+ } else {
3667
+ const flagNames = Object.keys(PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => PatchFlagNames[n]).join(`, `);
3668
+ patchFlagString = patchFlag + ` /* ${flagNames} */`;
3669
+ }
3670
+ }
3671
+ }
3666
3672
  if (directives) {
3667
3673
  push(helper(WITH_DIRECTIVES) + `(`);
3668
3674
  }
@@ -3675,7 +3681,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
3675
3681
  const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent);
3676
3682
  push(helper(callHelper) + `(`, -2 /* None */, node);
3677
3683
  genNodeList(
3678
- genNullableArgs([tag, props, children, patchFlag, dynamicProps]),
3684
+ genNullableArgs([tag, props, children, patchFlagString, dynamicProps]),
3679
3685
  context
3680
3686
  );
3681
3687
  push(`)`);
@@ -3809,15 +3815,16 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
3809
3815
  function genCacheExpression(node, context) {
3810
3816
  const { push, helper, indent, deindent, newline } = context;
3811
3817
  push(`_cache[${node.index}] || (`);
3812
- if (node.isVNode) {
3818
+ if (node.isVOnce) {
3813
3819
  indent();
3814
3820
  push(`${helper(SET_BLOCK_TRACKING)}(-1),`);
3815
3821
  newline();
3822
+ push(`(`);
3816
3823
  }
3817
3824
  push(`_cache[${node.index}] = `);
3818
3825
  genNode(node.value, context);
3819
- if (node.isVNode) {
3820
- push(`,`);
3826
+ if (node.isVOnce) {
3827
+ push(`).cacheIndex = ${node.index},`);
3821
3828
  newline();
3822
3829
  push(`${helper(SET_BLOCK_TRACKING)}(1),`);
3823
3830
  newline();
@@ -4070,7 +4077,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
4070
4077
  helper(FRAGMENT),
4071
4078
  createObjectExpression([keyProperty]),
4072
4079
  children,
4073
- patchFlag + (` /* ${patchFlagText} */` ),
4080
+ patchFlag,
4074
4081
  void 0,
4075
4082
  void 0,
4076
4083
  true,
@@ -4220,7 +4227,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
4220
4227
  helper(FRAGMENT),
4221
4228
  void 0,
4222
4229
  renderExp,
4223
- fragmentFlag + (` /* ${PatchFlagNames[fragmentFlag]} */` ),
4230
+ fragmentFlag,
4224
4231
  void 0,
4225
4232
  void 0,
4226
4233
  true,
@@ -4260,7 +4267,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
4260
4267
  helper(FRAGMENT),
4261
4268
  keyProperty ? createObjectExpression([keyProperty]) : void 0,
4262
4269
  node.children,
4263
- 64 + (` /* ${PatchFlagNames[64]} */` ),
4270
+ 64,
4264
4271
  void 0,
4265
4272
  void 0,
4266
4273
  true,
@@ -4687,7 +4694,6 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
4687
4694
  const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;
4688
4695
  let vnodeProps;
4689
4696
  let vnodeChildren;
4690
- let vnodePatchFlag;
4691
4697
  let patchFlag = 0;
4692
4698
  let vnodeDynamicProps;
4693
4699
  let dynamicPropNames;
@@ -4758,25 +4764,15 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
4758
4764
  vnodeChildren = node.children;
4759
4765
  }
4760
4766
  }
4761
- if (patchFlag !== 0) {
4762
- {
4763
- if (patchFlag < 0) {
4764
- vnodePatchFlag = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`;
4765
- } else {
4766
- const flagNames = Object.keys(PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => PatchFlagNames[n]).join(`, `);
4767
- vnodePatchFlag = patchFlag + ` /* ${flagNames} */`;
4768
- }
4769
- }
4770
- if (dynamicPropNames && dynamicPropNames.length) {
4771
- vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
4772
- }
4767
+ if (dynamicPropNames && dynamicPropNames.length) {
4768
+ vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
4773
4769
  }
4774
4770
  node.codegenNode = createVNodeCall(
4775
4771
  context,
4776
4772
  vnodeTag,
4777
4773
  vnodeProps,
4778
4774
  vnodeChildren,
4779
- vnodePatchFlag,
4775
+ patchFlag === 0 ? void 0 : patchFlag,
4780
4776
  vnodeDynamicProps,
4781
4777
  vnodeDirectives,
4782
4778
  !!shouldUseBlock,