@vue/compiler-core 3.5.17 → 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.17
2
+ * @vue/compiler-core v3.5.19
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1606,14 +1606,15 @@ function isReferencedIdentifier(id, parent, parentStack) {
1606
1606
  if (id.name === "arguments") {
1607
1607
  return false;
1608
1608
  }
1609
- if (isReferenced(id, parent)) {
1609
+ if (isReferenced(id, parent, parentStack[parentStack.length - 2])) {
1610
1610
  return true;
1611
1611
  }
1612
1612
  switch (parent.type) {
1613
1613
  case "AssignmentExpression":
1614
1614
  case "AssignmentPattern":
1615
1615
  return true;
1616
- case "ObjectPattern":
1616
+ case "ObjectProperty":
1617
+ return parent.key !== id && isInDestructureAssignment(parent, parentStack);
1617
1618
  case "ArrayPattern":
1618
1619
  return isInDestructureAssignment(parent, parentStack);
1619
1620
  }
@@ -1782,7 +1783,7 @@ function isReferenced(node, parent, grandparent) {
1782
1783
  if (parent.key === node) {
1783
1784
  return !!parent.computed;
1784
1785
  }
1785
- return true;
1786
+ return !grandparent || grandparent.type !== "ObjectPattern";
1786
1787
  // no: class { NODE = value; }
1787
1788
  // yes: class { [NODE] = value; }
1788
1789
  // yes: class { key = NODE; }
@@ -1832,6 +1833,9 @@ function isReferenced(node, parent, grandparent) {
1832
1833
  // yes: export { NODE as foo };
1833
1834
  // no: export { NODE as foo } from "foo";
1834
1835
  case "ExportSpecifier":
1836
+ if (grandparent == null ? void 0 : grandparent.source) {
1837
+ return false;
1838
+ }
1835
1839
  return parent.local === node;
1836
1840
  // no: import NODE from "foo";
1837
1841
  // no: import * as NODE from "foo";
@@ -1912,7 +1916,7 @@ function isCoreComponent(tag) {
1912
1916
  return BASE_TRANSITION;
1913
1917
  }
1914
1918
  }
1915
- const nonIdentifierRE = /^\d|[^\$\w\xA0-\uFFFF]/;
1919
+ const nonIdentifierRE = /^$|^\d|[^\$\w\xA0-\uFFFF]/;
1916
1920
  const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
1917
1921
  const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
1918
1922
  const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
@@ -2077,6 +2081,9 @@ function hasDynamicKeyVBind(node) {
2077
2081
  function isText$1(node) {
2078
2082
  return node.type === 5 || node.type === 2;
2079
2083
  }
2084
+ function isVPre(p) {
2085
+ return p.type === 7 && p.name === "pre";
2086
+ }
2080
2087
  function isVSlot(p) {
2081
2088
  return p.type === 7 && p.name === "slot";
2082
2089
  }
@@ -2375,7 +2382,7 @@ const tokenizer = new Tokenizer(stack, {
2375
2382
  ondirarg(start, end) {
2376
2383
  if (start === end) return;
2377
2384
  const arg = getSlice(start, end);
2378
- if (inVPre) {
2385
+ if (inVPre && !isVPre(currentProp)) {
2379
2386
  currentProp.name += arg;
2380
2387
  setLocEnd(currentProp.nameLoc, end);
2381
2388
  } else {
@@ -2390,7 +2397,7 @@ const tokenizer = new Tokenizer(stack, {
2390
2397
  },
2391
2398
  ondirmodifier(start, end) {
2392
2399
  const mod = getSlice(start, end);
2393
- if (inVPre) {
2400
+ if (inVPre && !isVPre(currentProp)) {
2394
2401
  currentProp.name += "." + mod;
2395
2402
  setLocEnd(currentProp.nameLoc, end);
2396
2403
  } else if (currentProp.name === "slot") {
@@ -3037,6 +3044,11 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
3037
3044
  } else if (child.type === 12) {
3038
3045
  const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
3039
3046
  if (constantType >= 2) {
3047
+ if (child.codegenNode.type === 14 && child.codegenNode.arguments.length > 0) {
3048
+ child.codegenNode.arguments.push(
3049
+ -1 + (` /* ${shared.PatchFlagNames[-1]} */` )
3050
+ );
3051
+ }
3040
3052
  toCache.push(child);
3041
3053
  continue;
3042
3054
  }
@@ -3065,7 +3077,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
3065
3077
  }
3066
3078
  }
3067
3079
  let cachedAsArray = false;
3068
- const slotCacheKeys = [];
3069
3080
  if (toCache.length === children.length && node.type === 1) {
3070
3081
  if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && shared.isArray(node.codegenNode.children)) {
3071
3082
  node.codegenNode.children = getCacheExpression(
@@ -3075,7 +3086,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
3075
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) {
3076
3087
  const slot = getSlotNode(node.codegenNode, "default");
3077
3088
  if (slot) {
3078
- slotCacheKeys.push(context.cached.length);
3079
3089
  slot.returns = getCacheExpression(
3080
3090
  createArrayExpression(slot.returns)
3081
3091
  );
@@ -3085,7 +3095,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
3085
3095
  const slotName = findDir(node, "slot", true);
3086
3096
  const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
3087
3097
  if (slot) {
3088
- slotCacheKeys.push(context.cached.length);
3089
3098
  slot.returns = getCacheExpression(
3090
3099
  createArrayExpression(slot.returns)
3091
3100
  );
@@ -3095,23 +3104,12 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
3095
3104
  }
3096
3105
  if (!cachedAsArray) {
3097
3106
  for (const child of toCache) {
3098
- slotCacheKeys.push(context.cached.length);
3099
3107
  child.codegenNode = context.cache(child.codegenNode);
3100
3108
  }
3101
3109
  }
3102
- 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) {
3103
- node.codegenNode.children.properties.push(
3104
- createObjectProperty(
3105
- `__`,
3106
- createSimpleExpression(JSON.stringify(slotCacheKeys), false)
3107
- )
3108
- );
3109
- }
3110
3110
  function getCacheExpression(value) {
3111
3111
  const exp = context.cache(value);
3112
- if (inFor && context.hmr) {
3113
- exp.needArraySpread = true;
3114
- }
3112
+ exp.needArraySpread = true;
3115
3113
  return exp;
3116
3114
  }
3117
3115
  function getSlotNode(node2, name) {
@@ -4691,7 +4689,7 @@ function processIf(node, dir, context, processCodegen) {
4691
4689
  continue;
4692
4690
  }
4693
4691
  if (sibling && sibling.type === 9) {
4694
- 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) {
4695
4693
  context.onError(
4696
4694
  createCompilerError(30, node.loc)
4697
4695
  );
@@ -4877,7 +4875,7 @@ const transformBind = (dir, _node, context) => {
4877
4875
  arg.children.unshift(`(`);
4878
4876
  arg.children.push(`) || ""`);
4879
4877
  } else if (!arg.isStatic) {
4880
- arg.content = `${arg.content} || ""`;
4878
+ arg.content = arg.content ? `${arg.content} || ""` : `""`;
4881
4879
  }
4882
4880
  if (modifiers.some((mod) => mod.content === "camel")) {
4883
4881
  if (arg.type === 4) {
@@ -6585,7 +6583,7 @@ const seen = /* @__PURE__ */ new WeakSet();
6585
6583
  const transformMemo = (node, context) => {
6586
6584
  if (node.type === 1) {
6587
6585
  const dir = findDir(node, "memo");
6588
- if (!dir || seen.has(node)) {
6586
+ if (!dir || seen.has(node) || context.inSSR) {
6589
6587
  return;
6590
6588
  }
6591
6589
  seen.add(node);
@@ -6801,6 +6799,7 @@ exports.isStaticProperty = isStaticProperty;
6801
6799
  exports.isStaticPropertyKey = isStaticPropertyKey;
6802
6800
  exports.isTemplateNode = isTemplateNode;
6803
6801
  exports.isText = isText$1;
6802
+ exports.isVPre = isVPre;
6804
6803
  exports.isVSlot = isVSlot;
6805
6804
  exports.locStub = locStub;
6806
6805
  exports.noopDirectiveTransform = noopDirectiveTransform;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.5.17
2
+ * @vue/compiler-core v3.5.19
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1602,14 +1602,15 @@ function isReferencedIdentifier(id, parent, parentStack) {
1602
1602
  if (id.name === "arguments") {
1603
1603
  return false;
1604
1604
  }
1605
- if (isReferenced(id, parent)) {
1605
+ if (isReferenced(id, parent, parentStack[parentStack.length - 2])) {
1606
1606
  return true;
1607
1607
  }
1608
1608
  switch (parent.type) {
1609
1609
  case "AssignmentExpression":
1610
1610
  case "AssignmentPattern":
1611
1611
  return true;
1612
- case "ObjectPattern":
1612
+ case "ObjectProperty":
1613
+ return parent.key !== id && isInDestructureAssignment(parent, parentStack);
1613
1614
  case "ArrayPattern":
1614
1615
  return isInDestructureAssignment(parent, parentStack);
1615
1616
  }
@@ -1778,7 +1779,7 @@ function isReferenced(node, parent, grandparent) {
1778
1779
  if (parent.key === node) {
1779
1780
  return !!parent.computed;
1780
1781
  }
1781
- return true;
1782
+ return !grandparent || grandparent.type !== "ObjectPattern";
1782
1783
  // no: class { NODE = value; }
1783
1784
  // yes: class { [NODE] = value; }
1784
1785
  // yes: class { key = NODE; }
@@ -1828,6 +1829,9 @@ function isReferenced(node, parent, grandparent) {
1828
1829
  // yes: export { NODE as foo };
1829
1830
  // no: export { NODE as foo } from "foo";
1830
1831
  case "ExportSpecifier":
1832
+ if (grandparent == null ? void 0 : grandparent.source) {
1833
+ return false;
1834
+ }
1831
1835
  return parent.local === node;
1832
1836
  // no: import NODE from "foo";
1833
1837
  // no: import * as NODE from "foo";
@@ -1908,7 +1912,7 @@ function isCoreComponent(tag) {
1908
1912
  return BASE_TRANSITION;
1909
1913
  }
1910
1914
  }
1911
- const nonIdentifierRE = /^\d|[^\$\w\xA0-\uFFFF]/;
1915
+ const nonIdentifierRE = /^$|^\d|[^\$\w\xA0-\uFFFF]/;
1912
1916
  const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
1913
1917
  const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
1914
1918
  const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
@@ -2073,6 +2077,9 @@ function hasDynamicKeyVBind(node) {
2073
2077
  function isText$1(node) {
2074
2078
  return node.type === 5 || node.type === 2;
2075
2079
  }
2080
+ function isVPre(p) {
2081
+ return p.type === 7 && p.name === "pre";
2082
+ }
2076
2083
  function isVSlot(p) {
2077
2084
  return p.type === 7 && p.name === "slot";
2078
2085
  }
@@ -2371,7 +2378,7 @@ const tokenizer = new Tokenizer(stack, {
2371
2378
  ondirarg(start, end) {
2372
2379
  if (start === end) return;
2373
2380
  const arg = getSlice(start, end);
2374
- if (inVPre) {
2381
+ if (inVPre && !isVPre(currentProp)) {
2375
2382
  currentProp.name += arg;
2376
2383
  setLocEnd(currentProp.nameLoc, end);
2377
2384
  } else {
@@ -2386,7 +2393,7 @@ const tokenizer = new Tokenizer(stack, {
2386
2393
  },
2387
2394
  ondirmodifier(start, end) {
2388
2395
  const mod = getSlice(start, end);
2389
- if (inVPre) {
2396
+ if (inVPre && !isVPre(currentProp)) {
2390
2397
  currentProp.name += "." + mod;
2391
2398
  setLocEnd(currentProp.nameLoc, end);
2392
2399
  } else if (currentProp.name === "slot") {
@@ -2996,6 +3003,11 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
2996
3003
  } else if (child.type === 12) {
2997
3004
  const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
2998
3005
  if (constantType >= 2) {
3006
+ if (child.codegenNode.type === 14 && child.codegenNode.arguments.length > 0) {
3007
+ child.codegenNode.arguments.push(
3008
+ -1 + (``)
3009
+ );
3010
+ }
2999
3011
  toCache.push(child);
3000
3012
  continue;
3001
3013
  }
@@ -3024,7 +3036,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
3024
3036
  }
3025
3037
  }
3026
3038
  let cachedAsArray = false;
3027
- const slotCacheKeys = [];
3028
3039
  if (toCache.length === children.length && node.type === 1) {
3029
3040
  if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && shared.isArray(node.codegenNode.children)) {
3030
3041
  node.codegenNode.children = getCacheExpression(
@@ -3034,7 +3045,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
3034
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) {
3035
3046
  const slot = getSlotNode(node.codegenNode, "default");
3036
3047
  if (slot) {
3037
- slotCacheKeys.push(context.cached.length);
3038
3048
  slot.returns = getCacheExpression(
3039
3049
  createArrayExpression(slot.returns)
3040
3050
  );
@@ -3044,7 +3054,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
3044
3054
  const slotName = findDir(node, "slot", true);
3045
3055
  const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
3046
3056
  if (slot) {
3047
- slotCacheKeys.push(context.cached.length);
3048
3057
  slot.returns = getCacheExpression(
3049
3058
  createArrayExpression(slot.returns)
3050
3059
  );
@@ -3054,23 +3063,12 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
3054
3063
  }
3055
3064
  if (!cachedAsArray) {
3056
3065
  for (const child of toCache) {
3057
- slotCacheKeys.push(context.cached.length);
3058
3066
  child.codegenNode = context.cache(child.codegenNode);
3059
3067
  }
3060
3068
  }
3061
- 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) {
3062
- node.codegenNode.children.properties.push(
3063
- createObjectProperty(
3064
- `__`,
3065
- createSimpleExpression(JSON.stringify(slotCacheKeys), false)
3066
- )
3067
- );
3068
- }
3069
3069
  function getCacheExpression(value) {
3070
3070
  const exp = context.cache(value);
3071
- if (inFor && context.hmr) {
3072
- exp.needArraySpread = true;
3073
- }
3071
+ exp.needArraySpread = true;
3074
3072
  return exp;
3075
3073
  }
3076
3074
  function getSlotNode(node2, name) {
@@ -4613,7 +4611,7 @@ function processIf(node, dir, context, processCodegen) {
4613
4611
  continue;
4614
4612
  }
4615
4613
  if (sibling && sibling.type === 9) {
4616
- 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) {
4617
4615
  context.onError(
4618
4616
  createCompilerError(30, node.loc)
4619
4617
  );
@@ -4792,7 +4790,7 @@ const transformBind = (dir, _node, context) => {
4792
4790
  arg.children.unshift(`(`);
4793
4791
  arg.children.push(`) || ""`);
4794
4792
  } else if (!arg.isStatic) {
4795
- arg.content = `${arg.content} || ""`;
4793
+ arg.content = arg.content ? `${arg.content} || ""` : `""`;
4796
4794
  }
4797
4795
  if (modifiers.some((mod) => mod.content === "camel")) {
4798
4796
  if (arg.type === 4) {
@@ -6462,7 +6460,7 @@ const seen = /* @__PURE__ */ new WeakSet();
6462
6460
  const transformMemo = (node, context) => {
6463
6461
  if (node.type === 1) {
6464
6462
  const dir = findDir(node, "memo");
6465
- if (!dir || seen.has(node)) {
6463
+ if (!dir || seen.has(node) || context.inSSR) {
6466
6464
  return;
6467
6465
  }
6468
6466
  seen.add(node);
@@ -6678,6 +6676,7 @@ exports.isStaticProperty = isStaticProperty;
6678
6676
  exports.isStaticPropertyKey = isStaticPropertyKey;
6679
6677
  exports.isTemplateNode = isTemplateNode;
6680
6678
  exports.isText = isText$1;
6679
+ exports.isVPre = isVPre;
6681
6680
  exports.isVSlot = isVSlot;
6682
6681
  exports.locStub = locStub;
6683
6682
  exports.noopDirectiveTransform = noopDirectiveTransform;
@@ -1031,6 +1031,7 @@ export declare function findProp(node: ElementNode, name: string, dynamicOnly?:
1031
1031
  export declare function isStaticArgOf(arg: DirectiveNode['arg'], name: string): boolean;
1032
1032
  export declare function hasDynamicKeyVBind(node: ElementNode): boolean;
1033
1033
  export declare function isText(node: TemplateChildNode): node is TextNode | InterpolationNode;
1034
+ export declare function isVPre(p: ElementNode['props'][0]): p is DirectiveNode;
1034
1035
  export declare function isVSlot(p: ElementNode['props'][0]): p is DirectiveNode;
1035
1036
  export declare function isTemplateNode(node: RootNode | TemplateChildNode): node is TemplateNode;
1036
1037
  export declare function isSlotOutlet(node: RootNode | TemplateChildNode): node is SlotOutletNode;
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @vue/compiler-core v3.5.17
2
+ * @vue/compiler-core v3.5.19
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
- import { isString, NOOP, isObject, extend, NO, isSymbol, isArray, capitalize, camelize, EMPTY_OBJ, PatchFlagNames, slotFlagsText, isOn, isBuiltInDirective, isReservedProp, toHandlerKey } from '@vue/shared';
6
+ import { isString, NOOP, isObject, extend, NO, isSymbol, PatchFlagNames, isArray, capitalize, camelize, EMPTY_OBJ, slotFlagsText, isOn, isBuiltInDirective, isReservedProp, toHandlerKey } from '@vue/shared';
7
7
  export { generateCodeFrame } from '@vue/shared';
8
8
 
9
9
  const FRAGMENT = Symbol(!!(process.env.NODE_ENV !== "production") ? `Fragment` : ``);
@@ -1620,7 +1620,7 @@ function isCoreComponent(tag) {
1620
1620
  return BASE_TRANSITION;
1621
1621
  }
1622
1622
  }
1623
- const nonIdentifierRE = /^\d|[^\$\w\xA0-\uFFFF]/;
1623
+ const nonIdentifierRE = /^$|^\d|[^\$\w\xA0-\uFFFF]/;
1624
1624
  const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
1625
1625
  const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
1626
1626
  const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
@@ -1759,6 +1759,9 @@ function hasDynamicKeyVBind(node) {
1759
1759
  function isText$1(node) {
1760
1760
  return node.type === 5 || node.type === 2;
1761
1761
  }
1762
+ function isVPre(p) {
1763
+ return p.type === 7 && p.name === "pre";
1764
+ }
1762
1765
  function isVSlot(p) {
1763
1766
  return p.type === 7 && p.name === "slot";
1764
1767
  }
@@ -2058,7 +2061,7 @@ const tokenizer = new Tokenizer(stack, {
2058
2061
  ondirarg(start, end) {
2059
2062
  if (start === end) return;
2060
2063
  const arg = getSlice(start, end);
2061
- if (inVPre) {
2064
+ if (inVPre && !isVPre(currentProp)) {
2062
2065
  currentProp.name += arg;
2063
2066
  setLocEnd(currentProp.nameLoc, end);
2064
2067
  } else {
@@ -2073,7 +2076,7 @@ const tokenizer = new Tokenizer(stack, {
2073
2076
  },
2074
2077
  ondirmodifier(start, end) {
2075
2078
  const mod = getSlice(start, end);
2076
- if (inVPre) {
2079
+ if (inVPre && !isVPre(currentProp)) {
2077
2080
  currentProp.name += "." + mod;
2078
2081
  setLocEnd(currentProp.nameLoc, end);
2079
2082
  } else if (currentProp.name === "slot") {
@@ -2701,6 +2704,11 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
2701
2704
  } else if (child.type === 12) {
2702
2705
  const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
2703
2706
  if (constantType >= 2) {
2707
+ if (child.codegenNode.type === 14 && child.codegenNode.arguments.length > 0) {
2708
+ child.codegenNode.arguments.push(
2709
+ -1 + (!!(process.env.NODE_ENV !== "production") ? ` /* ${PatchFlagNames[-1]} */` : ``)
2710
+ );
2711
+ }
2704
2712
  toCache.push(child);
2705
2713
  continue;
2706
2714
  }
@@ -2729,7 +2737,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
2729
2737
  }
2730
2738
  }
2731
2739
  let cachedAsArray = false;
2732
- const slotCacheKeys = [];
2733
2740
  if (toCache.length === children.length && node.type === 1) {
2734
2741
  if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
2735
2742
  node.codegenNode.children = getCacheExpression(
@@ -2739,7 +2746,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
2739
2746
  } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
2740
2747
  const slot = getSlotNode(node.codegenNode, "default");
2741
2748
  if (slot) {
2742
- slotCacheKeys.push(context.cached.length);
2743
2749
  slot.returns = getCacheExpression(
2744
2750
  createArrayExpression(slot.returns)
2745
2751
  );
@@ -2749,7 +2755,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
2749
2755
  const slotName = findDir(node, "slot", true);
2750
2756
  const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
2751
2757
  if (slot) {
2752
- slotCacheKeys.push(context.cached.length);
2753
2758
  slot.returns = getCacheExpression(
2754
2759
  createArrayExpression(slot.returns)
2755
2760
  );
@@ -2759,23 +2764,12 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
2759
2764
  }
2760
2765
  if (!cachedAsArray) {
2761
2766
  for (const child of toCache) {
2762
- slotCacheKeys.push(context.cached.length);
2763
2767
  child.codegenNode = context.cache(child.codegenNode);
2764
2768
  }
2765
2769
  }
2766
- 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) {
2767
- node.codegenNode.children.properties.push(
2768
- createObjectProperty(
2769
- `__`,
2770
- createSimpleExpression(JSON.stringify(slotCacheKeys), false)
2771
- )
2772
- );
2773
- }
2774
2770
  function getCacheExpression(value) {
2775
2771
  const exp = context.cache(value);
2776
- if (inFor && context.hmr) {
2777
- exp.needArraySpread = true;
2778
- }
2772
+ exp.needArraySpread = true;
2779
2773
  return exp;
2780
2774
  }
2781
2775
  function getSlotNode(node2, name) {
@@ -3983,7 +3977,7 @@ function processIf(node, dir, context, processCodegen) {
3983
3977
  continue;
3984
3978
  }
3985
3979
  if (sibling && sibling.type === 9) {
3986
- 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) {
3987
3981
  context.onError(
3988
3982
  createCompilerError(30, node.loc)
3989
3983
  );
@@ -4162,7 +4156,7 @@ const transformBind = (dir, _node, context) => {
4162
4156
  arg.children.unshift(`(`);
4163
4157
  arg.children.push(`) || ""`);
4164
4158
  } else if (!arg.isStatic) {
4165
- arg.content = `${arg.content} || ""`;
4159
+ arg.content = arg.content ? `${arg.content} || ""` : `""`;
4166
4160
  }
4167
4161
  if (modifiers.some((mod) => mod.content === "camel")) {
4168
4162
  if (arg.type === 4) {
@@ -5700,7 +5694,7 @@ const seen = /* @__PURE__ */ new WeakSet();
5700
5694
  const transformMemo = (node, context) => {
5701
5695
  if (node.type === 1) {
5702
5696
  const dir = findDir(node, "memo");
5703
- if (!dir || seen.has(node)) {
5697
+ if (!dir || seen.has(node) || context.inSSR) {
5704
5698
  return;
5705
5699
  }
5706
5700
  seen.add(node);
@@ -5799,4 +5793,4 @@ const BindingTypes = {
5799
5793
 
5800
5794
  const noopDirectiveTransform = () => ({ props: [] });
5801
5795
 
5802
- export { BASE_TRANSITION, BindingTypes, CAMELIZE, CAPITALIZE, CREATE_BLOCK, CREATE_COMMENT, CREATE_ELEMENT_BLOCK, CREATE_ELEMENT_VNODE, CREATE_SLOTS, CREATE_STATIC, CREATE_TEXT, CREATE_VNODE, CompilerDeprecationTypes, ConstantTypes, ElementTypes, ErrorCodes, FRAGMENT, GUARD_REACTIVE_PROPS, IS_MEMO_SAME, IS_REF, KEEP_ALIVE, MERGE_PROPS, NORMALIZE_CLASS, NORMALIZE_PROPS, NORMALIZE_STYLE, Namespaces, NodeTypes, OPEN_BLOCK, POP_SCOPE_ID, PUSH_SCOPE_ID, RENDER_LIST, RENDER_SLOT, RESOLVE_COMPONENT, RESOLVE_DIRECTIVE, RESOLVE_DYNAMIC_COMPONENT, RESOLVE_FILTER, SET_BLOCK_TRACKING, SUSPENSE, TELEPORT, TO_DISPLAY_STRING, TO_HANDLERS, TO_HANDLER_KEY, TS_NODE_TYPES, UNREF, WITH_CTX, WITH_DIRECTIVES, WITH_MEMO, advancePositionWithClone, advancePositionWithMutation, assert, baseCompile, baseParse, buildDirectiveArgs, buildProps, buildSlots, checkCompatEnabled, convertToBlock, createArrayExpression, createAssignmentExpression, createBlockStatement, createCacheExpression, createCallExpression, createCompilerError, createCompoundExpression, createConditionalExpression, createForLoopParams, createFunctionExpression, createIfStatement, createInterpolation, createObjectExpression, createObjectProperty, createReturnStatement, createRoot, createSequenceExpression, createSimpleExpression, createStructuralDirectiveTransform, createTemplateLiteral, createTransformContext, createVNodeCall, errorMessages, extractIdentifiers, findDir, findProp, forAliasRE, generate, getBaseTransformPreset, getConstantType, getMemoedVNodeCall, getVNodeBlockHelper, getVNodeHelper, hasDynamicKeyVBind, hasScopeRef, helperNameMap, injectProp, isCoreComponent, isFnExpression, isFnExpressionBrowser, isFnExpressionNode, isFunctionType, isInDestructureAssignment, isInNewExpression, isMemberExpression, isMemberExpressionBrowser, isMemberExpressionNode, isReferencedIdentifier, isSimpleIdentifier, isSlotOutlet, isStaticArgOf, isStaticExp, isStaticProperty, isStaticPropertyKey, isTemplateNode, isText$1 as isText, isVSlot, locStub, noopDirectiveTransform, processExpression, processFor, processIf, processSlotOutlet, registerRuntimeHelpers, resolveComponentType, stringifyExpression, toValidAssetId, trackSlotScopes, trackVForSlotScopes, transform, transformBind, transformElement, transformExpression, transformModel, transformOn, traverseNode, unwrapTSNode, walkBlockDeclarations, walkFunctionParams, walkIdentifiers, warnDeprecation };
5796
+ export { BASE_TRANSITION, BindingTypes, CAMELIZE, CAPITALIZE, CREATE_BLOCK, CREATE_COMMENT, CREATE_ELEMENT_BLOCK, CREATE_ELEMENT_VNODE, CREATE_SLOTS, CREATE_STATIC, CREATE_TEXT, CREATE_VNODE, CompilerDeprecationTypes, ConstantTypes, ElementTypes, ErrorCodes, FRAGMENT, GUARD_REACTIVE_PROPS, IS_MEMO_SAME, IS_REF, KEEP_ALIVE, MERGE_PROPS, NORMALIZE_CLASS, NORMALIZE_PROPS, NORMALIZE_STYLE, Namespaces, NodeTypes, OPEN_BLOCK, POP_SCOPE_ID, PUSH_SCOPE_ID, RENDER_LIST, RENDER_SLOT, RESOLVE_COMPONENT, RESOLVE_DIRECTIVE, RESOLVE_DYNAMIC_COMPONENT, RESOLVE_FILTER, SET_BLOCK_TRACKING, SUSPENSE, TELEPORT, TO_DISPLAY_STRING, TO_HANDLERS, TO_HANDLER_KEY, TS_NODE_TYPES, UNREF, WITH_CTX, WITH_DIRECTIVES, WITH_MEMO, advancePositionWithClone, advancePositionWithMutation, assert, baseCompile, baseParse, buildDirectiveArgs, buildProps, buildSlots, checkCompatEnabled, convertToBlock, createArrayExpression, createAssignmentExpression, createBlockStatement, createCacheExpression, createCallExpression, createCompilerError, createCompoundExpression, createConditionalExpression, createForLoopParams, createFunctionExpression, createIfStatement, createInterpolation, createObjectExpression, createObjectProperty, createReturnStatement, createRoot, createSequenceExpression, createSimpleExpression, createStructuralDirectiveTransform, createTemplateLiteral, createTransformContext, createVNodeCall, errorMessages, extractIdentifiers, findDir, findProp, forAliasRE, generate, getBaseTransformPreset, getConstantType, getMemoedVNodeCall, getVNodeBlockHelper, getVNodeHelper, hasDynamicKeyVBind, hasScopeRef, helperNameMap, injectProp, isCoreComponent, isFnExpression, isFnExpressionBrowser, isFnExpressionNode, isFunctionType, isInDestructureAssignment, isInNewExpression, isMemberExpression, isMemberExpressionBrowser, isMemberExpressionNode, isReferencedIdentifier, isSimpleIdentifier, isSlotOutlet, isStaticArgOf, isStaticExp, isStaticProperty, isStaticPropertyKey, isTemplateNode, isText$1 as isText, isVPre, isVSlot, locStub, noopDirectiveTransform, processExpression, processFor, processIf, processSlotOutlet, registerRuntimeHelpers, resolveComponentType, stringifyExpression, toValidAssetId, trackSlotScopes, trackVForSlotScopes, transform, transformBind, transformElement, transformExpression, transformModel, transformOn, traverseNode, unwrapTSNode, walkBlockDeclarations, walkFunctionParams, walkIdentifiers, warnDeprecation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-core",
3
- "version": "3.5.17",
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.27.5",
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.17"
53
+ "@vue/shared": "3.5.19"
54
54
  },
55
55
  "devDependencies": {
56
- "@babel/types": "^7.27.6"
56
+ "@babel/types": "^7.28.2"
57
57
  }
58
58
  }