Skip to content

Conversation

NikhilVerma
Copy link

Typescript decorators have a known issue that they can't mutate their target types. See extended discussion here: microsoft/TypeScript#4881

What this means is that if we use the @Component decorator syntax, we have no way to add any statically extractable components list if we pass any. This prevents advanced usages of Typescript components.

However if we allow the consumers to define a static components property, tools like Volar - https://github.com/johnsoncodehk/volar (which also includes vue-tsc) can extract the child-component types.

Another benefit to this is that we don't need to introduce a breaking change, as if someone defined a static property in their class components right now vue-class-component will not extract them anyway.

@NikhilVerma NikhilVerma closed this Dec 8, 2022
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.

1 participant