Why can't Vue at least make its OWN types compilable / extendable? #10262
Replies: 3 comments 4 replies
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as spam.
This comment was marked as spam.
-
The timeline is this:
Now we are here, where the (AST-based) compiler from 3.3 that analyses types for props declarations isn't (yet?) smart enough to support some of the more complex types we have been shipping since 3.0 So couldn't we "just" simplify the types? That can't be too hard, now, can it? Well, we have been shipping these types for a long time now. Some of our language tooling relies on these types. They are likely in use in many apps in other use cases than "extending them for props declarations". So it would prove pretty tricky to "just" simplify them while 1) still covering all the current applications they cover and 2) not break current usage in existing apps. The more promising road is likely to further improve the compiler, but that is also a pretty complex task and we simply don't have the bandwidth for this currently. Though we are happy to accept PRs that can solve the problem from either side - types simplification or compiler improvement.
That's an interesting assumption. The issue that you specifically linked to was locked after it has been closed for months, and it was locked by a bot automatically by the following workflow, not by us as maintainers to censor discussion around this topic: https://github.com/vuejs/core/blob/main/.github/workflows/lock-closed-issues.yml Can you link me to any other related issues that have been closed and locked by maintainers while active discussion was going on? |
Beta Was this translation helpful? Give feedback.
-
There have been a number of issues like this raised where the Vue compiler cannot interpret / extend TypeScript types if they are "too complex".
However, the problem is Vue's types itself, which are not extendable, and not supporting TypeScript inference in general.
For example, if you extend
ButtonHTMLAttributes
at all, the Vue compiler will fail. This is because Vue's own definition ofButtonHTMLAttributes
is too complex and not usable as an extends. Were it to be simplified, my understanding is that the Vue compiler would succeed.However, any issue that has been opened regarding this has not only been closed, but has been locked, indicating I assume, that Vue maintainers do not want it discussed? Does anyone know why this is?
Beta Was this translation helpful? Give feedback.
All reactions