@vue/compiler-core 3.2.25 → 3.2.29
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.
|
@@ -1310,7 +1310,7 @@ function parseAttributes(context, type) {
|
|
|
1310
1310
|
}
|
|
1311
1311
|
const attr = parseAttribute(context, attributeNames);
|
|
1312
1312
|
// Trim whitespace between class
|
|
1313
|
-
// https://github.com/vuejs/
|
|
1313
|
+
// https://github.com/vuejs/core/issues/4251
|
|
1314
1314
|
if (attr.type === 6 /* ATTRIBUTE */ &&
|
|
1315
1315
|
attr.value &&
|
|
1316
1316
|
attr.name === 'class') {
|
|
@@ -1546,7 +1546,7 @@ function parseTextData(context, length, mode) {
|
|
|
1546
1546
|
advanceBy(context, length);
|
|
1547
1547
|
if (mode === 2 /* RAWTEXT */ ||
|
|
1548
1548
|
mode === 3 /* CDATA */ ||
|
|
1549
|
-
rawText.
|
|
1549
|
+
!rawText.includes('&')) {
|
|
1550
1550
|
return rawText;
|
|
1551
1551
|
}
|
|
1552
1552
|
else {
|
|
@@ -3288,7 +3288,7 @@ function isReferenced(node, parent, grandparent) {
|
|
|
3288
3288
|
// no: NODE.target
|
|
3289
3289
|
case 'MetaProperty':
|
|
3290
3290
|
return false;
|
|
3291
|
-
// yes: type X = {
|
|
3291
|
+
// yes: type X = { someProperty: NODE }
|
|
3292
3292
|
// no: type X = { NODE: OtherType }
|
|
3293
3293
|
case 'ObjectTypeProperty':
|
|
3294
3294
|
return parent.key !== node;
|
|
@@ -3799,6 +3799,7 @@ const transformFor = createStructuralDirectiveTransform('for', (node, dir, conte
|
|
|
3799
3799
|
const renderExp = createCallExpression(helper(RENDER_LIST), [
|
|
3800
3800
|
forNode.source
|
|
3801
3801
|
]);
|
|
3802
|
+
const isTemplate = isTemplateNode(node);
|
|
3802
3803
|
const memo = findDir(node, 'memo');
|
|
3803
3804
|
const keyProp = findProp(node, `key`);
|
|
3804
3805
|
const keyExp = keyProp &&
|
|
@@ -3806,15 +3807,17 @@ const transformFor = createStructuralDirectiveTransform('for', (node, dir, conte
|
|
|
3806
3807
|
? createSimpleExpression(keyProp.value.content, true)
|
|
3807
3808
|
: keyProp.exp);
|
|
3808
3809
|
const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;
|
|
3809
|
-
if (
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
//
|
|
3813
|
-
//
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
keyProperty
|
|
3810
|
+
if (isTemplate) {
|
|
3811
|
+
// #2085 / #5288 process :key and v-memo expressions need to be
|
|
3812
|
+
// processed on `<template v-for>`. In this case the node is discarded
|
|
3813
|
+
// and never traversed so its binding expressions won't be processed
|
|
3814
|
+
// by the normal transforms.
|
|
3815
|
+
if (memo) {
|
|
3816
|
+
memo.exp = processExpression(memo.exp, context);
|
|
3817
|
+
}
|
|
3818
|
+
if (keyProperty && keyProp.type !== 6 /* ATTRIBUTE */) {
|
|
3819
|
+
keyProperty.value = processExpression(keyProperty.value, context);
|
|
3820
|
+
}
|
|
3818
3821
|
}
|
|
3819
3822
|
const isStableFragment = forNode.source.type === 4 /* SIMPLE_EXPRESSION */ &&
|
|
3820
3823
|
forNode.source.constType > 0 /* NOT_CONSTANT */;
|
|
@@ -3828,7 +3831,6 @@ const transformFor = createStructuralDirectiveTransform('for', (node, dir, conte
|
|
|
3828
3831
|
return () => {
|
|
3829
3832
|
// finish the codegen now that all children have been traversed
|
|
3830
3833
|
let childBlock;
|
|
3831
|
-
const isTemplate = isTemplateNode(node);
|
|
3832
3834
|
const { children } = forNode;
|
|
3833
3835
|
// check <template v-for> key placement
|
|
3834
3836
|
if (isTemplate) {
|
|
@@ -1285,7 +1285,7 @@ function parseAttributes(context, type) {
|
|
|
1285
1285
|
}
|
|
1286
1286
|
const attr = parseAttribute(context, attributeNames);
|
|
1287
1287
|
// Trim whitespace between class
|
|
1288
|
-
// https://github.com/vuejs/
|
|
1288
|
+
// https://github.com/vuejs/core/issues/4251
|
|
1289
1289
|
if (attr.type === 6 /* ATTRIBUTE */ &&
|
|
1290
1290
|
attr.value &&
|
|
1291
1291
|
attr.name === 'class') {
|
|
@@ -1518,7 +1518,7 @@ function parseTextData(context, length, mode) {
|
|
|
1518
1518
|
advanceBy(context, length);
|
|
1519
1519
|
if (mode === 2 /* RAWTEXT */ ||
|
|
1520
1520
|
mode === 3 /* CDATA */ ||
|
|
1521
|
-
rawText.
|
|
1521
|
+
!rawText.includes('&')) {
|
|
1522
1522
|
return rawText;
|
|
1523
1523
|
}
|
|
1524
1524
|
else {
|
|
@@ -3225,7 +3225,7 @@ function isReferenced(node, parent, grandparent) {
|
|
|
3225
3225
|
// no: NODE.target
|
|
3226
3226
|
case 'MetaProperty':
|
|
3227
3227
|
return false;
|
|
3228
|
-
// yes: type X = {
|
|
3228
|
+
// yes: type X = { someProperty: NODE }
|
|
3229
3229
|
// no: type X = { NODE: OtherType }
|
|
3230
3230
|
case 'ObjectTypeProperty':
|
|
3231
3231
|
return parent.key !== node;
|
|
@@ -3717,6 +3717,7 @@ const transformFor = createStructuralDirectiveTransform('for', (node, dir, conte
|
|
|
3717
3717
|
const renderExp = createCallExpression(helper(RENDER_LIST), [
|
|
3718
3718
|
forNode.source
|
|
3719
3719
|
]);
|
|
3720
|
+
const isTemplate = isTemplateNode(node);
|
|
3720
3721
|
const memo = findDir(node, 'memo');
|
|
3721
3722
|
const keyProp = findProp(node, `key`);
|
|
3722
3723
|
const keyExp = keyProp &&
|
|
@@ -3724,15 +3725,17 @@ const transformFor = createStructuralDirectiveTransform('for', (node, dir, conte
|
|
|
3724
3725
|
? createSimpleExpression(keyProp.value.content, true)
|
|
3725
3726
|
: keyProp.exp);
|
|
3726
3727
|
const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;
|
|
3727
|
-
if (
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
//
|
|
3731
|
-
//
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
keyProperty
|
|
3728
|
+
if (isTemplate) {
|
|
3729
|
+
// #2085 / #5288 process :key and v-memo expressions need to be
|
|
3730
|
+
// processed on `<template v-for>`. In this case the node is discarded
|
|
3731
|
+
// and never traversed so its binding expressions won't be processed
|
|
3732
|
+
// by the normal transforms.
|
|
3733
|
+
if (memo) {
|
|
3734
|
+
memo.exp = processExpression(memo.exp, context);
|
|
3735
|
+
}
|
|
3736
|
+
if (keyProperty && keyProp.type !== 6 /* ATTRIBUTE */) {
|
|
3737
|
+
keyProperty.value = processExpression(keyProperty.value, context);
|
|
3738
|
+
}
|
|
3736
3739
|
}
|
|
3737
3740
|
const isStableFragment = forNode.source.type === 4 /* SIMPLE_EXPRESSION */ &&
|
|
3738
3741
|
forNode.source.constType > 0 /* NOT_CONSTANT */;
|
|
@@ -3746,7 +3749,6 @@ const transformFor = createStructuralDirectiveTransform('for', (node, dir, conte
|
|
|
3746
3749
|
return () => {
|
|
3747
3750
|
// finish the codegen now that all children have been traversed
|
|
3748
3751
|
let childBlock;
|
|
3749
|
-
const isTemplate = isTemplateNode(node);
|
|
3750
3752
|
const { children } = forNode;
|
|
3751
3753
|
// check <template v-for> key placement
|
|
3752
3754
|
if (isTemplate) {
|
|
@@ -1295,7 +1295,7 @@ function parseAttributes(context, type) {
|
|
|
1295
1295
|
}
|
|
1296
1296
|
const attr = parseAttribute(context, attributeNames);
|
|
1297
1297
|
// Trim whitespace between class
|
|
1298
|
-
// https://github.com/vuejs/
|
|
1298
|
+
// https://github.com/vuejs/core/issues/4251
|
|
1299
1299
|
if (attr.type === 6 /* ATTRIBUTE */ &&
|
|
1300
1300
|
attr.value &&
|
|
1301
1301
|
attr.name === 'class') {
|
|
@@ -1531,7 +1531,7 @@ function parseTextData(context, length, mode) {
|
|
|
1531
1531
|
advanceBy(context, length);
|
|
1532
1532
|
if (mode === 2 /* RAWTEXT */ ||
|
|
1533
1533
|
mode === 3 /* CDATA */ ||
|
|
1534
|
-
rawText.
|
|
1534
|
+
!rawText.includes('&')) {
|
|
1535
1535
|
return rawText;
|
|
1536
1536
|
}
|
|
1537
1537
|
else {
|
|
@@ -3155,6 +3155,7 @@ const transformFor = createStructuralDirectiveTransform('for', (node, dir, conte
|
|
|
3155
3155
|
const renderExp = createCallExpression(helper(RENDER_LIST), [
|
|
3156
3156
|
forNode.source
|
|
3157
3157
|
]);
|
|
3158
|
+
const isTemplate = isTemplateNode(node);
|
|
3158
3159
|
const memo = findDir(node, 'memo');
|
|
3159
3160
|
const keyProp = findProp(node, `key`);
|
|
3160
3161
|
const keyExp = keyProp &&
|
|
@@ -3174,7 +3175,6 @@ const transformFor = createStructuralDirectiveTransform('for', (node, dir, conte
|
|
|
3174
3175
|
return () => {
|
|
3175
3176
|
// finish the codegen now that all children have been traversed
|
|
3176
3177
|
let childBlock;
|
|
3177
|
-
const isTemplate = isTemplateNode(node);
|
|
3178
3178
|
const { children } = forNode;
|
|
3179
3179
|
// check <template v-for> key placement
|
|
3180
3180
|
if (((process.env.NODE_ENV !== 'production') || !true) && isTemplate) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/compiler-core",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.29",
|
|
4
4
|
"description": "@vue/compiler-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/compiler-core.esm-bundler.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
22
|
-
"url": "git+https://github.com/vuejs/
|
|
22
|
+
"url": "git+https://github.com/vuejs/core.git",
|
|
23
23
|
"directory": "packages/compiler-core"
|
|
24
24
|
},
|
|
25
25
|
"keywords": [
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"author": "Evan You",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"bugs": {
|
|
31
|
-
"url": "https://github.com/vuejs/
|
|
31
|
+
"url": "https://github.com/vuejs/core/issues"
|
|
32
32
|
},
|
|
33
|
-
"homepage": "https://github.com/vuejs/
|
|
33
|
+
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@vue/shared": "3.2.
|
|
35
|
+
"@vue/shared": "3.2.29",
|
|
36
36
|
"@babel/parser": "^7.16.4",
|
|
37
37
|
"estree-walker": "^2.0.2",
|
|
38
38
|
"source-map": "^0.6.1"
|