@vue/compiler-core 3.5.40 → 3.5.41
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.41
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -4963,6 +4963,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
4963
4963
|
node.loc
|
|
4964
4964
|
);
|
|
4965
4965
|
return () => {
|
|
4966
|
+
var _a;
|
|
4966
4967
|
let childBlock;
|
|
4967
4968
|
const { children } = forNode;
|
|
4968
4969
|
if (isTemplate) {
|
|
@@ -5006,7 +5007,8 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
5006
5007
|
if (isTemplate && keyProperty) {
|
|
5007
5008
|
injectProp(childBlock, keyProperty, context);
|
|
5008
5009
|
}
|
|
5009
|
-
|
|
5010
|
+
const shouldUseBlock = !isStableFragment || childBlock.isBlockRequired === true;
|
|
5011
|
+
if (childBlock.isBlock !== shouldUseBlock) {
|
|
5010
5012
|
if (childBlock.isBlock) {
|
|
5011
5013
|
removeHelper(OPEN_BLOCK);
|
|
5012
5014
|
removeHelper(
|
|
@@ -5018,12 +5020,15 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
5018
5020
|
);
|
|
5019
5021
|
}
|
|
5020
5022
|
}
|
|
5021
|
-
childBlock.isBlock =
|
|
5023
|
+
childBlock.isBlock = shouldUseBlock;
|
|
5022
5024
|
if (childBlock.isBlock) {
|
|
5023
5025
|
helper(OPEN_BLOCK);
|
|
5024
5026
|
helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
|
|
5025
5027
|
} else {
|
|
5026
5028
|
helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
|
|
5029
|
+
if (childBlock.needsPatch) {
|
|
5030
|
+
childBlock.patchFlag = ((_a = childBlock.patchFlag) != null ? _a : 0) | 512;
|
|
5031
|
+
}
|
|
5027
5032
|
}
|
|
5028
5033
|
}
|
|
5029
5034
|
if (memo) {
|
|
@@ -5445,6 +5450,8 @@ const transformElement = (node, context) => {
|
|
|
5445
5450
|
let vnodeDynamicProps;
|
|
5446
5451
|
let dynamicPropNames;
|
|
5447
5452
|
let vnodeDirectives;
|
|
5453
|
+
let needsPatch = false;
|
|
5454
|
+
let isBlockRequired = false;
|
|
5448
5455
|
let shouldUseBlock = (
|
|
5449
5456
|
// dynamic component may resolve to plain elements
|
|
5450
5457
|
isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block
|
|
@@ -5464,6 +5471,8 @@ const transformElement = (node, context) => {
|
|
|
5464
5471
|
vnodeProps = propsBuildResult.props;
|
|
5465
5472
|
patchFlag = propsBuildResult.patchFlag;
|
|
5466
5473
|
dynamicPropNames = propsBuildResult.dynamicPropNames;
|
|
5474
|
+
needsPatch = propsBuildResult.needsPatch;
|
|
5475
|
+
isBlockRequired = propsBuildResult.isBlockRequired;
|
|
5467
5476
|
const directives = propsBuildResult.directives;
|
|
5468
5477
|
vnodeDirectives = directives && directives.length ? createArrayExpression(
|
|
5469
5478
|
directives.map((dir) => buildDirectiveArgs(dir, context))
|
|
@@ -5514,7 +5523,7 @@ const transformElement = (node, context) => {
|
|
|
5514
5523
|
if (dynamicPropNames && dynamicPropNames.length) {
|
|
5515
5524
|
vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
|
|
5516
5525
|
}
|
|
5517
|
-
node.codegenNode = createVNodeCall(
|
|
5526
|
+
const vnodeCall = node.codegenNode = createVNodeCall(
|
|
5518
5527
|
context,
|
|
5519
5528
|
vnodeTag,
|
|
5520
5529
|
vnodeProps,
|
|
@@ -5527,6 +5536,13 @@ const transformElement = (node, context) => {
|
|
|
5527
5536
|
isComponent,
|
|
5528
5537
|
node.loc
|
|
5529
5538
|
);
|
|
5539
|
+
needsPatch = needsPatch && (patchFlag === 0 || patchFlag === 32);
|
|
5540
|
+
if (needsPatch) {
|
|
5541
|
+
vnodeCall.needsPatch = true;
|
|
5542
|
+
}
|
|
5543
|
+
if (isBlockRequired) {
|
|
5544
|
+
vnodeCall.isBlockRequired = true;
|
|
5545
|
+
}
|
|
5530
5546
|
};
|
|
5531
5547
|
};
|
|
5532
5548
|
function resolveComponentType(node, context, ssr = false) {
|
|
@@ -5636,6 +5652,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5636
5652
|
const runtimeDirectives = [];
|
|
5637
5653
|
const hasChildren = children.length > 0;
|
|
5638
5654
|
let shouldUseBlock = false;
|
|
5655
|
+
let isBlockRequired = false;
|
|
5639
5656
|
let patchFlag = 0;
|
|
5640
5657
|
let hasRef = false;
|
|
5641
5658
|
let hasClassBinding = false;
|
|
@@ -5677,19 +5694,20 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5677
5694
|
if (isEventHandler && shared.isReservedProp(name)) {
|
|
5678
5695
|
hasVnodeHook = true;
|
|
5679
5696
|
}
|
|
5697
|
+
if (name === "ref") {
|
|
5698
|
+
hasRef = true;
|
|
5699
|
+
}
|
|
5680
5700
|
if (isEventHandler && value.type === 14) {
|
|
5681
5701
|
value = value.arguments[0];
|
|
5682
5702
|
}
|
|
5683
5703
|
if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
|
|
5684
5704
|
return;
|
|
5685
5705
|
}
|
|
5686
|
-
if (name === "
|
|
5687
|
-
hasRef = true;
|
|
5688
|
-
} else if (name === "class") {
|
|
5706
|
+
if (name === "class") {
|
|
5689
5707
|
hasClassBinding = true;
|
|
5690
5708
|
} else if (name === "style") {
|
|
5691
5709
|
hasStyleBinding = true;
|
|
5692
|
-
} else if (name !== "key" && !dynamicPropNames.includes(name)) {
|
|
5710
|
+
} else if (name !== "ref" && name !== "key" && !dynamicPropNames.includes(name)) {
|
|
5693
5711
|
dynamicPropNames.push(name);
|
|
5694
5712
|
}
|
|
5695
5713
|
if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) {
|
|
@@ -5760,13 +5778,12 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5760
5778
|
if (isVOn && ssr) {
|
|
5761
5779
|
continue;
|
|
5762
5780
|
}
|
|
5763
|
-
if (
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update")
|
|
5768
|
-
) {
|
|
5781
|
+
if (isVBind && isStaticArgOf(arg, "key")) {
|
|
5782
|
+
shouldUseBlock = true;
|
|
5783
|
+
}
|
|
5784
|
+
if (isVOn && hasChildren && arg && isStaticExp(arg) && shared.camelize(arg.content) === "vue:beforeUpdate") {
|
|
5769
5785
|
shouldUseBlock = true;
|
|
5786
|
+
isBlockRequired = true;
|
|
5770
5787
|
}
|
|
5771
5788
|
if (isVBind && isStaticArgOf(arg, "ref")) {
|
|
5772
5789
|
pushRefVForMarker();
|
|
@@ -5849,6 +5866,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5849
5866
|
runtimeDirectives.push(prop);
|
|
5850
5867
|
if (hasChildren) {
|
|
5851
5868
|
shouldUseBlock = true;
|
|
5869
|
+
isBlockRequired = true;
|
|
5852
5870
|
}
|
|
5853
5871
|
}
|
|
5854
5872
|
}
|
|
@@ -5887,7 +5905,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5887
5905
|
patchFlag |= 32;
|
|
5888
5906
|
}
|
|
5889
5907
|
}
|
|
5890
|
-
|
|
5908
|
+
const needsPatch = (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0);
|
|
5909
|
+
if (!shouldUseBlock && needsPatch) {
|
|
5891
5910
|
patchFlag |= 512;
|
|
5892
5911
|
}
|
|
5893
5912
|
if (!context.inSSR && propsExpression) {
|
|
@@ -5953,7 +5972,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5953
5972
|
directives: runtimeDirectives,
|
|
5954
5973
|
patchFlag,
|
|
5955
5974
|
dynamicPropNames,
|
|
5956
|
-
shouldUseBlock
|
|
5975
|
+
shouldUseBlock,
|
|
5976
|
+
needsPatch,
|
|
5977
|
+
isBlockRequired
|
|
5957
5978
|
};
|
|
5958
5979
|
}
|
|
5959
5980
|
function dedupeProperties(properties) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-core v3.5.
|
|
2
|
+
* @vue/compiler-core v3.5.41
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -4876,6 +4876,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
4876
4876
|
node.loc
|
|
4877
4877
|
);
|
|
4878
4878
|
return () => {
|
|
4879
|
+
var _a;
|
|
4879
4880
|
let childBlock;
|
|
4880
4881
|
const { children } = forNode;
|
|
4881
4882
|
if (isTemplate) {
|
|
@@ -4919,7 +4920,8 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
4919
4920
|
if (isTemplate && keyProperty) {
|
|
4920
4921
|
injectProp(childBlock, keyProperty, context);
|
|
4921
4922
|
}
|
|
4922
|
-
|
|
4923
|
+
const shouldUseBlock = !isStableFragment || childBlock.isBlockRequired === true;
|
|
4924
|
+
if (childBlock.isBlock !== shouldUseBlock) {
|
|
4923
4925
|
if (childBlock.isBlock) {
|
|
4924
4926
|
removeHelper(OPEN_BLOCK);
|
|
4925
4927
|
removeHelper(
|
|
@@ -4931,12 +4933,15 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
4931
4933
|
);
|
|
4932
4934
|
}
|
|
4933
4935
|
}
|
|
4934
|
-
childBlock.isBlock =
|
|
4936
|
+
childBlock.isBlock = shouldUseBlock;
|
|
4935
4937
|
if (childBlock.isBlock) {
|
|
4936
4938
|
helper(OPEN_BLOCK);
|
|
4937
4939
|
helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
|
|
4938
4940
|
} else {
|
|
4939
4941
|
helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
|
|
4942
|
+
if (childBlock.needsPatch) {
|
|
4943
|
+
childBlock.patchFlag = ((_a = childBlock.patchFlag) != null ? _a : 0) | 512;
|
|
4944
|
+
}
|
|
4940
4945
|
}
|
|
4941
4946
|
}
|
|
4942
4947
|
if (memo) {
|
|
@@ -5358,6 +5363,8 @@ const transformElement = (node, context) => {
|
|
|
5358
5363
|
let vnodeDynamicProps;
|
|
5359
5364
|
let dynamicPropNames;
|
|
5360
5365
|
let vnodeDirectives;
|
|
5366
|
+
let needsPatch = false;
|
|
5367
|
+
let isBlockRequired = false;
|
|
5361
5368
|
let shouldUseBlock = (
|
|
5362
5369
|
// dynamic component may resolve to plain elements
|
|
5363
5370
|
isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block
|
|
@@ -5377,6 +5384,8 @@ const transformElement = (node, context) => {
|
|
|
5377
5384
|
vnodeProps = propsBuildResult.props;
|
|
5378
5385
|
patchFlag = propsBuildResult.patchFlag;
|
|
5379
5386
|
dynamicPropNames = propsBuildResult.dynamicPropNames;
|
|
5387
|
+
needsPatch = propsBuildResult.needsPatch;
|
|
5388
|
+
isBlockRequired = propsBuildResult.isBlockRequired;
|
|
5380
5389
|
const directives = propsBuildResult.directives;
|
|
5381
5390
|
vnodeDirectives = directives && directives.length ? createArrayExpression(
|
|
5382
5391
|
directives.map((dir) => buildDirectiveArgs(dir, context))
|
|
@@ -5418,7 +5427,7 @@ const transformElement = (node, context) => {
|
|
|
5418
5427
|
if (dynamicPropNames && dynamicPropNames.length) {
|
|
5419
5428
|
vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
|
|
5420
5429
|
}
|
|
5421
|
-
node.codegenNode = createVNodeCall(
|
|
5430
|
+
const vnodeCall = node.codegenNode = createVNodeCall(
|
|
5422
5431
|
context,
|
|
5423
5432
|
vnodeTag,
|
|
5424
5433
|
vnodeProps,
|
|
@@ -5431,6 +5440,13 @@ const transformElement = (node, context) => {
|
|
|
5431
5440
|
isComponent,
|
|
5432
5441
|
node.loc
|
|
5433
5442
|
);
|
|
5443
|
+
needsPatch = needsPatch && (patchFlag === 0 || patchFlag === 32);
|
|
5444
|
+
if (needsPatch) {
|
|
5445
|
+
vnodeCall.needsPatch = true;
|
|
5446
|
+
}
|
|
5447
|
+
if (isBlockRequired) {
|
|
5448
|
+
vnodeCall.isBlockRequired = true;
|
|
5449
|
+
}
|
|
5434
5450
|
};
|
|
5435
5451
|
};
|
|
5436
5452
|
function resolveComponentType(node, context, ssr = false) {
|
|
@@ -5540,6 +5556,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5540
5556
|
const runtimeDirectives = [];
|
|
5541
5557
|
const hasChildren = children.length > 0;
|
|
5542
5558
|
let shouldUseBlock = false;
|
|
5559
|
+
let isBlockRequired = false;
|
|
5543
5560
|
let patchFlag = 0;
|
|
5544
5561
|
let hasRef = false;
|
|
5545
5562
|
let hasClassBinding = false;
|
|
@@ -5581,19 +5598,20 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5581
5598
|
if (isEventHandler && shared.isReservedProp(name)) {
|
|
5582
5599
|
hasVnodeHook = true;
|
|
5583
5600
|
}
|
|
5601
|
+
if (name === "ref") {
|
|
5602
|
+
hasRef = true;
|
|
5603
|
+
}
|
|
5584
5604
|
if (isEventHandler && value.type === 14) {
|
|
5585
5605
|
value = value.arguments[0];
|
|
5586
5606
|
}
|
|
5587
5607
|
if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
|
|
5588
5608
|
return;
|
|
5589
5609
|
}
|
|
5590
|
-
if (name === "
|
|
5591
|
-
hasRef = true;
|
|
5592
|
-
} else if (name === "class") {
|
|
5610
|
+
if (name === "class") {
|
|
5593
5611
|
hasClassBinding = true;
|
|
5594
5612
|
} else if (name === "style") {
|
|
5595
5613
|
hasStyleBinding = true;
|
|
5596
|
-
} else if (name !== "key" && !dynamicPropNames.includes(name)) {
|
|
5614
|
+
} else if (name !== "ref" && name !== "key" && !dynamicPropNames.includes(name)) {
|
|
5597
5615
|
dynamicPropNames.push(name);
|
|
5598
5616
|
}
|
|
5599
5617
|
if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) {
|
|
@@ -5664,13 +5682,12 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5664
5682
|
if (isVOn && ssr) {
|
|
5665
5683
|
continue;
|
|
5666
5684
|
}
|
|
5667
|
-
if (
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update")
|
|
5672
|
-
) {
|
|
5685
|
+
if (isVBind && isStaticArgOf(arg, "key")) {
|
|
5686
|
+
shouldUseBlock = true;
|
|
5687
|
+
}
|
|
5688
|
+
if (isVOn && hasChildren && arg && isStaticExp(arg) && shared.camelize(arg.content) === "vue:beforeUpdate") {
|
|
5673
5689
|
shouldUseBlock = true;
|
|
5690
|
+
isBlockRequired = true;
|
|
5674
5691
|
}
|
|
5675
5692
|
if (isVBind && isStaticArgOf(arg, "ref")) {
|
|
5676
5693
|
pushRefVForMarker();
|
|
@@ -5732,6 +5749,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5732
5749
|
runtimeDirectives.push(prop);
|
|
5733
5750
|
if (hasChildren) {
|
|
5734
5751
|
shouldUseBlock = true;
|
|
5752
|
+
isBlockRequired = true;
|
|
5735
5753
|
}
|
|
5736
5754
|
}
|
|
5737
5755
|
}
|
|
@@ -5770,7 +5788,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5770
5788
|
patchFlag |= 32;
|
|
5771
5789
|
}
|
|
5772
5790
|
}
|
|
5773
|
-
|
|
5791
|
+
const needsPatch = (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0);
|
|
5792
|
+
if (!shouldUseBlock && needsPatch) {
|
|
5774
5793
|
patchFlag |= 512;
|
|
5775
5794
|
}
|
|
5776
5795
|
if (!context.inSSR && propsExpression) {
|
|
@@ -5836,7 +5855,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5836
5855
|
directives: runtimeDirectives,
|
|
5837
5856
|
patchFlag,
|
|
5838
5857
|
dynamicPropNames,
|
|
5839
|
-
shouldUseBlock
|
|
5858
|
+
shouldUseBlock,
|
|
5859
|
+
needsPatch,
|
|
5860
|
+
isBlockRequired
|
|
5840
5861
|
};
|
|
5841
5862
|
}
|
|
5842
5863
|
function dedupeProperties(properties) {
|
package/dist/compiler-core.d.ts
CHANGED
|
@@ -139,6 +139,8 @@ export declare function buildProps(node: ElementNode, context: TransformContext,
|
|
|
139
139
|
patchFlag: number;
|
|
140
140
|
dynamicPropNames: string[];
|
|
141
141
|
shouldUseBlock: boolean;
|
|
142
|
+
needsPatch: boolean;
|
|
143
|
+
isBlockRequired: boolean;
|
|
142
144
|
};
|
|
143
145
|
export declare function buildDirectiveArgs(dir: DirectiveNode, context: TransformContext): ArrayExpression;
|
|
144
146
|
|
|
@@ -376,6 +378,10 @@ export interface VNodeCall extends Node {
|
|
|
376
378
|
patchFlag: PatchFlags | undefined;
|
|
377
379
|
dynamicProps: string | SimpleExpressionNode | undefined;
|
|
378
380
|
directives: DirectiveArguments | undefined;
|
|
381
|
+
/** Whether this vnode must be patched if a later transform makes it non-block. */
|
|
382
|
+
needsPatch?: boolean;
|
|
383
|
+
/** Whether a later transform must preserve this vnode as a block. */
|
|
384
|
+
isBlockRequired?: boolean;
|
|
379
385
|
isBlock: boolean;
|
|
380
386
|
disableTracking: boolean;
|
|
381
387
|
isComponent: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-core v3.5.
|
|
2
|
+
* @vue/compiler-core v3.5.41
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -4216,6 +4216,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
4216
4216
|
node.loc
|
|
4217
4217
|
);
|
|
4218
4218
|
return () => {
|
|
4219
|
+
var _a;
|
|
4219
4220
|
let childBlock;
|
|
4220
4221
|
const { children } = forNode;
|
|
4221
4222
|
if ((!!(process.env.NODE_ENV !== "production") || false) && isTemplate) {
|
|
@@ -4259,7 +4260,8 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
4259
4260
|
if (isTemplate && keyProperty) {
|
|
4260
4261
|
injectProp(childBlock, keyProperty, context);
|
|
4261
4262
|
}
|
|
4262
|
-
|
|
4263
|
+
const shouldUseBlock = !isStableFragment || childBlock.isBlockRequired === true;
|
|
4264
|
+
if (childBlock.isBlock !== shouldUseBlock) {
|
|
4263
4265
|
if (childBlock.isBlock) {
|
|
4264
4266
|
removeHelper(OPEN_BLOCK);
|
|
4265
4267
|
removeHelper(
|
|
@@ -4271,12 +4273,15 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
4271
4273
|
);
|
|
4272
4274
|
}
|
|
4273
4275
|
}
|
|
4274
|
-
childBlock.isBlock =
|
|
4276
|
+
childBlock.isBlock = shouldUseBlock;
|
|
4275
4277
|
if (childBlock.isBlock) {
|
|
4276
4278
|
helper(OPEN_BLOCK);
|
|
4277
4279
|
helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
|
|
4278
4280
|
} else {
|
|
4279
4281
|
helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
|
|
4282
|
+
if (childBlock.needsPatch) {
|
|
4283
|
+
childBlock.patchFlag = ((_a = childBlock.patchFlag) != null ? _a : 0) | 512;
|
|
4284
|
+
}
|
|
4280
4285
|
}
|
|
4281
4286
|
}
|
|
4282
4287
|
if (memo) {
|
|
@@ -4674,6 +4679,8 @@ const transformElement = (node, context) => {
|
|
|
4674
4679
|
let vnodeDynamicProps;
|
|
4675
4680
|
let dynamicPropNames;
|
|
4676
4681
|
let vnodeDirectives;
|
|
4682
|
+
let needsPatch = false;
|
|
4683
|
+
let isBlockRequired = false;
|
|
4677
4684
|
let shouldUseBlock = (
|
|
4678
4685
|
// dynamic component may resolve to plain elements
|
|
4679
4686
|
isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block
|
|
@@ -4693,6 +4700,8 @@ const transformElement = (node, context) => {
|
|
|
4693
4700
|
vnodeProps = propsBuildResult.props;
|
|
4694
4701
|
patchFlag = propsBuildResult.patchFlag;
|
|
4695
4702
|
dynamicPropNames = propsBuildResult.dynamicPropNames;
|
|
4703
|
+
needsPatch = propsBuildResult.needsPatch;
|
|
4704
|
+
isBlockRequired = propsBuildResult.isBlockRequired;
|
|
4696
4705
|
const directives = propsBuildResult.directives;
|
|
4697
4706
|
vnodeDirectives = directives && directives.length ? createArrayExpression(
|
|
4698
4707
|
directives.map((dir) => buildDirectiveArgs(dir, context))
|
|
@@ -4743,7 +4752,7 @@ const transformElement = (node, context) => {
|
|
|
4743
4752
|
if (dynamicPropNames && dynamicPropNames.length) {
|
|
4744
4753
|
vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
|
|
4745
4754
|
}
|
|
4746
|
-
node.codegenNode = createVNodeCall(
|
|
4755
|
+
const vnodeCall = node.codegenNode = createVNodeCall(
|
|
4747
4756
|
context,
|
|
4748
4757
|
vnodeTag,
|
|
4749
4758
|
vnodeProps,
|
|
@@ -4756,6 +4765,13 @@ const transformElement = (node, context) => {
|
|
|
4756
4765
|
isComponent,
|
|
4757
4766
|
node.loc
|
|
4758
4767
|
);
|
|
4768
|
+
needsPatch = needsPatch && (patchFlag === 0 || patchFlag === 32);
|
|
4769
|
+
if (needsPatch) {
|
|
4770
|
+
vnodeCall.needsPatch = true;
|
|
4771
|
+
}
|
|
4772
|
+
if (isBlockRequired) {
|
|
4773
|
+
vnodeCall.isBlockRequired = true;
|
|
4774
|
+
}
|
|
4759
4775
|
};
|
|
4760
4776
|
};
|
|
4761
4777
|
function resolveComponentType(node, context, ssr = false) {
|
|
@@ -4807,6 +4823,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
4807
4823
|
const runtimeDirectives = [];
|
|
4808
4824
|
const hasChildren = children.length > 0;
|
|
4809
4825
|
let shouldUseBlock = false;
|
|
4826
|
+
let isBlockRequired = false;
|
|
4810
4827
|
let patchFlag = 0;
|
|
4811
4828
|
let hasRef = false;
|
|
4812
4829
|
let hasClassBinding = false;
|
|
@@ -4848,19 +4865,20 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
4848
4865
|
if (isEventHandler && isReservedProp(name)) {
|
|
4849
4866
|
hasVnodeHook = true;
|
|
4850
4867
|
}
|
|
4868
|
+
if (name === "ref") {
|
|
4869
|
+
hasRef = true;
|
|
4870
|
+
}
|
|
4851
4871
|
if (isEventHandler && value.type === 14) {
|
|
4852
4872
|
value = value.arguments[0];
|
|
4853
4873
|
}
|
|
4854
4874
|
if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
|
|
4855
4875
|
return;
|
|
4856
4876
|
}
|
|
4857
|
-
if (name === "
|
|
4858
|
-
hasRef = true;
|
|
4859
|
-
} else if (name === "class") {
|
|
4877
|
+
if (name === "class") {
|
|
4860
4878
|
hasClassBinding = true;
|
|
4861
4879
|
} else if (name === "style") {
|
|
4862
4880
|
hasStyleBinding = true;
|
|
4863
|
-
} else if (name !== "key" && !dynamicPropNames.includes(name)) {
|
|
4881
|
+
} else if (name !== "ref" && name !== "key" && !dynamicPropNames.includes(name)) {
|
|
4864
4882
|
dynamicPropNames.push(name);
|
|
4865
4883
|
}
|
|
4866
4884
|
if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) {
|
|
@@ -4919,13 +4937,12 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
4919
4937
|
if (isVOn && ssr) {
|
|
4920
4938
|
continue;
|
|
4921
4939
|
}
|
|
4922
|
-
if (
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update")
|
|
4927
|
-
) {
|
|
4940
|
+
if (isVBind && isStaticArgOf(arg, "key")) {
|
|
4941
|
+
shouldUseBlock = true;
|
|
4942
|
+
}
|
|
4943
|
+
if (isVOn && hasChildren && arg && isStaticExp(arg) && camelize(arg.content) === "vue:beforeUpdate") {
|
|
4928
4944
|
shouldUseBlock = true;
|
|
4945
|
+
isBlockRequired = true;
|
|
4929
4946
|
}
|
|
4930
4947
|
if (isVBind && isStaticArgOf(arg, "ref")) {
|
|
4931
4948
|
pushRefVForMarker();
|
|
@@ -5008,6 +5025,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5008
5025
|
runtimeDirectives.push(prop);
|
|
5009
5026
|
if (hasChildren) {
|
|
5010
5027
|
shouldUseBlock = true;
|
|
5028
|
+
isBlockRequired = true;
|
|
5011
5029
|
}
|
|
5012
5030
|
}
|
|
5013
5031
|
}
|
|
@@ -5046,7 +5064,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5046
5064
|
patchFlag |= 32;
|
|
5047
5065
|
}
|
|
5048
5066
|
}
|
|
5049
|
-
|
|
5067
|
+
const needsPatch = (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0);
|
|
5068
|
+
if (!shouldUseBlock && needsPatch) {
|
|
5050
5069
|
patchFlag |= 512;
|
|
5051
5070
|
}
|
|
5052
5071
|
if (!context.inSSR && propsExpression) {
|
|
@@ -5112,7 +5131,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5112
5131
|
directives: runtimeDirectives,
|
|
5113
5132
|
patchFlag,
|
|
5114
5133
|
dynamicPropNames,
|
|
5115
|
-
shouldUseBlock
|
|
5134
|
+
shouldUseBlock,
|
|
5135
|
+
needsPatch,
|
|
5136
|
+
isBlockRequired
|
|
5116
5137
|
};
|
|
5117
5138
|
}
|
|
5118
5139
|
function dedupeProperties(properties) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/compiler-core",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.41",
|
|
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.29.
|
|
49
|
+
"@babel/parser": "^7.29.8",
|
|
50
50
|
"entities": "^7.0.1",
|
|
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.41"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@babel/types": "^7.29.
|
|
56
|
+
"@babel/types": "^7.29.8"
|
|
57
57
|
}
|
|
58
58
|
}
|