@vue/compiler-core 3.5.15 → 3.5.17
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-core.cjs.js +12 -12
- package/dist/compiler-core.cjs.prod.js +12 -12
- package/dist/compiler-core.esm-bundler.js +13 -13
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-core v3.5.
|
|
2
|
+
* @vue/compiler-core v3.5.17
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -1063,7 +1063,7 @@ class Tokenizer {
|
|
|
1063
1063
|
this.buffer = input;
|
|
1064
1064
|
while (this.index < this.buffer.length) {
|
|
1065
1065
|
const c = this.buffer.charCodeAt(this.index);
|
|
1066
|
-
if (c === 10) {
|
|
1066
|
+
if (c === 10 && this.state !== 33) {
|
|
1067
1067
|
this.newlines.push(this.index);
|
|
1068
1068
|
}
|
|
1069
1069
|
switch (this.state) {
|
|
@@ -2813,7 +2813,7 @@ function isUpperCase(c) {
|
|
|
2813
2813
|
return c > 64 && c < 91;
|
|
2814
2814
|
}
|
|
2815
2815
|
const windowsNewlineRE = /\r\n/g;
|
|
2816
|
-
function condenseWhitespace(nodes
|
|
2816
|
+
function condenseWhitespace(nodes) {
|
|
2817
2817
|
const shouldCondense = currentOptions.whitespace !== "preserve";
|
|
2818
2818
|
let removedWhitespace = false;
|
|
2819
2819
|
for (let i = 0; i < nodes.length; i++) {
|
|
@@ -2999,12 +2999,12 @@ function cacheStatic(root, context) {
|
|
|
2999
2999
|
context,
|
|
3000
3000
|
// Root node is unfortunately non-hoistable due to potential parent
|
|
3001
3001
|
// fallthrough attributes.
|
|
3002
|
-
|
|
3002
|
+
!!getSingleElementRoot(root)
|
|
3003
3003
|
);
|
|
3004
3004
|
}
|
|
3005
|
-
function
|
|
3006
|
-
const
|
|
3007
|
-
return children.length === 1 &&
|
|
3005
|
+
function getSingleElementRoot(root) {
|
|
3006
|
+
const children = root.children.filter((x) => x.type !== 3);
|
|
3007
|
+
return children.length === 1 && children[0].type === 1 && !isSlotOutlet(children[0]) ? children[0] : null;
|
|
3008
3008
|
}
|
|
3009
3009
|
function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
3010
3010
|
const { children } = node;
|
|
@@ -3498,15 +3498,15 @@ function createRootCodegen(root, context) {
|
|
|
3498
3498
|
const { helper } = context;
|
|
3499
3499
|
const { children } = root;
|
|
3500
3500
|
if (children.length === 1) {
|
|
3501
|
-
const
|
|
3502
|
-
if (
|
|
3503
|
-
const codegenNode =
|
|
3501
|
+
const singleElementRootChild = getSingleElementRoot(root);
|
|
3502
|
+
if (singleElementRootChild && singleElementRootChild.codegenNode) {
|
|
3503
|
+
const codegenNode = singleElementRootChild.codegenNode;
|
|
3504
3504
|
if (codegenNode.type === 13) {
|
|
3505
3505
|
convertToBlock(codegenNode, context);
|
|
3506
3506
|
}
|
|
3507
3507
|
root.codegenNode = codegenNode;
|
|
3508
3508
|
} else {
|
|
3509
|
-
root.codegenNode =
|
|
3509
|
+
root.codegenNode = children[0];
|
|
3510
3510
|
}
|
|
3511
3511
|
} else if (children.length > 1) {
|
|
3512
3512
|
let patchFlag = 64;
|
|
@@ -5290,7 +5290,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
5290
5290
|
let prev;
|
|
5291
5291
|
while (j--) {
|
|
5292
5292
|
prev = children[j];
|
|
5293
|
-
if (prev.type !== 3) {
|
|
5293
|
+
if (prev.type !== 3 && isNonWhitespaceContent(prev)) {
|
|
5294
5294
|
break;
|
|
5295
5295
|
}
|
|
5296
5296
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-core v3.5.
|
|
2
|
+
* @vue/compiler-core v3.5.17
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -1063,7 +1063,7 @@ class Tokenizer {
|
|
|
1063
1063
|
this.buffer = input;
|
|
1064
1064
|
while (this.index < this.buffer.length) {
|
|
1065
1065
|
const c = this.buffer.charCodeAt(this.index);
|
|
1066
|
-
if (c === 10) {
|
|
1066
|
+
if (c === 10 && this.state !== 33) {
|
|
1067
1067
|
this.newlines.push(this.index);
|
|
1068
1068
|
}
|
|
1069
1069
|
switch (this.state) {
|
|
@@ -2779,7 +2779,7 @@ function isUpperCase(c) {
|
|
|
2779
2779
|
return c > 64 && c < 91;
|
|
2780
2780
|
}
|
|
2781
2781
|
const windowsNewlineRE = /\r\n/g;
|
|
2782
|
-
function condenseWhitespace(nodes
|
|
2782
|
+
function condenseWhitespace(nodes) {
|
|
2783
2783
|
const shouldCondense = currentOptions.whitespace !== "preserve";
|
|
2784
2784
|
let removedWhitespace = false;
|
|
2785
2785
|
for (let i = 0; i < nodes.length; i++) {
|
|
@@ -2958,12 +2958,12 @@ function cacheStatic(root, context) {
|
|
|
2958
2958
|
context,
|
|
2959
2959
|
// Root node is unfortunately non-hoistable due to potential parent
|
|
2960
2960
|
// fallthrough attributes.
|
|
2961
|
-
|
|
2961
|
+
!!getSingleElementRoot(root)
|
|
2962
2962
|
);
|
|
2963
2963
|
}
|
|
2964
|
-
function
|
|
2965
|
-
const
|
|
2966
|
-
return children.length === 1 &&
|
|
2964
|
+
function getSingleElementRoot(root) {
|
|
2965
|
+
const children = root.children.filter((x) => x.type !== 3);
|
|
2966
|
+
return children.length === 1 && children[0].type === 1 && !isSlotOutlet(children[0]) ? children[0] : null;
|
|
2967
2967
|
}
|
|
2968
2968
|
function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
2969
2969
|
const { children } = node;
|
|
@@ -3443,15 +3443,15 @@ function createRootCodegen(root, context) {
|
|
|
3443
3443
|
const { helper } = context;
|
|
3444
3444
|
const { children } = root;
|
|
3445
3445
|
if (children.length === 1) {
|
|
3446
|
-
const
|
|
3447
|
-
if (
|
|
3448
|
-
const codegenNode =
|
|
3446
|
+
const singleElementRootChild = getSingleElementRoot(root);
|
|
3447
|
+
if (singleElementRootChild && singleElementRootChild.codegenNode) {
|
|
3448
|
+
const codegenNode = singleElementRootChild.codegenNode;
|
|
3449
3449
|
if (codegenNode.type === 13) {
|
|
3450
3450
|
convertToBlock(codegenNode, context);
|
|
3451
3451
|
}
|
|
3452
3452
|
root.codegenNode = codegenNode;
|
|
3453
3453
|
} else {
|
|
3454
|
-
root.codegenNode =
|
|
3454
|
+
root.codegenNode = children[0];
|
|
3455
3455
|
}
|
|
3456
3456
|
} else if (children.length > 1) {
|
|
3457
3457
|
let patchFlag = 64;
|
|
@@ -5205,7 +5205,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
5205
5205
|
let prev;
|
|
5206
5206
|
while (j--) {
|
|
5207
5207
|
prev = children[j];
|
|
5208
|
-
if (prev.type !== 3) {
|
|
5208
|
+
if (prev.type !== 3 && isNonWhitespaceContent(prev)) {
|
|
5209
5209
|
break;
|
|
5210
5210
|
}
|
|
5211
5211
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-core v3.5.
|
|
2
|
+
* @vue/compiler-core v3.5.17
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -1023,7 +1023,7 @@ class Tokenizer {
|
|
|
1023
1023
|
this.buffer = input;
|
|
1024
1024
|
while (this.index < this.buffer.length) {
|
|
1025
1025
|
const c = this.buffer.charCodeAt(this.index);
|
|
1026
|
-
if (c === 10) {
|
|
1026
|
+
if (c === 10 && this.state !== 33) {
|
|
1027
1027
|
this.newlines.push(this.index);
|
|
1028
1028
|
}
|
|
1029
1029
|
switch (this.state) {
|
|
@@ -1535,7 +1535,7 @@ function isForStatement(stmt) {
|
|
|
1535
1535
|
}
|
|
1536
1536
|
function walkForStatement(stmt, isVar, onIdent) {
|
|
1537
1537
|
const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
|
|
1538
|
-
if (variable && variable.type === "VariableDeclaration" && (variable.kind === "var" ? isVar :
|
|
1538
|
+
if (variable && variable.type === "VariableDeclaration" && (variable.kind === "var" ? isVar : !isVar)) {
|
|
1539
1539
|
for (const decl of variable.declarations) {
|
|
1540
1540
|
for (const id of extractIdentifiers(decl.id)) {
|
|
1541
1541
|
onIdent(id);
|
|
@@ -2499,7 +2499,7 @@ function isUpperCase(c) {
|
|
|
2499
2499
|
return c > 64 && c < 91;
|
|
2500
2500
|
}
|
|
2501
2501
|
const windowsNewlineRE = /\r\n/g;
|
|
2502
|
-
function condenseWhitespace(nodes
|
|
2502
|
+
function condenseWhitespace(nodes) {
|
|
2503
2503
|
const shouldCondense = currentOptions.whitespace !== "preserve";
|
|
2504
2504
|
let removedWhitespace = false;
|
|
2505
2505
|
for (let i = 0; i < nodes.length; i++) {
|
|
@@ -2663,12 +2663,12 @@ function cacheStatic(root, context) {
|
|
|
2663
2663
|
context,
|
|
2664
2664
|
// Root node is unfortunately non-hoistable due to potential parent
|
|
2665
2665
|
// fallthrough attributes.
|
|
2666
|
-
|
|
2666
|
+
!!getSingleElementRoot(root)
|
|
2667
2667
|
);
|
|
2668
2668
|
}
|
|
2669
|
-
function
|
|
2670
|
-
const
|
|
2671
|
-
return children.length === 1 &&
|
|
2669
|
+
function getSingleElementRoot(root) {
|
|
2670
|
+
const children = root.children.filter((x) => x.type !== 3);
|
|
2671
|
+
return children.length === 1 && children[0].type === 1 && !isSlotOutlet(children[0]) ? children[0] : null;
|
|
2672
2672
|
}
|
|
2673
2673
|
function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
2674
2674
|
const { children } = node;
|
|
@@ -3135,15 +3135,15 @@ function createRootCodegen(root, context) {
|
|
|
3135
3135
|
const { helper } = context;
|
|
3136
3136
|
const { children } = root;
|
|
3137
3137
|
if (children.length === 1) {
|
|
3138
|
-
const
|
|
3139
|
-
if (
|
|
3140
|
-
const codegenNode =
|
|
3138
|
+
const singleElementRootChild = getSingleElementRoot(root);
|
|
3139
|
+
if (singleElementRootChild && singleElementRootChild.codegenNode) {
|
|
3140
|
+
const codegenNode = singleElementRootChild.codegenNode;
|
|
3141
3141
|
if (codegenNode.type === 13) {
|
|
3142
3142
|
convertToBlock(codegenNode, context);
|
|
3143
3143
|
}
|
|
3144
3144
|
root.codegenNode = codegenNode;
|
|
3145
3145
|
} else {
|
|
3146
|
-
root.codegenNode =
|
|
3146
|
+
root.codegenNode = children[0];
|
|
3147
3147
|
}
|
|
3148
3148
|
} else if (children.length > 1) {
|
|
3149
3149
|
let patchFlag = 64;
|
|
@@ -4528,7 +4528,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
4528
4528
|
let prev;
|
|
4529
4529
|
while (j--) {
|
|
4530
4530
|
prev = children[j];
|
|
4531
|
-
if (prev.type !== 3) {
|
|
4531
|
+
if (prev.type !== 3 && isNonWhitespaceContent(prev)) {
|
|
4532
4532
|
break;
|
|
4533
4533
|
}
|
|
4534
4534
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/compiler-core",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.17",
|
|
4
4
|
"description": "@vue/compiler-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/compiler-core.esm-bundler.js",
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@babel/parser": "^7.27.
|
|
49
|
+
"@babel/parser": "^7.27.5",
|
|
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.
|
|
53
|
+
"@vue/shared": "3.5.17"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@babel/types": "^7.27.
|
|
56
|
+
"@babel/types": "^7.27.6"
|
|
57
57
|
}
|
|
58
58
|
}
|