@vue/compiler-core 3.5.0 → 3.5.2
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.
|
|
2
|
+
* @vue/compiler-core v3.5.2
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -2355,7 +2355,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
2355
2355
|
rawName: raw,
|
|
2356
2356
|
exp: void 0,
|
|
2357
2357
|
arg: void 0,
|
|
2358
|
-
modifiers: raw === "." ? ["prop"] : [],
|
|
2358
|
+
modifiers: raw === "." ? [createSimpleExpression("prop")] : [],
|
|
2359
2359
|
loc: getLoc(start)
|
|
2360
2360
|
};
|
|
2361
2361
|
if (name === "pre") {
|
|
@@ -2398,7 +2398,8 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
2398
2398
|
setLocEnd(arg.loc, end);
|
|
2399
2399
|
}
|
|
2400
2400
|
} else {
|
|
2401
|
-
|
|
2401
|
+
const exp = createSimpleExpression(mod, true, getLoc(start, end));
|
|
2402
|
+
currentProp.modifiers.push(exp);
|
|
2402
2403
|
}
|
|
2403
2404
|
},
|
|
2404
2405
|
onattribdata(start, end) {
|
|
@@ -2464,7 +2465,9 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
2464
2465
|
currentProp.forParseResult = parseForExpression(currentProp.exp);
|
|
2465
2466
|
}
|
|
2466
2467
|
let syncIndex = -1;
|
|
2467
|
-
if (currentProp.name === "bind" && (syncIndex = currentProp.modifiers.
|
|
2468
|
+
if (currentProp.name === "bind" && (syncIndex = currentProp.modifiers.findIndex(
|
|
2469
|
+
(mod) => mod.content === "sync"
|
|
2470
|
+
)) > -1 && checkCompatEnabled(
|
|
2468
2471
|
"COMPILER_V_BIND_SYNC",
|
|
2469
2472
|
currentOptions,
|
|
2470
2473
|
currentProp.loc,
|
|
@@ -3595,7 +3598,7 @@ function createStructuralDirectiveTransform(name, fn) {
|
|
|
3595
3598
|
};
|
|
3596
3599
|
}
|
|
3597
3600
|
|
|
3598
|
-
const PURE_ANNOTATION =
|
|
3601
|
+
const PURE_ANNOTATION = `/*@__PURE__*/`;
|
|
3599
3602
|
const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;
|
|
3600
3603
|
function createCodegenContext(ast, {
|
|
3601
3604
|
mode = "function",
|
|
@@ -4856,7 +4859,7 @@ const transformBind = (dir, _node, context) => {
|
|
|
4856
4859
|
} else if (!arg.isStatic) {
|
|
4857
4860
|
arg.content = `${arg.content} || ""`;
|
|
4858
4861
|
}
|
|
4859
|
-
if (modifiers.
|
|
4862
|
+
if (modifiers.some((mod) => mod.content === "camel")) {
|
|
4860
4863
|
if (arg.type === 4) {
|
|
4861
4864
|
if (arg.isStatic) {
|
|
4862
4865
|
arg.content = shared.camelize(arg.content);
|
|
@@ -4869,10 +4872,10 @@ const transformBind = (dir, _node, context) => {
|
|
|
4869
4872
|
}
|
|
4870
4873
|
}
|
|
4871
4874
|
if (!context.inSSR) {
|
|
4872
|
-
if (modifiers.
|
|
4875
|
+
if (modifiers.some((mod) => mod.content === "prop")) {
|
|
4873
4876
|
injectPrefix(arg, ".");
|
|
4874
4877
|
}
|
|
4875
|
-
if (modifiers.
|
|
4878
|
+
if (modifiers.some((mod) => mod.content === "attr")) {
|
|
4876
4879
|
injectPrefix(arg, "^");
|
|
4877
4880
|
}
|
|
4878
4881
|
}
|
|
@@ -5813,7 +5816,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5813
5816
|
}
|
|
5814
5817
|
continue;
|
|
5815
5818
|
}
|
|
5816
|
-
if (isVBind && modifiers.
|
|
5819
|
+
if (isVBind && modifiers.some((mod) => mod.content === "prop")) {
|
|
5817
5820
|
patchFlag |= 32;
|
|
5818
5821
|
}
|
|
5819
5822
|
const directiveTransform = context.directiveTransforms[name];
|
|
@@ -6379,7 +6382,7 @@ const transformModel = (dir, node, context) => {
|
|
|
6379
6382
|
props[1].value = context.cache(props[1].value);
|
|
6380
6383
|
}
|
|
6381
6384
|
if (dir.modifiers.length && node.tagType === 1) {
|
|
6382
|
-
const modifiers = dir.modifiers.map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
|
|
6385
|
+
const modifiers = dir.modifiers.map((m) => m.content).map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
|
|
6383
6386
|
const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
|
|
6384
6387
|
props.push(
|
|
6385
6388
|
createObjectProperty(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-core v3.5.
|
|
2
|
+
* @vue/compiler-core v3.5.2
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -2351,7 +2351,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
2351
2351
|
rawName: raw,
|
|
2352
2352
|
exp: void 0,
|
|
2353
2353
|
arg: void 0,
|
|
2354
|
-
modifiers: raw === "." ? ["prop"] : [],
|
|
2354
|
+
modifiers: raw === "." ? [createSimpleExpression("prop")] : [],
|
|
2355
2355
|
loc: getLoc(start)
|
|
2356
2356
|
};
|
|
2357
2357
|
if (name === "pre") {
|
|
@@ -2394,7 +2394,8 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
2394
2394
|
setLocEnd(arg.loc, end);
|
|
2395
2395
|
}
|
|
2396
2396
|
} else {
|
|
2397
|
-
|
|
2397
|
+
const exp = createSimpleExpression(mod, true, getLoc(start, end));
|
|
2398
|
+
currentProp.modifiers.push(exp);
|
|
2398
2399
|
}
|
|
2399
2400
|
},
|
|
2400
2401
|
onattribdata(start, end) {
|
|
@@ -2460,7 +2461,9 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
2460
2461
|
currentProp.forParseResult = parseForExpression(currentProp.exp);
|
|
2461
2462
|
}
|
|
2462
2463
|
let syncIndex = -1;
|
|
2463
|
-
if (currentProp.name === "bind" && (syncIndex = currentProp.modifiers.
|
|
2464
|
+
if (currentProp.name === "bind" && (syncIndex = currentProp.modifiers.findIndex(
|
|
2465
|
+
(mod) => mod.content === "sync"
|
|
2466
|
+
)) > -1 && checkCompatEnabled(
|
|
2464
2467
|
"COMPILER_V_BIND_SYNC",
|
|
2465
2468
|
currentOptions,
|
|
2466
2469
|
currentProp.loc,
|
|
@@ -3536,7 +3539,7 @@ function createStructuralDirectiveTransform(name, fn) {
|
|
|
3536
3539
|
};
|
|
3537
3540
|
}
|
|
3538
3541
|
|
|
3539
|
-
const PURE_ANNOTATION =
|
|
3542
|
+
const PURE_ANNOTATION = `/*@__PURE__*/`;
|
|
3540
3543
|
const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;
|
|
3541
3544
|
function createCodegenContext(ast, {
|
|
3542
3545
|
mode = "function",
|
|
@@ -4769,7 +4772,7 @@ const transformBind = (dir, _node, context) => {
|
|
|
4769
4772
|
} else if (!arg.isStatic) {
|
|
4770
4773
|
arg.content = `${arg.content} || ""`;
|
|
4771
4774
|
}
|
|
4772
|
-
if (modifiers.
|
|
4775
|
+
if (modifiers.some((mod) => mod.content === "camel")) {
|
|
4773
4776
|
if (arg.type === 4) {
|
|
4774
4777
|
if (arg.isStatic) {
|
|
4775
4778
|
arg.content = shared.camelize(arg.content);
|
|
@@ -4782,10 +4785,10 @@ const transformBind = (dir, _node, context) => {
|
|
|
4782
4785
|
}
|
|
4783
4786
|
}
|
|
4784
4787
|
if (!context.inSSR) {
|
|
4785
|
-
if (modifiers.
|
|
4788
|
+
if (modifiers.some((mod) => mod.content === "prop")) {
|
|
4786
4789
|
injectPrefix(arg, ".");
|
|
4787
4790
|
}
|
|
4788
|
-
if (modifiers.
|
|
4791
|
+
if (modifiers.some((mod) => mod.content === "attr")) {
|
|
4789
4792
|
injectPrefix(arg, "^");
|
|
4790
4793
|
}
|
|
4791
4794
|
}
|
|
@@ -5696,7 +5699,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5696
5699
|
}
|
|
5697
5700
|
continue;
|
|
5698
5701
|
}
|
|
5699
|
-
if (isVBind && modifiers.
|
|
5702
|
+
if (isVBind && modifiers.some((mod) => mod.content === "prop")) {
|
|
5700
5703
|
patchFlag |= 32;
|
|
5701
5704
|
}
|
|
5702
5705
|
const directiveTransform = context.directiveTransforms[name];
|
|
@@ -6259,7 +6262,7 @@ const transformModel = (dir, node, context) => {
|
|
|
6259
6262
|
props[1].value = context.cache(props[1].value);
|
|
6260
6263
|
}
|
|
6261
6264
|
if (dir.modifiers.length && node.tagType === 1) {
|
|
6262
|
-
const modifiers = dir.modifiers.map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
|
|
6265
|
+
const modifiers = dir.modifiers.map((m) => m.content).map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
|
|
6263
6266
|
const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
|
|
6264
6267
|
props.push(
|
|
6265
6268
|
createObjectProperty(
|
package/dist/compiler-core.d.ts
CHANGED
|
@@ -272,7 +272,7 @@ export interface DirectiveNode extends Node {
|
|
|
272
272
|
rawName?: string;
|
|
273
273
|
exp: ExpressionNode | undefined;
|
|
274
274
|
arg: ExpressionNode | undefined;
|
|
275
|
-
modifiers:
|
|
275
|
+
modifiers: SimpleExpressionNode[];
|
|
276
276
|
/**
|
|
277
277
|
* optional property to cache the expression parse result for v-for
|
|
278
278
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-core v3.5.
|
|
2
|
+
* @vue/compiler-core v3.5.2
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -2038,7 +2038,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
2038
2038
|
rawName: raw,
|
|
2039
2039
|
exp: void 0,
|
|
2040
2040
|
arg: void 0,
|
|
2041
|
-
modifiers: raw === "." ? ["prop"] : [],
|
|
2041
|
+
modifiers: raw === "." ? [createSimpleExpression("prop")] : [],
|
|
2042
2042
|
loc: getLoc(start)
|
|
2043
2043
|
};
|
|
2044
2044
|
if (name === "pre") {
|
|
@@ -2081,7 +2081,8 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
2081
2081
|
setLocEnd(arg.loc, end);
|
|
2082
2082
|
}
|
|
2083
2083
|
} else {
|
|
2084
|
-
|
|
2084
|
+
const exp = createSimpleExpression(mod, true, getLoc(start, end));
|
|
2085
|
+
currentProp.modifiers.push(exp);
|
|
2085
2086
|
}
|
|
2086
2087
|
},
|
|
2087
2088
|
onattribdata(start, end) {
|
|
@@ -2144,7 +2145,9 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
2144
2145
|
currentProp.forParseResult = parseForExpression(currentProp.exp);
|
|
2145
2146
|
}
|
|
2146
2147
|
let syncIndex = -1;
|
|
2147
|
-
if (currentProp.name === "bind" && (syncIndex = currentProp.modifiers.
|
|
2148
|
+
if (currentProp.name === "bind" && (syncIndex = currentProp.modifiers.findIndex(
|
|
2149
|
+
(mod) => mod.content === "sync"
|
|
2150
|
+
)) > -1 && checkCompatEnabled(
|
|
2148
2151
|
"COMPILER_V_BIND_SYNC",
|
|
2149
2152
|
currentOptions,
|
|
2150
2153
|
currentProp.loc,
|
|
@@ -3232,7 +3235,7 @@ function createStructuralDirectiveTransform(name, fn) {
|
|
|
3232
3235
|
};
|
|
3233
3236
|
}
|
|
3234
3237
|
|
|
3235
|
-
const PURE_ANNOTATION =
|
|
3238
|
+
const PURE_ANNOTATION = `/*@__PURE__*/`;
|
|
3236
3239
|
const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;
|
|
3237
3240
|
function createCodegenContext(ast, {
|
|
3238
3241
|
mode = "function",
|
|
@@ -4143,7 +4146,7 @@ const transformBind = (dir, _node, context) => {
|
|
|
4143
4146
|
} else if (!arg.isStatic) {
|
|
4144
4147
|
arg.content = `${arg.content} || ""`;
|
|
4145
4148
|
}
|
|
4146
|
-
if (modifiers.
|
|
4149
|
+
if (modifiers.some((mod) => mod.content === "camel")) {
|
|
4147
4150
|
if (arg.type === 4) {
|
|
4148
4151
|
if (arg.isStatic) {
|
|
4149
4152
|
arg.content = camelize(arg.content);
|
|
@@ -4156,10 +4159,10 @@ const transformBind = (dir, _node, context) => {
|
|
|
4156
4159
|
}
|
|
4157
4160
|
}
|
|
4158
4161
|
if (!context.inSSR) {
|
|
4159
|
-
if (modifiers.
|
|
4162
|
+
if (modifiers.some((mod) => mod.content === "prop")) {
|
|
4160
4163
|
injectPrefix(arg, ".");
|
|
4161
4164
|
}
|
|
4162
|
-
if (modifiers.
|
|
4165
|
+
if (modifiers.some((mod) => mod.content === "attr")) {
|
|
4163
4166
|
injectPrefix(arg, "^");
|
|
4164
4167
|
}
|
|
4165
4168
|
}
|
|
@@ -4991,7 +4994,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
4991
4994
|
}
|
|
4992
4995
|
continue;
|
|
4993
4996
|
}
|
|
4994
|
-
if (isVBind && modifiers.
|
|
4997
|
+
if (isVBind && modifiers.some((mod) => mod.content === "prop")) {
|
|
4995
4998
|
patchFlag |= 32;
|
|
4996
4999
|
}
|
|
4997
5000
|
const directiveTransform = context.directiveTransforms[name];
|
|
@@ -5505,7 +5508,7 @@ const transformModel = (dir, node, context) => {
|
|
|
5505
5508
|
createObjectProperty(eventName, assignmentExp)
|
|
5506
5509
|
];
|
|
5507
5510
|
if (dir.modifiers.length && node.tagType === 1) {
|
|
5508
|
-
const modifiers = dir.modifiers.map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
|
|
5511
|
+
const modifiers = dir.modifiers.map((m) => m.content).map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
|
|
5509
5512
|
const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
|
|
5510
5513
|
props.push(
|
|
5511
5514
|
createObjectProperty(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/compiler-core",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.2",
|
|
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.0",
|
|
53
|
-
"@vue/shared": "3.5.
|
|
53
|
+
"@vue/shared": "3.5.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@babel/types": "^7.25.2"
|