@vue/compiler-sfc 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.
- package/dist/compiler-sfc.cjs.js +21 -13
- package/dist/compiler-sfc.esm-browser.js +39 -39
- package/package.json +8 -8
package/dist/compiler-sfc.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-sfc v3.4.
|
|
2
|
+
* @vue/compiler-sfc v3.4.32
|
|
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(
|
|
13331
|
-
|
|
13332
|
-
|
|
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
|
|
13394
|
+
if (directory.length <= 1) {
|
|
13390
13395
|
directory = "";
|
|
13391
|
-
} else
|
|
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 (
|
|
17431
|
-
|
|
17432
|
-
|
|
17433
|
-
|
|
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.
|
|
20860
|
+
const version = "3.4.32";
|
|
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.
|
|
2
|
+
* @vue/compiler-sfc v3.4.32
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -274,11 +274,14 @@ function escapeHtml(string) {
|
|
|
274
274
|
return lastIndex !== index ? html + str.slice(lastIndex, index) : html;
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
+
const isRef = (val) => {
|
|
278
|
+
return !!(val && val.__v_isRef === true);
|
|
279
|
+
};
|
|
277
280
|
const toDisplayString = (val) => {
|
|
278
|
-
return isString$2(val) ? val : val == null ? "" : isArray$3(val) || isObject$2(val) && (val.toString === objectToString$1 || !isFunction$1(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
|
|
281
|
+
return isString$2(val) ? val : val == null ? "" : isArray$3(val) || isObject$2(val) && (val.toString === objectToString$1 || !isFunction$1(val.toString)) ? isRef(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
|
|
279
282
|
};
|
|
280
283
|
const replacer = (_key, val) => {
|
|
281
|
-
if (val
|
|
284
|
+
if (isRef(val)) {
|
|
282
285
|
return replacer(_key, val.value);
|
|
283
286
|
} else if (isMap(val)) {
|
|
284
287
|
return {
|
|
@@ -602,12 +605,12 @@ function createConditionalExpression(test, consequent, alternate, newline = true
|
|
|
602
605
|
loc: locStub
|
|
603
606
|
};
|
|
604
607
|
}
|
|
605
|
-
function createCacheExpression(index, value,
|
|
608
|
+
function createCacheExpression(index, value, isVOnce = false) {
|
|
606
609
|
return {
|
|
607
610
|
type: 20,
|
|
608
611
|
index,
|
|
609
612
|
value,
|
|
610
|
-
|
|
613
|
+
isVOnce,
|
|
611
614
|
loc: locStub
|
|
612
615
|
};
|
|
613
616
|
}
|
|
@@ -17850,7 +17853,7 @@ function walk$1(node, context, doNotHoistNode = false) {
|
|
|
17850
17853
|
const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
|
|
17851
17854
|
if (constantType > 0) {
|
|
17852
17855
|
if (constantType >= 2) {
|
|
17853
|
-
child.codegenNode.patchFlag = -1
|
|
17856
|
+
child.codegenNode.patchFlag = -1;
|
|
17854
17857
|
child.codegenNode = context.hoist(child.codegenNode);
|
|
17855
17858
|
hoistedCount++;
|
|
17856
17859
|
continue;
|
|
@@ -17858,8 +17861,8 @@ function walk$1(node, context, doNotHoistNode = false) {
|
|
|
17858
17861
|
} else {
|
|
17859
17862
|
const codegenNode = child.codegenNode;
|
|
17860
17863
|
if (codegenNode.type === 13) {
|
|
17861
|
-
const flag =
|
|
17862
|
-
if ((
|
|
17864
|
+
const flag = codegenNode.patchFlag;
|
|
17865
|
+
if ((flag === void 0 || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) {
|
|
17863
17866
|
const props = getNodeProps(child);
|
|
17864
17867
|
if (props) {
|
|
17865
17868
|
codegenNode.props = context.hoist(props);
|
|
@@ -17923,8 +17926,7 @@ function getConstantType(node, context) {
|
|
|
17923
17926
|
if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject" && node.tag !== "math") {
|
|
17924
17927
|
return 0;
|
|
17925
17928
|
}
|
|
17926
|
-
|
|
17927
|
-
if (!flag) {
|
|
17929
|
+
if (codegenNode.patchFlag === void 0) {
|
|
17928
17930
|
let returnType2 = 3;
|
|
17929
17931
|
const generatedPropsType = getGeneratedPropsConstantType(node, context);
|
|
17930
17932
|
if (generatedPropsType === 0) {
|
|
@@ -18066,10 +18068,6 @@ function getNodeProps(node) {
|
|
|
18066
18068
|
return codegenNode.props;
|
|
18067
18069
|
}
|
|
18068
18070
|
}
|
|
18069
|
-
function getPatchFlag(node) {
|
|
18070
|
-
const flag = node.patchFlag;
|
|
18071
|
-
return flag ? parseInt(flag, 10) : void 0;
|
|
18072
|
-
}
|
|
18073
18071
|
|
|
18074
18072
|
function createTransformContext(root, {
|
|
18075
18073
|
filename = "",
|
|
@@ -18289,7 +18287,7 @@ function createRootCodegen(root, context) {
|
|
|
18289
18287
|
helper(FRAGMENT),
|
|
18290
18288
|
void 0,
|
|
18291
18289
|
root.children,
|
|
18292
|
-
patchFlag
|
|
18290
|
+
patchFlag,
|
|
18293
18291
|
void 0,
|
|
18294
18292
|
void 0,
|
|
18295
18293
|
true,
|
|
@@ -22268,6 +22266,17 @@ function genVNodeCall(node, context) {
|
|
|
22268
22266
|
disableTracking,
|
|
22269
22267
|
isComponent
|
|
22270
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
|
+
}
|
|
22271
22280
|
if (directives) {
|
|
22272
22281
|
push(helper(WITH_DIRECTIVES) + `(`);
|
|
22273
22282
|
}
|
|
@@ -22280,7 +22289,7 @@ function genVNodeCall(node, context) {
|
|
|
22280
22289
|
const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent);
|
|
22281
22290
|
push(helper(callHelper) + `(`, -2 /* None */, node);
|
|
22282
22291
|
genNodeList(
|
|
22283
|
-
genNullableArgs([tag, props, children,
|
|
22292
|
+
genNullableArgs([tag, props, children, patchFlagString, dynamicProps]),
|
|
22284
22293
|
context
|
|
22285
22294
|
);
|
|
22286
22295
|
push(`)`);
|
|
@@ -22411,15 +22420,16 @@ function genConditionalExpression(node, context) {
|
|
|
22411
22420
|
function genCacheExpression(node, context) {
|
|
22412
22421
|
const { push, helper, indent, deindent, newline } = context;
|
|
22413
22422
|
push(`_cache[${node.index}] || (`);
|
|
22414
|
-
if (node.
|
|
22423
|
+
if (node.isVOnce) {
|
|
22415
22424
|
indent();
|
|
22416
22425
|
push(`${helper(SET_BLOCK_TRACKING)}(-1),`);
|
|
22417
22426
|
newline();
|
|
22427
|
+
push(`(`);
|
|
22418
22428
|
}
|
|
22419
22429
|
push(`_cache[${node.index}] = `);
|
|
22420
22430
|
genNode(node.value, context);
|
|
22421
|
-
if (node.
|
|
22422
|
-
push(
|
|
22431
|
+
if (node.isVOnce) {
|
|
22432
|
+
push(`).cacheIndex = ${node.index},`);
|
|
22423
22433
|
newline();
|
|
22424
22434
|
push(`${helper(SET_BLOCK_TRACKING)}(1),`);
|
|
22425
22435
|
newline();
|
|
@@ -22642,7 +22652,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
22642
22652
|
node2.name = rewriteIdentifier(node2.name, parent, node2);
|
|
22643
22653
|
ids.push(node2);
|
|
22644
22654
|
} else {
|
|
22645
|
-
if (!(needPrefix && isLocal) && parent.type !== "CallExpression" && parent.type !== "NewExpression" && parent.type !== "MemberExpression") {
|
|
22655
|
+
if (!(needPrefix && isLocal) && (!parent || parent.type !== "CallExpression" && parent.type !== "NewExpression" && parent.type !== "MemberExpression")) {
|
|
22646
22656
|
node2.isConstant = true;
|
|
22647
22657
|
}
|
|
22648
22658
|
ids.push(node2);
|
|
@@ -22881,7 +22891,7 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
|
|
|
22881
22891
|
helper(FRAGMENT),
|
|
22882
22892
|
createObjectExpression([keyProperty]),
|
|
22883
22893
|
children,
|
|
22884
|
-
patchFlag
|
|
22894
|
+
patchFlag,
|
|
22885
22895
|
void 0,
|
|
22886
22896
|
void 0,
|
|
22887
22897
|
true,
|
|
@@ -23055,7 +23065,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
23055
23065
|
helper(FRAGMENT),
|
|
23056
23066
|
void 0,
|
|
23057
23067
|
renderExp,
|
|
23058
|
-
fragmentFlag
|
|
23068
|
+
fragmentFlag,
|
|
23059
23069
|
void 0,
|
|
23060
23070
|
void 0,
|
|
23061
23071
|
true,
|
|
@@ -23095,7 +23105,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
23095
23105
|
helper(FRAGMENT),
|
|
23096
23106
|
keyProperty ? createObjectExpression([keyProperty]) : void 0,
|
|
23097
23107
|
node.children,
|
|
23098
|
-
64
|
|
23108
|
+
64,
|
|
23099
23109
|
void 0,
|
|
23100
23110
|
void 0,
|
|
23101
23111
|
true,
|
|
@@ -23541,7 +23551,6 @@ const transformElement = (node, context) => {
|
|
|
23541
23551
|
const isDynamicComponent = isObject$2(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;
|
|
23542
23552
|
let vnodeProps;
|
|
23543
23553
|
let vnodeChildren;
|
|
23544
|
-
let vnodePatchFlag;
|
|
23545
23554
|
let patchFlag = 0;
|
|
23546
23555
|
let vnodeDynamicProps;
|
|
23547
23556
|
let dynamicPropNames;
|
|
@@ -23612,25 +23621,15 @@ const transformElement = (node, context) => {
|
|
|
23612
23621
|
vnodeChildren = node.children;
|
|
23613
23622
|
}
|
|
23614
23623
|
}
|
|
23615
|
-
if (
|
|
23616
|
-
|
|
23617
|
-
if (patchFlag < 0) {
|
|
23618
|
-
vnodePatchFlag = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`;
|
|
23619
|
-
} else {
|
|
23620
|
-
const flagNames = Object.keys(PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => PatchFlagNames[n]).join(`, `);
|
|
23621
|
-
vnodePatchFlag = patchFlag + ` /* ${flagNames} */`;
|
|
23622
|
-
}
|
|
23623
|
-
}
|
|
23624
|
-
if (dynamicPropNames && dynamicPropNames.length) {
|
|
23625
|
-
vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
|
|
23626
|
-
}
|
|
23624
|
+
if (dynamicPropNames && dynamicPropNames.length) {
|
|
23625
|
+
vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
|
|
23627
23626
|
}
|
|
23628
23627
|
node.codegenNode = createVNodeCall(
|
|
23629
23628
|
context,
|
|
23630
23629
|
vnodeTag,
|
|
23631
23630
|
vnodeProps,
|
|
23632
23631
|
vnodeChildren,
|
|
23633
|
-
|
|
23632
|
+
patchFlag === 0 ? void 0 : patchFlag,
|
|
23634
23633
|
vnodeDynamicProps,
|
|
23635
23634
|
vnodeDirectives,
|
|
23636
23635
|
!!shouldUseBlock,
|
|
@@ -36527,7 +36526,7 @@ let Root$2 = root$2;
|
|
|
36527
36526
|
|
|
36528
36527
|
let Processor$1 = class Processor {
|
|
36529
36528
|
constructor(plugins = []) {
|
|
36530
|
-
this.version = '8.4.
|
|
36529
|
+
this.version = '8.4.39';
|
|
36531
36530
|
this.plugins = this.normalize(plugins);
|
|
36532
36531
|
}
|
|
36533
36532
|
|
|
@@ -45584,6 +45583,7 @@ function innerResolveTypeElements(ctx, node, scope, typeParameters) {
|
|
|
45584
45583
|
case "TSInterfaceDeclaration":
|
|
45585
45584
|
return resolveInterfaceMembers(ctx, node, scope, typeParameters);
|
|
45586
45585
|
case "TSTypeAliasDeclaration":
|
|
45586
|
+
case "TSTypeAnnotation":
|
|
45587
45587
|
case "TSParenthesizedType":
|
|
45588
45588
|
return resolveTypeElements(
|
|
45589
45589
|
ctx,
|
|
@@ -48435,7 +48435,7 @@ var __spreadValues = (a, b) => {
|
|
|
48435
48435
|
}
|
|
48436
48436
|
return a;
|
|
48437
48437
|
};
|
|
48438
|
-
const version = "3.4.
|
|
48438
|
+
const version = "3.4.32";
|
|
48439
48439
|
const parseCache = parseCache$1;
|
|
48440
48440
|
const errorMessages = __spreadValues(__spreadValues({}, errorMessages$1), DOMErrorMessages);
|
|
48441
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.
|
|
3
|
+
"version": "3.4.32",
|
|
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.
|
|
48
|
+
"postcss": "^8.4.39",
|
|
49
49
|
"source-map-js": "^1.2.0",
|
|
50
|
-
"@vue/compiler-core": "3.4.
|
|
51
|
-
"@vue/
|
|
52
|
-
"@vue/compiler-ssr": "3.4.
|
|
53
|
-
"@vue/
|
|
50
|
+
"@vue/compiler-core": "3.4.32",
|
|
51
|
+
"@vue/shared": "3.4.32",
|
|
52
|
+
"@vue/compiler-ssr": "3.4.32",
|
|
53
|
+
"@vue/compiler-dom": "3.4.32"
|
|
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.
|
|
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.
|
|
65
|
+
"sass": "^1.77.8"
|
|
66
66
|
}
|
|
67
67
|
}
|