-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
fix(types): ensure createBlock() helper accepts Teleport and Supsense types (fix: #2855) #5458
Conversation
… types not their internal counterparts (TeleportImpl and SupenseImpl) fix: #2855
✔️ Deploy Preview for vue-sfc-playground ready! 🔨 Explore the source changes: f064263 🔍 Inspect the deploy log: https://app.netlify.com/sites/vue-sfc-playground/deploys/621216212e54bb0007637b87 😎 Browse the preview: https://deploy-preview-5458--vue-sfc-playground.netlify.app/ |
✔️ Deploy Preview for vuejs-coverage ready! 🔨 Explore the source changes: f064263 🔍 Inspect the deploy log: https://app.netlify.com/sites/vuejs-coverage/deploys/62121620701b550007932086 😎 Browse the preview: https://deploy-preview-5458--vuejs-coverage.netlify.app |
✔️ Deploy Preview for vue-next-template-explorer ready! 🔨 Explore the source changes: f064263 🔍 Inspect the deploy log: https://app.netlify.com/sites/vue-next-template-explorer/deploys/621216212e54bb0007637b85 😎 Browse the preview: https://deploy-preview-5458--vue-next-template-explorer.netlify.app |
@pikax could you have a look at this? Also, any idea where to test this? I didn't find any other test-dts tests for these compiler-helpers like createBlock() so not sure where to put them/how to do them. |
It looks good to me, we usually don't have test for internal stuff, since the |
That wasn't relevant when we didn't really offer typechecking for the template/generated render function, but now with Volar and vue-tsc we effectively do, and the issue addressed by this PR is a result of that. Seems we generally need a few tests in that area. |
This changes would make possible building teleport and suspense with vite. Currently we have workaround (binding teleport component) which makes it ugly and difficult to unit test (stub not replacing binded teleport component in time). |
… types (fix: vuejs#2855) (vuejs#5458) Co-authored-by: Carlos Rodrigues <carlos@hypermob.co.uk>
… types (fix: vuejs#2855) (vuejs#5458) Co-authored-by: Carlos Rodrigues <carlos@hypermob.co.uk>
ensure createBlock() helper accepts Teleport and Supsense types, not their internal counterparts (TeleportImpl and SupenseImpl).
createBlock()
only acceptsVNodeTypes
as first argument, and this type only included the internal types of Teleport and Suspense -TeleportImpl
andSuspenseImpl
.This PR ads the public types
Teleport
andSuspense
and thus ensures that the following, compiler-generated code now passes in vue-tsc and Volar:fix: #2855