@vue/compiler-core 3.5.18 → 3.5.19

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-core v3.5.18
2
+ * @vue/compiler-core v3.5.19
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -3077,7 +3077,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
3077
3077
  }
3078
3078
  }
3079
3079
  let cachedAsArray = false;
3080
- const slotCacheKeys = [];
3081
3080
  if (toCache.length === children.length && node.type === 1) {
3082
3081
  if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && shared.isArray(node.codegenNode.children)) {
3083
3082
  node.codegenNode.children = getCacheExpression(
@@ -3087,7 +3086,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
3087
3086
  } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !shared.isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
3088
3087
  const slot = getSlotNode(node.codegenNode, "default");
3089
3088
  if (slot) {
3090
- slotCacheKeys.push(context.cached.length);
3091
3089
  slot.returns = getCacheExpression(
3092
3090
  createArrayExpression(slot.returns)
3093
3091
  );
@@ -3097,7 +3095,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
3097
3095
  const slotName = findDir(node, "slot", true);
3098
3096
  const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
3099
3097
  if (slot) {
3100
- slotCacheKeys.push(context.cached.length);
3101
3098
  slot.returns = getCacheExpression(
3102
3099
  createArrayExpression(slot.returns)
3103
3100
  );
@@ -3107,23 +3104,12 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
3107
3104
  }
3108
3105
  if (!cachedAsArray) {
3109
3106
  for (const child of toCache) {
3110
- slotCacheKeys.push(context.cached.length);
3111
3107
  child.codegenNode = context.cache(child.codegenNode);
3112
3108
  }
3113
3109
  }
3114
- if (slotCacheKeys.length && node.type === 1 && node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !shared.isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
3115
- node.codegenNode.children.properties.push(
3116
- createObjectProperty(
3117
- `__`,
3118
- createSimpleExpression(JSON.stringify(slotCacheKeys), false)
3119
- )
3120
- );
3121
- }
3122
3110
  function getCacheExpression(value) {
3123
3111
  const exp = context.cache(value);
3124
- if (inFor && context.hmr) {
3125
- exp.needArraySpread = true;
3126
- }
3112
+ exp.needArraySpread = true;
3127
3113
  return exp;
3128
3114
  }
3129
3115
  function getSlotNode(node2, name) {
@@ -4703,7 +4689,7 @@ function processIf(node, dir, context, processCodegen) {
4703
4689
  continue;
4704
4690
  }
4705
4691
  if (sibling && sibling.type === 9) {
4706
- if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) {
4692
+ if ((dir.name === "else-if" || dir.name === "else") && sibling.branches[sibling.branches.length - 1].condition === void 0) {
4707
4693
  context.onError(
4708
4694
  createCompilerError(30, node.loc)
4709
4695
  );
@@ -6597,7 +6583,7 @@ const seen = /* @__PURE__ */ new WeakSet();
6597
6583
  const transformMemo = (node, context) => {
6598
6584
  if (node.type === 1) {
6599
6585
  const dir = findDir(node, "memo");
6600
- if (!dir || seen.has(node)) {
6586
+ if (!dir || seen.has(node) || context.inSSR) {
6601
6587
  return;
6602
6588
  }
6603
6589
  seen.add(node);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.5.18
2
+ * @vue/compiler-core v3.5.19
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -3036,7 +3036,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
3036
3036
  }
3037
3037
  }
3038
3038
  let cachedAsArray = false;
3039
- const slotCacheKeys = [];
3040
3039
  if (toCache.length === children.length && node.type === 1) {
3041
3040
  if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && shared.isArray(node.codegenNode.children)) {
3042
3041
  node.codegenNode.children = getCacheExpression(
@@ -3046,7 +3045,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
3046
3045
  } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !shared.isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
3047
3046
  const slot = getSlotNode(node.codegenNode, "default");
3048
3047
  if (slot) {
3049
- slotCacheKeys.push(context.cached.length);
3050
3048
  slot.returns = getCacheExpression(
3051
3049
  createArrayExpression(slot.returns)
3052
3050
  );
@@ -3056,7 +3054,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
3056
3054
  const slotName = findDir(node, "slot", true);
3057
3055
  const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
3058
3056
  if (slot) {
3059
- slotCacheKeys.push(context.cached.length);
3060
3057
  slot.returns = getCacheExpression(
3061
3058
  createArrayExpression(slot.returns)
3062
3059
  );
@@ -3066,23 +3063,12 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
3066
3063
  }
3067
3064
  if (!cachedAsArray) {
3068
3065
  for (const child of toCache) {
3069
- slotCacheKeys.push(context.cached.length);
3070
3066
  child.codegenNode = context.cache(child.codegenNode);
3071
3067
  }
3072
3068
  }
3073
- if (slotCacheKeys.length && node.type === 1 && node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !shared.isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
3074
- node.codegenNode.children.properties.push(
3075
- createObjectProperty(
3076
- `__`,
3077
- createSimpleExpression(JSON.stringify(slotCacheKeys), false)
3078
- )
3079
- );
3080
- }
3081
3069
  function getCacheExpression(value) {
3082
3070
  const exp = context.cache(value);
3083
- if (inFor && context.hmr) {
3084
- exp.needArraySpread = true;
3085
- }
3071
+ exp.needArraySpread = true;
3086
3072
  return exp;
3087
3073
  }
3088
3074
  function getSlotNode(node2, name) {
@@ -4625,7 +4611,7 @@ function processIf(node, dir, context, processCodegen) {
4625
4611
  continue;
4626
4612
  }
4627
4613
  if (sibling && sibling.type === 9) {
4628
- if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) {
4614
+ if ((dir.name === "else-if" || dir.name === "else") && sibling.branches[sibling.branches.length - 1].condition === void 0) {
4629
4615
  context.onError(
4630
4616
  createCompilerError(30, node.loc)
4631
4617
  );
@@ -6474,7 +6460,7 @@ const seen = /* @__PURE__ */ new WeakSet();
6474
6460
  const transformMemo = (node, context) => {
6475
6461
  if (node.type === 1) {
6476
6462
  const dir = findDir(node, "memo");
6477
- if (!dir || seen.has(node)) {
6463
+ if (!dir || seen.has(node) || context.inSSR) {
6478
6464
  return;
6479
6465
  }
6480
6466
  seen.add(node);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.5.18
2
+ * @vue/compiler-core v3.5.19
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2737,7 +2737,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
2737
2737
  }
2738
2738
  }
2739
2739
  let cachedAsArray = false;
2740
- const slotCacheKeys = [];
2741
2740
  if (toCache.length === children.length && node.type === 1) {
2742
2741
  if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
2743
2742
  node.codegenNode.children = getCacheExpression(
@@ -2747,7 +2746,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
2747
2746
  } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
2748
2747
  const slot = getSlotNode(node.codegenNode, "default");
2749
2748
  if (slot) {
2750
- slotCacheKeys.push(context.cached.length);
2751
2749
  slot.returns = getCacheExpression(
2752
2750
  createArrayExpression(slot.returns)
2753
2751
  );
@@ -2757,7 +2755,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
2757
2755
  const slotName = findDir(node, "slot", true);
2758
2756
  const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
2759
2757
  if (slot) {
2760
- slotCacheKeys.push(context.cached.length);
2761
2758
  slot.returns = getCacheExpression(
2762
2759
  createArrayExpression(slot.returns)
2763
2760
  );
@@ -2767,23 +2764,12 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
2767
2764
  }
2768
2765
  if (!cachedAsArray) {
2769
2766
  for (const child of toCache) {
2770
- slotCacheKeys.push(context.cached.length);
2771
2767
  child.codegenNode = context.cache(child.codegenNode);
2772
2768
  }
2773
2769
  }
2774
- 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) {
2775
- node.codegenNode.children.properties.push(
2776
- createObjectProperty(
2777
- `__`,
2778
- createSimpleExpression(JSON.stringify(slotCacheKeys), false)
2779
- )
2780
- );
2781
- }
2782
2770
  function getCacheExpression(value) {
2783
2771
  const exp = context.cache(value);
2784
- if (inFor && context.hmr) {
2785
- exp.needArraySpread = true;
2786
- }
2772
+ exp.needArraySpread = true;
2787
2773
  return exp;
2788
2774
  }
2789
2775
  function getSlotNode(node2, name) {
@@ -3991,7 +3977,7 @@ function processIf(node, dir, context, processCodegen) {
3991
3977
  continue;
3992
3978
  }
3993
3979
  if (sibling && sibling.type === 9) {
3994
- if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) {
3980
+ if ((dir.name === "else-if" || dir.name === "else") && sibling.branches[sibling.branches.length - 1].condition === void 0) {
3995
3981
  context.onError(
3996
3982
  createCompilerError(30, node.loc)
3997
3983
  );
@@ -5708,7 +5694,7 @@ const seen = /* @__PURE__ */ new WeakSet();
5708
5694
  const transformMemo = (node, context) => {
5709
5695
  if (node.type === 1) {
5710
5696
  const dir = findDir(node, "memo");
5711
- if (!dir || seen.has(node)) {
5697
+ if (!dir || seen.has(node) || context.inSSR) {
5712
5698
  return;
5713
5699
  }
5714
5700
  seen.add(node);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-core",
3
- "version": "3.5.18",
3
+ "version": "3.5.19",
4
4
  "description": "@vue/compiler-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/compiler-core.esm-bundler.js",
@@ -46,13 +46,13 @@
46
46
  },
47
47
  "homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
48
48
  "dependencies": {
49
- "@babel/parser": "^7.28.0",
49
+ "@babel/parser": "^7.28.3",
50
50
  "entities": "^4.5.0",
51
51
  "estree-walker": "^2.0.2",
52
52
  "source-map-js": "^1.2.1",
53
- "@vue/shared": "3.5.18"
53
+ "@vue/shared": "3.5.19"
54
54
  },
55
55
  "devDependencies": {
56
- "@babel/types": "^7.28.1"
56
+ "@babel/types": "^7.28.2"
57
57
  }
58
58
  }