@vue/compiler-core 3.5.24 → 3.5.25

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.24
2
+ * @vue/compiler-core v3.5.25
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2262,6 +2262,20 @@ function getMemoedVNodeCall(node) {
2262
2262
  }
2263
2263
  }
2264
2264
  const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;
2265
+ function isAllWhitespace(str) {
2266
+ for (let i = 0; i < str.length; i++) {
2267
+ if (!isWhitespace(str.charCodeAt(i))) {
2268
+ return false;
2269
+ }
2270
+ }
2271
+ return true;
2272
+ }
2273
+ function isWhitespaceText(node) {
2274
+ return node.type === 2 && isAllWhitespace(node.content) || node.type === 12 && isWhitespaceText(node.content);
2275
+ }
2276
+ function isCommentOrWhitespace(node) {
2277
+ return node.type === 3 || isWhitespaceText(node);
2278
+ }
2265
2279
 
2266
2280
  const defaultParserOptions = {
2267
2281
  parseMode: "base",
@@ -2881,14 +2895,6 @@ function condenseWhitespace(nodes) {
2881
2895
  }
2882
2896
  return removedWhitespace ? nodes.filter(Boolean) : nodes;
2883
2897
  }
2884
- function isAllWhitespace(str) {
2885
- for (let i = 0; i < str.length; i++) {
2886
- if (!isWhitespace(str.charCodeAt(i))) {
2887
- return false;
2888
- }
2889
- }
2890
- return true;
2891
- }
2892
2898
  function hasNewlineChar(str) {
2893
2899
  for (let i = 0; i < str.length; i++) {
2894
2900
  const c = str.charCodeAt(i);
@@ -4714,13 +4720,11 @@ function processIf(node, dir, context, processCodegen) {
4714
4720
  let i = siblings.indexOf(node);
4715
4721
  while (i-- >= -1) {
4716
4722
  const sibling = siblings[i];
4717
- if (sibling && sibling.type === 3) {
4718
- context.removeNode(sibling);
4719
- comments.unshift(sibling);
4720
- continue;
4721
- }
4722
- if (sibling && sibling.type === 2 && !sibling.content.trim().length) {
4723
+ if (sibling && isCommentOrWhitespace(sibling)) {
4723
4724
  context.removeNode(sibling);
4725
+ if (sibling.type === 3) {
4726
+ comments.unshift(sibling);
4727
+ }
4724
4728
  continue;
4725
4729
  }
4726
4730
  if (sibling && sibling.type === 9) {
@@ -5238,7 +5242,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
5238
5242
  let prev;
5239
5243
  while (j--) {
5240
5244
  prev = children[j];
5241
- if (prev.type !== 3 && isNonWhitespaceContent(prev)) {
5245
+ if (!isCommentOrWhitespace(prev)) {
5242
5246
  break;
5243
5247
  }
5244
5248
  }
@@ -5316,7 +5320,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
5316
5320
  } else if (implicitDefaultChildren.length && // #3766
5317
5321
  // with whitespace: 'preserve', whitespaces between slots will end up in
5318
5322
  // implicitDefaultChildren. Ignore if all implicit children are whitespaces.
5319
- implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) {
5323
+ !implicitDefaultChildren.every(isWhitespaceText)) {
5320
5324
  if (hasNamedDefaultSlot) {
5321
5325
  context.onError(
5322
5326
  createCompilerError(
@@ -5389,11 +5393,6 @@ function hasForwardedSlots(children) {
5389
5393
  }
5390
5394
  return false;
5391
5395
  }
5392
- function isNonWhitespaceContent(node) {
5393
- if (node.type !== 2 && node.type !== 12)
5394
- return true;
5395
- return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content);
5396
- }
5397
5396
 
5398
5397
  const directiveImportMap = /* @__PURE__ */ new WeakMap();
5399
5398
  const transformElement = (node, context) => {
@@ -6816,6 +6815,8 @@ exports.hasDynamicKeyVBind = hasDynamicKeyVBind;
6816
6815
  exports.hasScopeRef = hasScopeRef;
6817
6816
  exports.helperNameMap = helperNameMap;
6818
6817
  exports.injectProp = injectProp;
6818
+ exports.isAllWhitespace = isAllWhitespace;
6819
+ exports.isCommentOrWhitespace = isCommentOrWhitespace;
6819
6820
  exports.isCoreComponent = isCoreComponent;
6820
6821
  exports.isFnExpression = isFnExpression;
6821
6822
  exports.isFnExpressionBrowser = isFnExpressionBrowser;
@@ -6837,6 +6838,7 @@ exports.isTemplateNode = isTemplateNode;
6837
6838
  exports.isText = isText$1;
6838
6839
  exports.isVPre = isVPre;
6839
6840
  exports.isVSlot = isVSlot;
6841
+ exports.isWhitespaceText = isWhitespaceText;
6840
6842
  exports.locStub = locStub;
6841
6843
  exports.noopDirectiveTransform = noopDirectiveTransform;
6842
6844
  exports.processExpression = processExpression;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.5.24
2
+ * @vue/compiler-core v3.5.25
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2258,6 +2258,20 @@ function getMemoedVNodeCall(node) {
2258
2258
  }
2259
2259
  }
2260
2260
  const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;
2261
+ function isAllWhitespace(str) {
2262
+ for (let i = 0; i < str.length; i++) {
2263
+ if (!isWhitespace(str.charCodeAt(i))) {
2264
+ return false;
2265
+ }
2266
+ }
2267
+ return true;
2268
+ }
2269
+ function isWhitespaceText(node) {
2270
+ return node.type === 2 && isAllWhitespace(node.content) || node.type === 12 && isWhitespaceText(node.content);
2271
+ }
2272
+ function isCommentOrWhitespace(node) {
2273
+ return node.type === 3 || isWhitespaceText(node);
2274
+ }
2261
2275
 
2262
2276
  const defaultParserOptions = {
2263
2277
  parseMode: "base",
@@ -2847,14 +2861,6 @@ function condenseWhitespace(nodes) {
2847
2861
  }
2848
2862
  return removedWhitespace ? nodes.filter(Boolean) : nodes;
2849
2863
  }
2850
- function isAllWhitespace(str) {
2851
- for (let i = 0; i < str.length; i++) {
2852
- if (!isWhitespace(str.charCodeAt(i))) {
2853
- return false;
2854
- }
2855
- }
2856
- return true;
2857
- }
2858
2864
  function hasNewlineChar(str) {
2859
2865
  for (let i = 0; i < str.length; i++) {
2860
2866
  const c = str.charCodeAt(i);
@@ -4637,11 +4643,7 @@ function processIf(node, dir, context, processCodegen) {
4637
4643
  let i = siblings.indexOf(node);
4638
4644
  while (i-- >= -1) {
4639
4645
  const sibling = siblings[i];
4640
- if (sibling && sibling.type === 3) {
4641
- context.removeNode(sibling);
4642
- continue;
4643
- }
4644
- if (sibling && sibling.type === 2 && !sibling.content.trim().length) {
4646
+ if (sibling && isCommentOrWhitespace(sibling)) {
4645
4647
  context.removeNode(sibling);
4646
4648
  continue;
4647
4649
  }
@@ -5153,7 +5155,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
5153
5155
  let prev;
5154
5156
  while (j--) {
5155
5157
  prev = children[j];
5156
- if (prev.type !== 3 && isNonWhitespaceContent(prev)) {
5158
+ if (!isCommentOrWhitespace(prev)) {
5157
5159
  break;
5158
5160
  }
5159
5161
  }
@@ -5231,7 +5233,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
5231
5233
  } else if (implicitDefaultChildren.length && // #3766
5232
5234
  // with whitespace: 'preserve', whitespaces between slots will end up in
5233
5235
  // implicitDefaultChildren. Ignore if all implicit children are whitespaces.
5234
- implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) {
5236
+ !implicitDefaultChildren.every(isWhitespaceText)) {
5235
5237
  if (hasNamedDefaultSlot) {
5236
5238
  context.onError(
5237
5239
  createCompilerError(
@@ -5304,11 +5306,6 @@ function hasForwardedSlots(children) {
5304
5306
  }
5305
5307
  return false;
5306
5308
  }
5307
- function isNonWhitespaceContent(node) {
5308
- if (node.type !== 2 && node.type !== 12)
5309
- return true;
5310
- return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content);
5311
- }
5312
5309
 
5313
5310
  const directiveImportMap = /* @__PURE__ */ new WeakMap();
5314
5311
  const transformElement = (node, context) => {
@@ -6693,6 +6690,8 @@ exports.hasDynamicKeyVBind = hasDynamicKeyVBind;
6693
6690
  exports.hasScopeRef = hasScopeRef;
6694
6691
  exports.helperNameMap = helperNameMap;
6695
6692
  exports.injectProp = injectProp;
6693
+ exports.isAllWhitespace = isAllWhitespace;
6694
+ exports.isCommentOrWhitespace = isCommentOrWhitespace;
6696
6695
  exports.isCoreComponent = isCoreComponent;
6697
6696
  exports.isFnExpression = isFnExpression;
6698
6697
  exports.isFnExpressionBrowser = isFnExpressionBrowser;
@@ -6714,6 +6713,7 @@ exports.isTemplateNode = isTemplateNode;
6714
6713
  exports.isText = isText$1;
6715
6714
  exports.isVPre = isVPre;
6716
6715
  exports.isVSlot = isVSlot;
6716
+ exports.isWhitespaceText = isWhitespaceText;
6717
6717
  exports.locStub = locStub;
6718
6718
  exports.noopDirectiveTransform = noopDirectiveTransform;
6719
6719
  exports.processExpression = processExpression;
@@ -1041,6 +1041,9 @@ export declare function toValidAssetId(name: string, type: 'component' | 'direct
1041
1041
  export declare function hasScopeRef(node: TemplateChildNode | IfBranchNode | ExpressionNode | CacheExpression | undefined, ids: TransformContext['identifiers']): boolean;
1042
1042
  export declare function getMemoedVNodeCall(node: BlockCodegenNode | MemoExpression): VNodeCall | RenderSlotCall;
1043
1043
  export declare const forAliasRE: RegExp;
1044
+ export declare function isAllWhitespace(str: string): boolean;
1045
+ export declare function isWhitespaceText(node: TemplateChildNode): boolean;
1046
+ export declare function isCommentOrWhitespace(node: TemplateChildNode): boolean;
1044
1047
 
1045
1048
  /**
1046
1049
  * Return value indicates whether the AST walked can be a constant
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.5.24
2
+ * @vue/compiler-core v3.5.25
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1923,6 +1923,20 @@ function getMemoedVNodeCall(node) {
1923
1923
  }
1924
1924
  }
1925
1925
  const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;
1926
+ function isAllWhitespace(str) {
1927
+ for (let i = 0; i < str.length; i++) {
1928
+ if (!isWhitespace(str.charCodeAt(i))) {
1929
+ return false;
1930
+ }
1931
+ }
1932
+ return true;
1933
+ }
1934
+ function isWhitespaceText(node) {
1935
+ return node.type === 2 && isAllWhitespace(node.content) || node.type === 12 && isWhitespaceText(node.content);
1936
+ }
1937
+ function isCommentOrWhitespace(node) {
1938
+ return node.type === 3 || isWhitespaceText(node);
1939
+ }
1926
1940
 
1927
1941
  const defaultParserOptions = {
1928
1942
  parseMode: "base",
@@ -2545,14 +2559,6 @@ function condenseWhitespace(nodes) {
2545
2559
  }
2546
2560
  return removedWhitespace ? nodes.filter(Boolean) : nodes;
2547
2561
  }
2548
- function isAllWhitespace(str) {
2549
- for (let i = 0; i < str.length; i++) {
2550
- if (!isWhitespace(str.charCodeAt(i))) {
2551
- return false;
2552
- }
2553
- }
2554
- return true;
2555
- }
2556
2562
  function hasNewlineChar(str) {
2557
2563
  for (let i = 0; i < str.length; i++) {
2558
2564
  const c = str.charCodeAt(i);
@@ -3984,13 +3990,11 @@ function processIf(node, dir, context, processCodegen) {
3984
3990
  let i = siblings.indexOf(node);
3985
3991
  while (i-- >= -1) {
3986
3992
  const sibling = siblings[i];
3987
- if (sibling && sibling.type === 3) {
3988
- context.removeNode(sibling);
3989
- !!(process.env.NODE_ENV !== "production") && comments.unshift(sibling);
3990
- continue;
3991
- }
3992
- if (sibling && sibling.type === 2 && !sibling.content.trim().length) {
3993
+ if (sibling && isCommentOrWhitespace(sibling)) {
3993
3994
  context.removeNode(sibling);
3995
+ if (!!(process.env.NODE_ENV !== "production") && sibling.type === 3) {
3996
+ comments.unshift(sibling);
3997
+ }
3994
3998
  continue;
3995
3999
  }
3996
4000
  if (sibling && sibling.type === 9) {
@@ -4462,7 +4466,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
4462
4466
  let prev;
4463
4467
  while (j--) {
4464
4468
  prev = children[j];
4465
- if (prev.type !== 3 && isNonWhitespaceContent(prev)) {
4469
+ if (!isCommentOrWhitespace(prev)) {
4466
4470
  break;
4467
4471
  }
4468
4472
  }
@@ -4540,7 +4544,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
4540
4544
  } else if (implicitDefaultChildren.length && // #3766
4541
4545
  // with whitespace: 'preserve', whitespaces between slots will end up in
4542
4546
  // implicitDefaultChildren. Ignore if all implicit children are whitespaces.
4543
- implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) {
4547
+ !implicitDefaultChildren.every(isWhitespaceText)) {
4544
4548
  if (hasNamedDefaultSlot) {
4545
4549
  context.onError(
4546
4550
  createCompilerError(
@@ -4613,11 +4617,6 @@ function hasForwardedSlots(children) {
4613
4617
  }
4614
4618
  return false;
4615
4619
  }
4616
- function isNonWhitespaceContent(node) {
4617
- if (node.type !== 2 && node.type !== 12)
4618
- return true;
4619
- return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content);
4620
- }
4621
4620
 
4622
4621
  const directiveImportMap = /* @__PURE__ */ new WeakMap();
4623
4622
  const transformElement = (node, context) => {
@@ -5812,4 +5811,4 @@ const BindingTypes = {
5812
5811
 
5813
5812
  const noopDirectiveTransform = () => ({ props: [] });
5814
5813
 
5815
- 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, transformVBindShorthand, traverseNode, unwrapTSNode, validFirstIdentCharRE, walkBlockDeclarations, walkFunctionParams, walkIdentifiers, warnDeprecation };
5814
+ 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, isAllWhitespace, isCommentOrWhitespace, isCoreComponent, isFnExpression, isFnExpressionBrowser, isFnExpressionNode, isFunctionType, isInDestructureAssignment, isInNewExpression, isMemberExpression, isMemberExpressionBrowser, isMemberExpressionNode, isReferencedIdentifier, isSimpleIdentifier, isSlotOutlet, isStaticArgOf, isStaticExp, isStaticProperty, isStaticPropertyKey, isTemplateNode, isText$1 as isText, isVPre, isVSlot, isWhitespaceText, locStub, noopDirectiveTransform, processExpression, processFor, processIf, processSlotOutlet, registerRuntimeHelpers, resolveComponentType, stringifyExpression, toValidAssetId, trackSlotScopes, trackVForSlotScopes, transform, transformBind, transformElement, transformExpression, transformModel, transformOn, transformVBindShorthand, traverseNode, unwrapTSNode, validFirstIdentCharRE, walkBlockDeclarations, walkFunctionParams, walkIdentifiers, warnDeprecation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-core",
3
- "version": "3.5.24",
3
+ "version": "3.5.25",
4
4
  "description": "@vue/compiler-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/compiler-core.esm-bundler.js",
@@ -50,7 +50,7 @@
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.24"
53
+ "@vue/shared": "3.5.25"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@babel/types": "^7.28.5"