3 ms·
Last time I tried flow (maybe 6 months ago?), it didn't work very well for me. I can't remember the details unfortunately. Typescript covers pretty much all th
by Keats 11y ago
Last time I tried flow (maybe 6 months ago?), it didn't work very well for me. I can't remember the details unfortunately.
Typescript covers pretty much all the ES6 features that I use while flow is still missing let/const apparently. I only miss async/await and that should be in TS 1.6 so it's not a big deal for me and I believe you should be able to do a TS -> Babel -> ES5 workflow if you wanted by having ES6 as target for TS.
For JSX, I prefer using React.DOM anyway but support will be in 1.6 and is already in master.
TS main selling point is DefinitelyTyped which means typing for pretty much all the third party code and the fact that it's been out for a couple of years now.
A tool to convert .d.ts to flow definition has been on flow short-term todo list since november and without it, flow is not viable for me.
TS definitely shines when starting new projects though, it can be a bit annoying on a legacy codebase.
(I use Pycharm, not VS and it integrates well in it, minus lagging a bit behind versions)
- pluma 11y agoThanks for the insights. I haven't encountered any issues with third party code myself and don't mind the client/server model, but for me the killer app is Babel support (so flow is only a type checker, not another transpiler). Do imports and import resolution work out of the box in TS these days? Last time I tried, I had to jump through hoops to get it to understand node imports and it wouldn't work without magical comments. I also don't want to have to wrap everything in module declarations -- the import logic of node should be sufficient. If TS has sorted these problems out, it might be worth another look for me.
- Keats 11y agoYou just have to declare which external module (3rd party dep) you are using so typescript knows how to apply typings. Ie you can use ES6 imports, you just need to have a /// <reference path="../typings/all.d.ts" /> line or declare them in tsconfig.json now (I believe, haven't checked yet). I agree the modules are tricky and my least favourite thing about TS though
- pluma 11y agoEh. Those magical comments were what turned me off using TS to begin with. If I'm importing stuff, I'm already declaring my dependencies. TS seems to prefer re-inventing the wheel whereas flow just builds on what is already there. But that's just my (unfairly biased) impression. EDIT: Shame Flow is written in OCaml rather than built on Node. That's the only thing I prefer about TS at this point.