From b9ae4c73722b35ae11b9364740bfbd50232a5f21 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Fri, 6 Sep 2024 16:42:47 +0800 Subject: [PATCH 1/2] chore: remove unused variable --- packages/compiler-core/src/transform.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/compiler-core/src/transform.ts b/packages/compiler-core/src/transform.ts index 0fe4ee5b9d9..b47b6b8d408 100644 --- a/packages/compiler-core/src/transform.ts +++ b/packages/compiler-core/src/transform.ts @@ -23,7 +23,6 @@ import { import { EMPTY_OBJ, NOOP, - PatchFlagNames, PatchFlags, camelize, capitalize, @@ -375,7 +374,6 @@ function createRootCodegen(root: RootNode, context: TransformContext) { } else if (children.length > 1) { // root has multiple nodes - return a fragment block. let patchFlag = PatchFlags.STABLE_FRAGMENT - let patchFlagText = PatchFlagNames[PatchFlags.STABLE_FRAGMENT] // check if the fragment actually contains a single valid child with // the rest being comments if ( @@ -383,7 +381,6 @@ function createRootCodegen(root: RootNode, context: TransformContext) { children.filter(c => c.type !== NodeTypes.COMMENT).length === 1 ) { patchFlag |= PatchFlags.DEV_ROOT_FRAGMENT - patchFlagText += `, ${PatchFlagNames[PatchFlags.DEV_ROOT_FRAGMENT]}` } root.codegenNode = createVNodeCall( context, From 50499c99d1ecc2808a154ce6e57788ed47a62301 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Fri, 6 Sep 2024 17:11:49 +0800 Subject: [PATCH 2/2] chore: update --- packages/compiler-core/src/transforms/vIf.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/compiler-core/src/transforms/vIf.ts b/packages/compiler-core/src/transforms/vIf.ts index c3dc8d4ecd0..caefa197efe 100644 --- a/packages/compiler-core/src/transforms/vIf.ts +++ b/packages/compiler-core/src/transforms/vIf.ts @@ -32,7 +32,7 @@ import { processExpression } from './transformExpression' import { validateBrowserExpression } from '../validateExpression' import { CREATE_COMMENT, FRAGMENT } from '../runtimeHelpers' import { findDir, findProp, getMemoedVNodeCall, injectProp } from '../utils' -import { PatchFlagNames, PatchFlags } from '@vue/shared' +import { PatchFlags } from '@vue/shared' export const transformIf: NodeTransform = createStructuralDirectiveTransform( /^(if|else|else-if)$/, @@ -264,7 +264,6 @@ function createChildrenCodegenNode( return vnodeCall } else { let patchFlag = PatchFlags.STABLE_FRAGMENT - let patchFlagText = PatchFlagNames[PatchFlags.STABLE_FRAGMENT] // check if the fragment actually contains a single valid child with // the rest being comments if ( @@ -273,7 +272,6 @@ function createChildrenCodegenNode( children.filter(c => c.type !== NodeTypes.COMMENT).length === 1 ) { patchFlag |= PatchFlags.DEV_ROOT_FRAGMENT - patchFlagText += `, ${PatchFlagNames[PatchFlags.DEV_ROOT_FRAGMENT]}` } return createVNodeCall(