I love all the people (great developers!) and the technologies (great ideas!) mentioned in this post 🌹. That said I wouldn’t write this if I didn’t believe in it. Also its not a competition. But you need to make a choice for your project and that is where the winning comes in.
You might be a few years in the future where this isn’t even a question. But its a question right now:
TypeScript vs. ES6
ES6 is TypeScript. Here is a venn diagram to help you understand.
TypeScript vs. Babel
They are not the same thing. Babel is a transpiler. TypeScript is a transpiler + type checker.
The following is ES6 (or whatever is the current ES). This code is both valid TypeScript and valid Babel.
const foo = 123; // or any other code you want
You want static analysis. That’s the reason why AngularJS adopted TypeScript as their language of choice.
The greatest adaption of Babel has been by the ReactJS community (an awesome bunch). But TypeScript supports ReactJS out of the box too!
And there is increasing community acceptance of this fact e.g. redux ships with TypeScript definitions.
Maybe someday. But even that is unlikely. Experiments have failed.
Also these experiments are following TypeScript’s suite in terms of syntax. TypeScript really has become the defacto syntax for type annotations thanks to an amazing community of type definition authors.
For further future proofing I’d rather let a TypeChecking compiler do the transpilation for me than one that treats everything as dynamic.
Also you need to create your project today not tomorrow.
TypeScript vs. CoffeeScript
Its not even a question anymore. Once ESNext => ESNow transpilation became popular CoffeeScript interest quickly deteriorated. Just look at the google trend:
TypeScript vs. Dart
The same arguments hold for a few other less popular options e.g. PureScript / Elm. Great ideas. But not enough traction compared to TypeScript.
People have been asking me about TypeScript vs. Flow. So I wrote it down as well. If you like this, don’t forget to click the heart below 🌹.