5 ms·
Yeah this is great. Last time I tried, Vue itself wasn't too bad to get going with TS. The real issue for us was Vuex. The official examples and the Typescript
by jwdunne 8y ago
Yeah this is great. Last time I tried, Vue itself wasn't too bad to get going with TS. The real issue for us was Vuex. The official examples and the Typescript examples we found looked completely different. It wasn't easy to get started.
We actually moved to React + Redux since it was early enough in the project to make that decision. Typescript support is much better there. If typescript support was better in Vue/Vuex, I doubt we'd have made that decision.
- lazarljubenovic 8y ago> Vue itself wasn't too bad to get going with TS Last time I tried, there wasn't any support for type check across component boundaries (props, events). Did something change? A deal-breaker for me. I mostly know types from within the component; if you keep them small enough it's not much of an issue to just look up/down to check for a name, for example. But cross-component communication is where I need TS the most. Hopefully 3.0 addresses that (didn't read the whole article thoroughly, maybe it's mentioned).
- wooptoo 8y agoProps can have a type.
- basil-rash 8y agoThe type is verified at runtime though
- bradstewart 8y agoIt can also be verified at compile time when using vue-class-component.
- lazarljubenovic 8y agoIf it's a primitive type, yes. Throw in a union, a generic, or a conditional and everything blows up.
- jwdunne 8y agoOh wow. We didn't get far enough to notice that was a problem. We needed Vuex for something and that's where we got stuck and switched. It's a good job - at that stage in the project, it wouldn't have been a big problem so we didn't notice. If we had continued, I would have a hard time justifying a switch at that stage and could have been in a bit of a corner right now.