@vue/compiler-sfc 3.4.31 → 3.4.33

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-sfc v3.4.31
2
+ * @vue/compiler-sfc v3.4.33
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -13325,12 +13325,17 @@ function getHashDigest$1(buffer, algorithm, digestType, maxLength) {
13325
13325
  digestType === "base49" ||
13326
13326
  digestType === "base52" ||
13327
13327
  digestType === "base58" ||
13328
- digestType === "base62"
13328
+ digestType === "base62" ||
13329
+ digestType === "base64safe"
13329
13330
  ) {
13330
- return encodeBufferToBase(hash.digest(), digestType.substr(4), maxLength);
13331
- } else {
13332
- return hash.digest(digestType || "hex").substr(0, maxLength);
13331
+ return encodeBufferToBase(
13332
+ hash.digest(),
13333
+ digestType === "base64safe" ? 64 : digestType.substr(4),
13334
+ maxLength
13335
+ );
13333
13336
  }
13337
+
13338
+ return hash.digest(digestType || "hex").substr(0, maxLength);
13334
13339
  }
13335
13340
 
13336
13341
  var getHashDigest_1 = getHashDigest$1;
@@ -13386,9 +13391,10 @@ function interpolateName$1(loaderContext, name, options = {}) {
13386
13391
  directory = resourcePath.replace(/\\/g, "/").replace(/\.\.(\/)?/g, "_$1");
13387
13392
  }
13388
13393
 
13389
- if (directory.length === 1) {
13394
+ if (directory.length <= 1) {
13390
13395
  directory = "";
13391
- } else if (directory.length > 1) {
13396
+ } else {
13397
+ // directory.length > 1
13392
13398
  folder = path$2.basename(directory);
13393
13399
  }
13394
13400
  }
