4 ms·
> I guess this is targeting the vuejs crowd Vue is written in TS and has first-class support for it, even at the template layer.
by epolanski 2y ago
> I guess this is targeting the vuejs crowd
Vue is written in TS and has first-class support for it, even at the template layer.
- IshKebab 2y agoOnly since Vue 3 though, and the types are still not as good as React.
- epolanski 2y agoVue 3 has 6 years at this point. Also, could you expand on the fact that types are "still not as good" as React? Can you make an example?
- IshKebab 2y agoSadly not because it's been about 6 years since I looked at it! (We ended up switching to React.) IIRC it's pretty close, but you'll still end up writing things like `{ type: String, required: false }` where in React you'd just write `string | undefined`. I'm sure I would find many more issues if I was using it in anger, because it's building on a foundation that didn't have Typescript in mind. E.g. see this thread: https://www.reddit.com/r/vuejs/comments/l456fl/is_vue_3_really_that_typescript_friendly/ https://www.reddit.com/r/vuejs/comments/l456fl/is_vue_3_real...
- Timon3 2y ago> IIRC it's pretty close, but you'll still end up writing things like `{ type: String, required: false }` where in React you'd just write `string | undefined`. In Vue you also write `string | undefined` since Vue 3. Also note that the thread you linked is 4 years old.
- IshKebab 2y ago> In Vue you also write `string | undefined` since Vue 3. I took that example from the current official Vue 3 docs: https://vuejs.org/guide/typescript/overview#general-usage-notes https://vuejs.org/guide/typescript/overview#general-usage-no... > Also note that the thread you linked is 4 years old. So 2 years into Vue 3. Has anything changed? I mean it's not bad enough to be a dealbreaker any more like it was with Vue 2. The real dealbreaker is still the reactivity system which leads to spaghetti very quickly.
- Timon3 2y ago> I took that example from the current official Vue 3 docs: Yes, that API also exists as compatibility with the Options API, but this is what you should use: https://vuejs.org/guide/typescript/composition-api.html#typing-component-props https://vuejs.org/guide/typescript/composition-api.html#typi... > So 2 years into Vue 3. Has anything changed? Yes, e.g. templates are type-checked now. If you have specific things that aren't supposed to work, please list them. > The real dealbreaker is still the reactivity system which leads to spaghetti very quickly. I've had much better experiences with Vue than with React in this regard.
- deleted 2y ago[deleted]
- silverwind 2y agoVue with SFCs is not actually typescript because typescript can not parse the SFC syntax, you need a forked typescript called `vue-tsc` for that. Shows what a hack vue really is.