You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If template refs aren't exposed as public, their types should be 'tree-shaken' from generated .d.ts files.
What is actually happening?
The type of barRef is contained in the generated file Foo.vue.d.ts, but actually it or its properties aren't exposed from Foo.vue with slot or defineExpose.
The truth is that the transpiler(Typescript Compiler) can tree-shake unused code. If you remove <slot></slot> from the template block in Foo.vue, then re-run npx vue-tsc, you will notice that the helper function __VLS_template is removed from the file Foo.vue.d.ts. I think if we could split __VLS_template into multiple functions, such as __VLS_template_slots and __VLS_template_refs, the generated code would be more tree-shaking-friendly.
Vue - Official extension or vue-tsc version
2.1.10
VSCode version
Vue version
3.5.13
TypeScript version
5.5.4
System Info
No response
package.json dependencies
No response
Steps to reproduce
Run
npx vue-tsc
to genereate .d.ts filesWhat is expected?
If template refs aren't exposed as public, their types should be 'tree-shaken' from generated .d.ts files.
What is actually happening?
The type of
barRef
is contained in the generated fileFoo.vue.d.ts
, but actually it or its properties aren't exposed fromFoo.vue
with slot or defineExpose.Link to minimal reproduction
https://stackblitz.com/edit/stackblitz-starters-jtpv84
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: