Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

React itself is written in Flow, but the React team doesn't make any official recommendations as for language or static type syntax to use.

That said, a recent survey of /r/reactjs readers [0] showed 50% using plain JS, 48% TS, and only 2% using Flow . Given that the React ecosystem probably has the most Flow users, I'd say it's safe to describe Flow as dead.

From my viewpoint, TS has more than hit enough critical mass to survive for the long term:

- Microsoft is heavily invested in its ongoing development

- The Angular community requires use of TS

- Per that stat, it's reached solid adoption in the React community (see guides like the React+TS Cheatsheet [1])

- Where CoffeeScript introduced new syntax entirely, TS's focus on being a superset of standardized JS means that there's both less to worry about compat-wise _and_ it can be seen as a way to use new language features instead of Babel.

So, seems like it's going to be around for a while.

I wrote up my thoughts last year on my own experience learning and using TS from both an app dev and library maintainer's perspective [2].

[0] https://www.swyx.io/writing/react-survey-2019/

[1] https://github.com/typescript-cheatsheets/react-typescript-c...

[2] https://blog.isquaredsoftware.com/2019/11/blogged-answers-le...



Which makes me sad: I've built two production systems in Flow, and I found it absolutely delightful, with the caveat that I specifically chose all third party libraries that supported Flow as well. It's type system (and `import type` instead of Typescript's overloading of `import`) was ridiculously powerful, and back then significantly more-so than Typescript. That's no longer the case, of course, Typescript has smartly stolen most of the advantages Flow had, and it has so much more support from the outside world that it'd be silly to use Flow today.

On top of that, I think a lot of the momentum of a powerful type system for front-end development has moved (in the React world) towards Reason anyway. Between Typescript and Reason, we're spoiled for choice in building robust front-ends that stomp bugs early and often!


Yeah, I only briefly dabbled with Flow myself a few years back. By the time I got around to looking at TS and Flow again, it was clear TS had won.

Someone asked me the other day why TS had gotten more popular than Flow, and this was the summary I gave them:

> Early on, Flow was considered to be better at actual type-checking. But, the TS team has kept cranking out releases on a monthly basis, and mostly caught up in that regard.

> The TS community put a lot of effort into defining types for libraries, which convinced lib authors to write libs in TS, which convinced people to adopt TS because there were more libs with types.

> Meanwhile, the Flow team was pretty quiet, there were complaints about Flow sucking up memory and crashing, and Flow anecdotally seemed to have a lot of breaking changes in its analysis that made upgrading a pain. (The breaking changes were likely making the analysis better, but compilation errors are compilation errors).

> Eventually it hit a tipping point and TS adoption reached critical mass. Now, very few people outside of FB use Flow.

Reason looks interesting, and it's certainly got some very smart folks working on it, but it's still very much at the "niche experimental toy" level compared to TS.


Typescript is introducing 'import type', not sure if it works the same way as flow as I've never used that.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: