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...
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!
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.
For anyone else, yeah, they should probably be using TypeScript in 2020.
If yes, why do you not use it often now?
Edit: read it wrong, nevermind.
> time spent fixing things that would have been caught [by Typescript] out weights the cons of using typescript
I also wear a bunch of hats. So retaining all the new knowledge gets a bit hard. Sometimes its easier for me to fall back to patterns I used over the past 20 years of full stack development. If I had the time I would use typescript everywhere.
It's not fair - Microsoft and co. have done a tremendous job with the implementation and documentation of Typescript. But the reality exists nonetheless.
TS is very, very close to being standard practice. It's already being used by over 50% of JS developers [0]. It doesn't have to be beginner/tooling friendly to be widespread.
[0]: https://2019.stateofjs.com/javascript-flavors/typescript/
Thats like saying only 50% browsers can render html so its standard.
ie. if i am building an electron app, we have atleast 4 different JS environments (UI thread, background thread, web worker, nodejs worker, nodejs-fork, test-runner environment) that all have different levels of compatibility with different JS standards.
importing and exporting libraries in mixed mode is the worst thing about JS, bar none. The amount of obscur errors one needs to deal to get a debug-source-code-stepable pipeline up and running astounding.
But as I said the problem is Typescript inherits the whole mess of bundlers like Webpack and Gulp because they are REQUIRED to make any of it work in production. Ideally Typescript would own the entire bundler step - the closest example would be .NET owning the LINQ and Identity tools/libraries to make the .NET experience so much better.
It's kind of a freak win. I think we can say confidently that nothing is going to usurp it.
Not like any compile-to-JS language has come close even when JS was at its worse. Now JS is so good I don't even know why I'd use another dynamically typed language.
We rarely get blindsided by what actually gets traction because almost nothing does. Something that looks like Typescript isn't going to beat Typescript. Something that's more foreign looking certainly isn't either.
26%, 33%, or 36% are some estimates.
1. https://managewp.com/blog/statistics-about-wordpress-usage
Blocks are essentially react components with a bunch of wordpress apis hooked in / around it.
*Depending on who you define as God, the creator of JS?
That doesn't mean everyone needs to use it.