Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve Vue type declarations for more canonical usage #5887
This PR improves the Vue
The best part about this change is that it makes using Vue easier when users choose not to use classes and inheritance. In other words, users and can more easily
There's definitely some amount of complexity that's been introduced but I'm willing to iterate on this with the help of others. Given the feedback that we've heard on TypeScript-Vue-Starter, it's been a positive experience for users.
Fixes many of the issues users have asked about in #478.
Tests are probably failing at this point because I need to update the project's dependency on TypeScript.
HerringtonDarkholme left a comment •
Thanks again for the awesome work! It really push Vue's typing to the horizon of TypeScript!
Since this definition is very sophisticated, it is even nicer to capture compiling error in test as well as compiling success. So we can ensure our definition correctly reject wrong code. In TS repo we have baseline test. In other langauges, for example Shapeless, a type level library in Scala, have artifacts like macro to test compilation error.
Do you have any suggestion for library author to test compiling error?
@HerringtonDarkholme the problem with your suggestion is that it still breaks people who've done module augmentations (because you're moving from an interface to a type alias) but I think that would potentially be okay. It's just something to keep in mind.
Would it be okay to pull this in and then revisit that change instead? It might be easier for the core team to gauge the impact of that.
Just pushed a few new commits, but not sure why the build is failing.