JetBrains / web-types

JSON standard for documenting web component libraries for IDEs, documentation generators and other tools
Apache License 2.0
285 stars 25 forks source link

Web types vs type definitions in Vue & Nuxt #61

Closed TechAkayy closed 1 year ago

TechAkayy commented 1 year ago

Hi there,

I have watched few of your videos on youtube and I have a pretty good understanding of what web types are. Though, one thing still is unclear, would be great if you can clarify for me and for anyone reading this thread.

Typescript provides the necessary information for IDEs (for eg, Volar in vs-code is ts-based) and most of the UI libraries like vuetify, quasar etc are already shipping type definitions which helps with autocompletion, highlighting etc when working on vue templates. Does this mean, this overrides the need for web-types in vue-based projects?

For eg, I'm looking at nuxt3 support in Webstorm here - https://youtrack.jetbrains.com/issue/WEB-54200, and there was web-types for nuxt2 previously (https://github.com/nuxt/nuxt.js/pull/7611), but no web-types for nuxt3. Also, @web-types/vue on npm was never updated in the last 2 years. Where should I look for the latest vue 3.2's web-types?

Of course, I understand the fact that this is an open standard and will be useful for various other frameworks, but does typescript override the use of web-types? Also, with regards to consuming web-types, when both typescript defn & web-types info is available for a tag/attribute, how does webstorm deal with this scenario? Does it does some kinda merging of data, or prefer one over the other?

Context: I'm working on a visual drag & drop tool (to build vue applications), and as we don't deal with typescript/language servers in our tool, web types are very very helpful for us, hence the curiosity about the future of web-types. For now, glad that most of the top vue-based ui libraries are already auto-generating web-types.

Thanks in advance.

piotrtomiak commented 1 year ago

@TechAkayy I hope I replied to most of your questions in https://github.com/JetBrains/web-types/issues/62. I am really happy you find Web Types useful for your project! Which language is your tool written in?

Web Types are providing more information than TypeScript definition files. In version 2022.3 though, we have finally implemented support for merging the information, and if you have an IDE plugin you could use that to your advantage.

As I can see it the only advantage of using the Vue framework Web Types for you, would be if you can execute queries on the model and have patterns evaluated. I hope to release NPM package, which would be translation of our Kotlin code soon.

piotrtomiak commented 1 year ago

@TechAkayy - I am closing this issue, feel free to file new if you have any more questions