@@ -13411,7 +13417,7 @@ function interpolateName$1(loaderContext, name, options = {}) {
13411
13417
  // `hash` and `contenthash` are same in `loader-utils` context
13412
13418
  // let's keep `hash` for backward compatibility
13413
13419
  .replace(
13414
- /\[(?:([^[:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\]/gi,
13420
+ /\[(?:([^[:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*(?:safe)?))?(?::(\d+))?\]/gi,
13415
13421
  (all, hashType, digestType, maxLength) =>
13416
13422
  getHashDigest(content, hashType, digestType, parseInt(maxLength, 10))
13417
13423
  );
@@ -17427,10 +17433,11 @@ class Minimatch {
17427
17433
  for (let i = 0; i < globParts.length - 1; i++) {
17428
17434
  for (let j = i + 1; j < globParts.length; j++) {
17429
17435
  const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
17430
- if (!matched)
17431
- continue;
17432
- globParts[i] = matched;
17433
- globParts[j] = [];
17436
+ if (matched) {
17437
+ globParts[i] = [];
17438
+ globParts[j] = matched;
17439
+ break;
17440
+ }
17434
17441
  }
17435
17442
  }
17436
17443
  return globParts.filter(gs => gs.length);
@@ -17940,6 +17947,7 @@ function innerResolveTypeElements(ctx, node, scope, typeParameters) {
17940
17947
  case "TSInterfaceDeclaration":
17941
17948
  return resolveInterfaceMembers(ctx, node, scope, typeParameters);
17942
17949
  case "TSTypeAliasDeclaration":
17950
+ case "TSTypeAnnotation":
17943
17951
  case "TSParenthesizedType":
17944
17952
  return resolveTypeElements(
17945
17953
  ctx,
@@ -20849,7 +20857,7 @@ function isStaticNode(node) {
20849
20857
  return false;
20850
20858
  }
20851
20859
 
20852
- const version = "3.4.31";
20860
+ const version = "3.4.33";
20853
20861
  const parseCache = parseCache$1;
20854
20862
  const errorMessages = {
20855
20863
  ...CompilerDOM.errorMessages,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-sfc v3.4.31
2
+ * @vue/compiler-sfc v3.4.33
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -605,12 +605,12 @@ function createConditionalExpression(test, consequent, alternate, newline = true
605
605
  loc: locStub
606
606
  };
607
607
  }
608
- function createCacheExpression(index, value, isVNode = false) {
608
+ function createCacheExpression(index, value, isVOnce = false) {
609
609
  return {
610
610
  type: 20,
611
611
  index,
612
612
  value,
613
- isVNode,
613
+ isVOnce,
614
614
  loc: locStub
615
615
  };
616
616
  }
@@ -17853,7 +17853,7 @@ function walk$1(node, context, doNotHoistNode = false) {
17853
17853
  const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
17854
17854
  if (constantType > 0) {
17855
17855
  if (constantType >= 2) {
17856
- child.codegenNode.patchFlag = -1 + (` /* HOISTED */` );
17856
+ child.codegenNode.patchFlag = -1;
17857
17857
  child.codegenNode = context.hoist(child.codegenNode);
17858
17858
  hoistedCount++;
17859
17859
  continue;
@@ -17861,8 +17861,8 @@ function walk$1(node, context, doNotHoistNode = false) {
17861
17861
  } else {
17862
17862
  const codegenNode = child.codegenNode;
17863
17863
  if (codegenNode.type === 13) {
17864
- const flag = getPatchFlag(codegenNode);
17865
- if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) {
17864
+ const flag = codegenNode.patchFlag;
17865
+ if ((flag === void 0 || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) {
17866
17866
  const props = getNodeProps(child);
17867
17867
  if (props) {
17868
17868
  codegenNode.props = context.hoist(props);
@@ -17926,8 +17926,7 @@ function getConstantType(node, context) {
17926
17926
  if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject" && node.tag !== "math") {
17927
17927
  return 0;
17928
17928
  }
17929
- const flag = getPatchFlag(codegenNode);
17930
- if (!flag) {
17929
+ if (codegenNode.patchFlag === void 0) {
17931
17930
  let returnType2 = 3;
17932
17931
  const generatedPropsType = getGeneratedPropsConstantType(node, context);
17933
17932
  if (generatedPropsType === 0) {
@@ -18069,10 +18068,6 @@ function getNodeProps(node) {
18069
18068
  return codegenNode.props;
18070
18069
  }
18071
18070
  }
18072
- function getPatchFlag(node) {
18073
- const flag = node.patchFlag;
18074
- return flag ? parseInt(flag, 10) : void 0;
18075
- }
18076
18071
 
18077
18072
  function createTransformContext(root, {
18078
18073
  filename = "",
@@ -18292,7 +18287,7 @@ function createRootCodegen(root, context) {
18292
18287
  helper(FRAGMENT),
18293
18288
  void 0,
18294
18289
  root.children,
18295
- patchFlag + (` /* ${patchFlagText} */` ),
18290
+ patchFlag,
18296
18291
  void 0,
18297
18292
  void 0,
18298
18293
  true,
@@ -22271,6 +22266,17 @@ function genVNodeCall(node, context) {
22271
22266
  disableTracking,
22272
22267
  isComponent
22273
22268
  } = node;
22269
+ let patchFlagString;
22270
+ if (patchFlag) {
22271
+ {
22272
+ if (patchFlag < 0) {
22273
+ patchFlagString = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`;
22274
+ } else {
22275
+ const flagNames = Object.keys(PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => PatchFlagNames[n]).join(`, `);
22276
+ patchFlagString = patchFlag + ` /* ${flagNames} */`;
22277
+ }
22278
+ }
22279
+ }
22274
22280
  if (directives) {
22275
22281
  push(helper(WITH_DIRECTIVES) + `(`);
22276
22282
  }
@@ -22283,7 +22289,7 @@ function genVNodeCall(node, context) {
22283
22289
  const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent);
22284
22290
  push(helper(callHelper) + `(`, -2 /* None */, node);
22285
22291
  genNodeList(
22286
- genNullableArgs([tag, props, children, patchFlag, dynamicProps]),
22292
+ genNullableArgs([tag, props, children, patchFlagString, dynamicProps]),
22287
22293
  context
22288
22294
  );
22289
22295
  push(`)`);
@@ -22414,15 +22420,16 @@ function genConditionalExpression(node, context) {
22414
22420
  function genCacheExpression(node, context) {
22415
22421
  const { push, helper, indent, deindent, newline } = context;
22416
22422
  push(`_cache[${node.index}] || (`);
22417
- if (node.isVNode) {
22423
+ if (node.isVOnce) {
22418
22424
  indent();
22419
22425
  push(`${helper(SET_BLOCK_TRACKING)}(-1),`);
22420
22426
  newline();
22427
+ push(`(`);
22421
22428
  }
22422
22429
  push(`_cache[${node.index}] = `);
22423
22430
  genNode(node.value, context);
22424
- if (node.isVNode) {
22425
- push(`,`);
22431
+ if (node.isVOnce) {
22432
+ push(`).cacheIndex = ${node.index},`);
22426
22433
  newline();
22427
22434
  push(`${helper(SET_BLOCK_TRACKING)}(1),`);
22428
22435
  newline();
@@ -22884,7 +22891,7 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
22884
22891
  helper(FRAGMENT),
22885
22892
  createObjectExpression([keyProperty]),
22886
22893
  children,
22887
- patchFlag + (` /* ${patchFlagText} */` ),
22894
+ patchFlag,
22888
22895
  void 0,
22889
22896
  void 0,
22890
22897
  true,
@@ -23058,7 +23065,7 @@ const transformFor = createStructuralDirectiveTransform(
23058
23065
  helper(FRAGMENT),
23059
23066
  void 0,
23060
23067
  renderExp,
23061
- fragmentFlag + (` /* ${PatchFlagNames[fragmentFlag]} */` ),
23068
+ fragmentFlag,
23062
23069
  void 0,
23063
23070
  void 0,
23064
23071
  true,
@@ -23098,7 +23105,7 @@ const transformFor = createStructuralDirectiveTransform(
23098
23105
  helper(FRAGMENT),
23099
23106
  keyProperty ? createObjectExpression([keyProperty]) : void 0,
23100
23107
  node.children,
23101
- 64 + (` /* ${PatchFlagNames[64]} */` ),
23108
+ 64,
23102
23109
  void 0,
23103
23110
  void 0,
23104
23111
  true,
@@ -23544,7 +23551,6 @@ const transformElement = (node, context) => {
23544
23551
  const isDynamicComponent = isObject$2(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;
23545
23552
  let vnodeProps;
23546
23553
  let vnodeChildren;
23547
- let vnodePatchFlag;
23548
23554
  let patchFlag = 0;
23549
23555
  let vnodeDynamicProps;
23550
23556
  let dynamicPropNames;
@@ -23615,25 +23621,15 @@ const transformElement = (node, context) => {
23615
23621
  vnodeChildren = node.children;
23616
23622
  }
23617
23623
  }
23618
- if (patchFlag !== 0) {
23619
- {
23620
- if (patchFlag < 0) {
23621
- vnodePatchFlag = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`;
23622
- } else {
23623
- const flagNames = Object.keys(PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => PatchFlagNames[n]).join(`, `);
23624
- vnodePatchFlag = patchFlag + ` /* ${flagNames} */`;
23625
- }
23626
- }
23627
- if (dynamicPropNames && dynamicPropNames.length) {
23628
- vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
23629
- }
23624
+ if (dynamicPropNames && dynamicPropNames.length) {
23625
+ vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
23630
23626
  }
23631
23627
  node.codegenNode = createVNodeCall(
23632
23628
  context,
23633
23629
  vnodeTag,
23634
23630
  vnodeProps,
23635
23631
  vnodeChildren,
23636
- vnodePatchFlag,
23632
+ patchFlag === 0 ? void 0 : patchFlag,
23637
23633
  vnodeDynamicProps,
23638
23634
  vnodeDirectives,
23639
23635
  !!shouldUseBlock,
@@ -36530,7 +36526,7 @@ let Root$2 = root$2;
36530
36526
 
36531
36527
  let Processor$1 = class Processor {
36532
36528
  constructor(plugins = []) {
36533
- this.version = '8.4.38';
36529
+ this.version = '8.4.39';
36534
36530
  this.plugins = this.normalize(plugins);
36535
36531
  }
36536
36532
 
@@ -45587,6 +45583,7 @@ function innerResolveTypeElements(ctx, node, scope, typeParameters) {
45587
45583
  case "TSInterfaceDeclaration":
45588
45584
  return resolveInterfaceMembers(ctx, node, scope, typeParameters);
45589
45585
  case "TSTypeAliasDeclaration":
45586
+ case "TSTypeAnnotation":
45590
45587
  case "TSParenthesizedType":
45591
45588
  return resolveTypeElements(
45592
45589
  ctx,
@@ -48438,7 +48435,7 @@ var __spreadValues = (a, b) => {
48438
48435
  }
48439
48436
  return a;
48440
48437
  };
48441
- const version = "3.4.31";
48438
+ const version = "3.4.33";
48442
48439
  const parseCache = parseCache$1;
48443
48440
  const errorMessages = __spreadValues(__spreadValues({}, errorMessages$1), DOMErrorMessages);
48444
48441
  const walk = walk$2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-sfc",
3
- "version": "3.4.31",
3
+ "version": "3.4.33",
4
4
  "description": "@vue/compiler-sfc",
5
5
  "main": "dist/compiler-sfc.cjs.js",
6
6
  "module": "dist/compiler-sfc.esm-browser.js",
@@ -45,12 +45,12 @@
45
45
  "@babel/parser": "^7.24.7",
46
46
  "estree-walker": "^2.0.2",
47
47
  "magic-string": "^0.30.10",
48
- "postcss": "^8.4.38",
48
+ "postcss": "^8.4.39",
49
49
  "source-map-js": "^1.2.0",
50
- "@vue/compiler-core": "3.4.31",
51
- "@vue/compiler-ssr": "3.4.31",
52
- "@vue/compiler-dom": "3.4.31",
53
- "@vue/shared": "3.4.31"
50
+ "@vue/compiler-ssr": "3.4.33",
51
+ "@vue/shared": "3.4.33",
52
+ "@vue/compiler-dom": "3.4.33",
53
+ "@vue/compiler-core": "3.4.33"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@babel/types": "^7.24.7",
@@ -58,10 +58,10 @@
58
58
  "hash-sum": "^2.0.0",
59
59
  "lru-cache": "10.1.0",
60
60
  "merge-source-map": "^1.1.0",
61
- "minimatch": "^9.0.4",
61
+ "minimatch": "^9.0.5",
62
62
  "postcss-modules": "^6.0.0",
63
63
  "postcss-selector-parser": "^6.1.0",
64
64
  "pug": "^3.0.3",
65
- "sass": "^1.77.6"
65
+ "sass": "^1.77.8"
66
66
  }
67
67
  }