@@ -31,7 +31,6 @@ const transformJSXSpreadAttribute = (
31
31
const { properties } = argument . node ;
32
32
if ( ! properties ) {
33
33
if ( argument . isIdentifier ( ) ) {
34
- console . log ( isConstant ( argument . node ) , argument . node )
35
34
walksScope ( nodePath , ( argument . node as t . Identifier ) . name ) ;
36
35
}
37
36
mergeArgs . push ( argument . node ) ;
@@ -62,7 +61,7 @@ const getJSXAttributeValue = (
62
61
63
62
/**
64
63
* Check if an attribute value is constant
65
- * @param path
64
+ * @param node
66
65
* @returns boolean
67
66
*/
68
67
const isConstant = (
@@ -407,7 +406,7 @@ const transformJSXElement = (
407
406
}
408
407
409
408
// @ts -ignore
410
- const createVNode = t . callExpression ( createIdentifier ( state , useOptimate ? 'createVNode' : 'h ') , [
409
+ const createVNode = t . callExpression ( createIdentifier ( state , 'createVNode' ) , [
411
410
tag ,
412
411
// @ts -ignore
413
412
compatibleProps ? t . callExpression ( state . get ( 'compatibleProps' ) , [ props ] ) : props ,
@@ -426,7 +425,11 @@ const transformJSXElement = (
426
425
] . filter ( Boolean as any as ExcludesBoolean ) )
427
426
: t . arrayExpression ( children )
428
427
) : 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
+ ) ,
430
433
! ! dynamicPropNames . size
431
434
&& t . arrayExpression ( [ ...dynamicPropNames . keys ( ) ] . map ( ( name ) => t . stringLiteral ( name as string ) ) ) ,
432
435
] . filter ( Boolean as any as ExcludesBoolean ) ) ;
0 commit comments