3 ms·
TypeScript is great, but you might look again at flow. ES6 features are being added (I'm adding let/const support) and many already exist. Import/export (incl.
by samwgoldman 11y ago
TypeScript is great, but you might look again at flow. ES6 features are being added (I'm adding let/const support) and many already exist. Import/export (incl. types) are in, fat arrow syntax, destructuring, shorthand syntax for objects.
I get the most value of Flow through statically typed React component props, which is usable today with both `React.createClass`-style and `React.Component`-style components.
In my experience, Flow will infer much more about "plainly" written JavaScript than TypeScript, which will fall back to `any` unless code is annotated.
A small example, function types are contravariant in the negative position in Flow, but bivariant in TS—much weaker!
TLDR, if you haven't looked at Flow recently, look again!
- spicyj 11y agoThanks for contributing to Flow!
- hazza1 11y agoReally like the idea of Flow but doesn't look like IDE support is there yet? This is the killer feature of types in Javascript for me - not sure I'd adopt it until then.
- samwgoldman 11y agoFor sure, tooling is an area that will get better over time. I am quite happy with the very simple vim-flow, but TypeScript's tooling and overall ecosystem (tsd/definitelytyped) is a lot more mature.
- iyn 11y agoThere are some packages that provide support for flow in atom editor, like: https://atom.io/packages/ide-flow https://atom.io/packages/ide-flow I've been testing atom for front-end development in the last few days and it's pretty good, definitely worth checking out (I'm saying this as a vim-lover)
- girvo 11y agoAtom with eslint, the react plugin and eslint-babel is just amazing for ES6/7 and React development. It's so much faster than it used to be, it's actually amazing.
- spion 11y agoI will. By the way, I always use TS with --noImplicitAny, and the number of type annotations I've had to add is rather small and very reasonable (mostly just on function arguments of methods and non-lambda functions). Seems like the flow docs may need an update to reflect the newest additions.