@vue/compiler-core 3.2.34-beta.1 → 3.2.34
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.
|
@@ -4344,7 +4344,7 @@ const transformElement = (node, context) => {
|
|
|
4344
4344
|
(tag === 'svg' || tag === 'foreignObject'));
|
|
4345
4345
|
// props
|
|
4346
4346
|
if (props.length > 0) {
|
|
4347
|
-
const propsBuildResult = buildProps(node, context);
|
|
4347
|
+
const propsBuildResult = buildProps(node, context, undefined, isComponent, isDynamicComponent);
|
|
4348
4348
|
vnodeProps = propsBuildResult.props;
|
|
4349
4349
|
patchFlag = propsBuildResult.patchFlag;
|
|
4350
4350
|
dynamicPropNames = propsBuildResult.dynamicPropNames;
|
|
@@ -4545,9 +4545,8 @@ function resolveSetupReference(name, context) {
|
|
|
4545
4545
|
: `$setup[${JSON.stringify(fromMaybeRef)}]`;
|
|
4546
4546
|
}
|
|
4547
4547
|
}
|
|
4548
|
-
function buildProps(node, context, props = node.props, ssr = false) {
|
|
4548
|
+
function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) {
|
|
4549
4549
|
const { tag, loc: elementLoc, children } = node;
|
|
4550
|
-
const isComponent = node.tagType === 1 /* COMPONENT */;
|
|
4551
4550
|
let properties = [];
|
|
4552
4551
|
const mergeArgs = [];
|
|
4553
4552
|
const runtimeDirectives = [];
|
|
@@ -4566,8 +4565,8 @@ function buildProps(node, context, props = node.props, ssr = false) {
|
|
|
4566
4565
|
if (isStaticExp(key)) {
|
|
4567
4566
|
const name = key.content;
|
|
4568
4567
|
const isEventHandler = shared.isOn(name);
|
|
4569
|
-
if (
|
|
4570
|
-
|
|
4568
|
+
if (isEventHandler &&
|
|
4569
|
+
(!isComponent || isDynamicComponent) &&
|
|
4571
4570
|
// omit the flag for click handlers because hydration gives click
|
|
4572
4571
|
// dedicated fast path.
|
|
4573
4572
|
name.toLowerCase() !== 'onclick' &&
|
|
@@ -5038,7 +5037,7 @@ function processSlotOutlet(node, context) {
|
|
|
5038
5037
|
}
|
|
5039
5038
|
}
|
|
5040
5039
|
if (nonNameProps.length > 0) {
|
|
5041
|
-
const { props, directives } = buildProps(node, context, nonNameProps);
|
|
5040
|
+
const { props, directives } = buildProps(node, context, nonNameProps, false, false);
|
|
5042
5041
|
slotProps = props;
|
|
5043
5042
|
if (directives.length) {
|
|
5044
5043
|
context.onError(createCompilerError(36 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */, directives[0].loc));
|
|
@@ -4260,7 +4260,7 @@ const transformElement = (node, context) => {
|
|
|
4260
4260
|
(tag === 'svg' || tag === 'foreignObject'));
|
|
4261
4261
|
// props
|
|
4262
4262
|
if (props.length > 0) {
|
|
4263
|
-
const propsBuildResult = buildProps(node, context);
|
|
4263
|
+
const propsBuildResult = buildProps(node, context, undefined, isComponent, isDynamicComponent);
|
|
4264
4264
|
vnodeProps = propsBuildResult.props;
|
|
4265
4265
|
patchFlag = propsBuildResult.patchFlag;
|
|
4266
4266
|
dynamicPropNames = propsBuildResult.dynamicPropNames;
|
|
@@ -4442,9 +4442,8 @@ function resolveSetupReference(name, context) {
|
|
|
4442
4442
|
: `$setup[${JSON.stringify(fromMaybeRef)}]`;
|
|
4443
4443
|
}
|
|
4444
4444
|
}
|
|
4445
|
-
function buildProps(node, context, props = node.props, ssr = false) {
|
|
4445
|
+
function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) {
|
|
4446
4446
|
const { tag, loc: elementLoc, children } = node;
|
|
4447
|
-
const isComponent = node.tagType === 1 /* COMPONENT */;
|
|
4448
4447
|
let properties = [];
|
|
4449
4448
|
const mergeArgs = [];
|
|
4450
4449
|
const runtimeDirectives = [];
|
|
@@ -4463,8 +4462,8 @@ function buildProps(node, context, props = node.props, ssr = false) {
|
|
|
4463
4462
|
if (isStaticExp(key)) {
|
|
4464
4463
|
const name = key.content;
|
|
4465
4464
|
const isEventHandler = shared.isOn(name);
|
|
4466
|
-
if (
|
|
4467
|
-
|
|
4465
|
+
if (isEventHandler &&
|
|
4466
|
+
(!isComponent || isDynamicComponent) &&
|
|
4468
4467
|
// omit the flag for click handlers because hydration gives click
|
|
4469
4468
|
// dedicated fast path.
|
|
4470
4469
|
name.toLowerCase() !== 'onclick' &&
|
|
@@ -4909,7 +4908,7 @@ function processSlotOutlet(node, context) {
|
|
|
4909
4908
|
}
|
|
4910
4909
|
}
|
|
4911
4910
|
if (nonNameProps.length > 0) {
|
|
4912
|
-
const { props, directives } = buildProps(node, context, nonNameProps);
|
|
4911
|
+
const { props, directives } = buildProps(node, context, nonNameProps, false, false);
|
|
4913
4912
|
slotProps = props;
|
|
4914
4913
|
if (directives.length) {
|
|
4915
4914
|
context.onError(createCompilerError(36 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */, directives[0].loc));
|
package/dist/compiler-core.d.ts
CHANGED
|
@@ -106,7 +106,7 @@ export declare interface BlockStatement extends Node_2 {
|
|
|
106
106
|
|
|
107
107
|
export declare function buildDirectiveArgs(dir: DirectiveNode, context: TransformContext): ArrayExpression;
|
|
108
108
|
|
|
109
|
-
export declare function buildProps(node: ElementNode, context: TransformContext, props
|
|
109
|
+
export declare function buildProps(node: ElementNode, context: TransformContext, props: (DirectiveNode | AttributeNode)[] | undefined, isComponent: boolean, isDynamicComponent: boolean, ssr?: boolean): {
|
|
110
110
|
props: PropsExpression | undefined;
|
|
111
111
|
directives: DirectiveNode[];
|
|
112
112
|
patchFlag: number;
|
|
@@ -3664,7 +3664,7 @@ const transformElement = (node, context) => {
|
|
|
3664
3664
|
(tag === 'svg' || tag === 'foreignObject'));
|
|
3665
3665
|
// props
|
|
3666
3666
|
if (props.length > 0) {
|
|
3667
|
-
const propsBuildResult = buildProps(node, context);
|
|
3667
|
+
const propsBuildResult = buildProps(node, context, undefined, isComponent, isDynamicComponent);
|
|
3668
3668
|
vnodeProps = propsBuildResult.props;
|
|
3669
3669
|
patchFlag = propsBuildResult.patchFlag;
|
|
3670
3670
|
dynamicPropNames = propsBuildResult.dynamicPropNames;
|
|
@@ -3806,9 +3806,8 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
3806
3806
|
context.components.add(tag);
|
|
3807
3807
|
return toValidAssetId(tag, `component`);
|
|
3808
3808
|
}
|
|
3809
|
-
function buildProps(node, context, props = node.props, ssr = false) {
|
|
3809
|
+
function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) {
|
|
3810
3810
|
const { tag, loc: elementLoc, children } = node;
|
|
3811
|
-
const isComponent = node.tagType === 1 /* COMPONENT */;
|
|
3812
3811
|
let properties = [];
|
|
3813
3812
|
const mergeArgs = [];
|
|
3814
3813
|
const runtimeDirectives = [];
|
|
@@ -3827,8 +3826,8 @@ function buildProps(node, context, props = node.props, ssr = false) {
|
|
|
3827
3826
|
if (isStaticExp(key)) {
|
|
3828
3827
|
const name = key.content;
|
|
3829
3828
|
const isEventHandler = isOn(name);
|
|
3830
|
-
if (
|
|
3831
|
-
|
|
3829
|
+
if (isEventHandler &&
|
|
3830
|
+
(!isComponent || isDynamicComponent) &&
|
|
3832
3831
|
// omit the flag for click handlers because hydration gives click
|
|
3833
3832
|
// dedicated fast path.
|
|
3834
3833
|
name.toLowerCase() !== 'onclick' &&
|
|
@@ -4285,7 +4284,7 @@ function processSlotOutlet(node, context) {
|
|
|
4285
4284
|
}
|
|
4286
4285
|
}
|
|
4287
4286
|
if (nonNameProps.length > 0) {
|
|
4288
|
-
const { props, directives } = buildProps(node, context, nonNameProps);
|
|
4287
|
+
const { props, directives } = buildProps(node, context, nonNameProps, false, false);
|
|
4289
4288
|
slotProps = props;
|
|
4290
4289
|
if (directives.length) {
|
|
4291
4290
|
context.onError(createCompilerError(36 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */, directives[0].loc));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/compiler-core",
|
|
3
|
-
"version": "3.2.34
|
|
3
|
+
"version": "3.2.34",
|
|
4
4
|
"description": "@vue/compiler-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/compiler-core.esm-bundler.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@vue/shared": "3.2.34
|
|
35
|
+
"@vue/shared": "3.2.34",
|
|
36
36
|
"@babel/parser": "^7.16.4",
|
|
37
37
|
"estree-walker": "^2.0.2",
|
|
38
38
|
"source-map": "^0.6.1"
|