Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(transform-vif): don't need to createBlock for a component #853

Merged
merged 3 commits into from
Mar 20, 2020

Conversation

ysj16
Copy link
Contributor

@ysj16 ysj16 commented Mar 18, 2020

No description provided.

@yyx990803
Copy link
Member

For v-if it actually has to always be a block regardless of type to keep the parent's dynamic children list stable.

@yyx990803 yyx990803 closed this Mar 19, 2020
@ysj16
Copy link
Contributor Author

ysj16 commented Mar 20, 2020

@yyx990803 I still have some confusion, because a component will always add into parent's dynamic children list when create vnode

@yyx990803
Copy link
Member

Yes you're right.

@yyx990803 yyx990803 reopened this Mar 20, 2020
@@ -212,7 +212,10 @@ function createChildrenCodegenNode(
const vnodeCall = (firstChild as ElementNode)
.codegenNode as BlockCodegenNode
// Change createVNode to createBlock.
if (vnodeCall.type === NodeTypes.VNODE_CALL) {
if (
vnodeCall.type === NodeTypes.VNODE_CALL &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a comment here: "component vnodes are always tracked and its children are compiled into slots so no need to make it a block"

@yyx990803 yyx990803 merged commit a3601e9 into vuejs:master Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants