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

template compile will generate useless createVNode import when the component can be statically optimized #2739

Closed
07akioni opened this issue Dec 6, 2020 · 1 comment · Fixed by #2938
Labels
🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. 🐞 bug Something isn't working scope: compiler

Comments

@07akioni
Copy link
Contributor

07akioni commented Dec 6, 2020

Version

3.0.4

Reproduction link

https://vue-next-template-explorer.netlify.app/#%7B%22src%22%3A%22%3Ctemplate%3E%5Cn%20%20%3Ctemplate%20v-if%3D%5C%22column.render%5C%22%3E%5Cn%20%20%20%20%3Crender%20%3Arender%3D%5C%22()%20%3D%3E%20column.render(row%2C%20index)%5C%22%20%2F%3E%5Cn%20%20%3C%2Ftemplate%3E%5Cn%20%20%3Ctemplate%20v-else%3E%5Cn%20%20%20%20%7B%7B%20row%5Bcolumn.key%5D%20%7D%7D%5Cn%20%20%3C%2Ftemplate%3E%5Cn%3C%2Ftemplate%3E%22%2C%22options%22%3A%7B%22mode%22%3A%22module%22%2C%22prefixIdentifiers%22%3Afalse%2C%22optimizeImports%22%3Afalse%2C%22hoistStatic%22%3Afalse%2C%22cacheHandlers%22%3Afalse%2C%22scopeId%22%3Anull%2C%22inline%22%3Afalse%2C%22ssrCssVars%22%3A%22%7B%20color%20%7D%22%2C%22bindingMetadata%22%3A%7B%22TestComponent%22%3A%22setup%22%2C%22foo%22%3A%22setup%22%2C%22bar%22%3A%22props%22%7D%7D%7D

Steps to reproduce

image

https://vue-next-template-explorer.netlify.app/#%7B%22src%22%3A%22%3Ctemplate%3E%5Cn%20%20%3Ctemplate%20v-if%3D%5C%22column.render%5C%22%3E%5Cn%20%20%20%20%3Crender%20%3Arender%3D%5C%22()%20%3D%3E%20column.render(row%2C%20index)%5C%22%20%2F%3E%5Cn%20%20%3C%2Ftemplate%3E%5Cn%20%20%3Ctemplate%20v-else%3E%5Cn%20%20%20%20%7B%7B%20row%5Bcolumn.key%5D%20%7D%7D%5Cn%20%20%3C%2Ftemplate%3E%5Cn%3C%2Ftemplate%3E%22%2C%22options%22%3A%7B%22mode%22%3A%22module%22%2C%22prefixIdentifiers%22%3Afalse%2C%22optimizeImports%22%3Afalse%2C%22hoistStatic%22%3Afalse%2C%22cacheHandlers%22%3Afalse%2C%22scopeId%22%3Anull%2C%22inline%22%3Afalse%2C%22ssrCssVars%22%3A%22%7B%20color%20%7D%22%2C%22bindingMetadata%22%3A%7B%22TestComponent%22%3A%22setup%22%2C%22foo%22%3A%22setup%22%2C%22bar%22%3A%22props%22%7D%7D%7D

What is expected?

createVNode shouldn't be imported

What is actually happening?

createVNode is imported

@07akioni 07akioni changed the title compiler sfc will generate useless createVNode import when the component can be statically optimized template compile will generate useless createVNode import when the component can be statically optimized Dec 6, 2020
@HcySunYang
Copy link
Member

@posva posva added 🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. scope: compiler 🐞 bug Something isn't working labels Dec 7, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Oct 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. 🐞 bug Something isn't working scope: compiler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants