Skip to content

Commit 858f39c

Browse files
committed
chore: use BAIL instead of h
1 parent 9454655 commit 858f39c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/babel-plugin-jsx/src/transform-vue-jsx.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const transformJSXSpreadAttribute = (
3131
const { properties } = argument.node;
3232
if (!properties) {
3333
if (argument.isIdentifier()) {
34-
console.log(isConstant(argument.node), argument.node)
3534
walksScope(nodePath, (argument.node as t.Identifier).name);
3635
}
3736
mergeArgs.push(argument.node);
@@ -62,7 +61,7 @@ const getJSXAttributeValue = (
6261

6362
/**
6463
* Check if an attribute value is constant
65-
* @param path
64+
* @param node
6665
* @returns boolean
6766
*/
6867
const isConstant = (
@@ -407,7 +406,7 @@ const transformJSXElement = (
407406
}
408407

409408
// @ts-ignore
410-
const createVNode = t.callExpression(createIdentifier(state, useOptimate ? 'createVNode' : 'h'), [
409+
const createVNode = t.callExpression(createIdentifier(state, 'createVNode'), [
411410
tag,
412411
// @ts-ignore
413412
compatibleProps ? t.callExpression(state.get('compatibleProps'), [props]) : props,
@@ -426,7 +425,11 @@ const transformJSXElement = (
426425
].filter(Boolean as any as ExcludesBoolean))
427426
: t.arrayExpression(children)
428427
) : t.nullLiteral(),
429-
!!patchFlag && t.addComment(t.numericLiteral(patchFlag), 'trailing', ` ${flagNames} `, false),
428+
!!patchFlag && (
429+
useOptimate
430+
? t.addComment(t.numericLiteral(patchFlag), 'trailing', ` ${flagNames} `, false)
431+
: t.numericLiteral(PatchFlags.BAIL)
432+
),
430433
!!dynamicPropNames.size
431434
&& t.arrayExpression([...dynamicPropNames.keys()].map((name) => t.stringLiteral(name as string))),
432435
].filter(Boolean as any as ExcludesBoolean));

0 commit comments

Comments
 (0)