Live data from Hacker News

If TypeScript is so great, how come all notable ReactJS projects use Babel?

discuss.reactjs.org

101–110 of 247 posts

Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?

#102
post #43

Please don't bury this comment completely. I am going to be honest and tell you that I believe TypeScript is pure embrace, extend, extinguish from Microsoft. And I am amazed honestly that so many web developers are eating it up.

Considering it is open source, this would be the death of the project for them. Someone would fork it and keep it at a specific version, maybe with community additions. Existing projects could just keep on using it at that version, or move on to ES6 equivalents with little change.

Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?

#103

I would have switched to typescript but I had to rename EVERYTHING from something to something else in order to use TypeScript. If that's how "compatible" starts, well, no thanks cause clearly that's just the start of the pain. Compatible should be same files, new compiler = "just works".

I have not encountered this problem. Can you provide an example?

Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?

#105
post #76

Edit: Misleading charts, figures and conclusions ahead, see @nathancahill's reply https://npm-stat.com/charts.html?package=babel&package=types... Babel has faltered since the V6 release, TypeScript is still growing fast, so I'd expect the React world to follow suite, even if Facebook itself pushes Flow... NPM downloads in August (rounded): typescript: 2,000,000 babel: 620,000 (down from 890,000 in November 2015) flow…

Well, the V6 release made babel modular, so the babel package is no longer the right one to compare against. Look at babel-runtime: 4,600,000 or babel-core: 4,300,000 vs typescript: 2,100,000.

Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?

#106
post #63

Earlier quoted context omitted.

TS seemed more willing to interoperate with the rest of the JS ecosystem - gradual typing, external .d.ts files for popular libraries, working with existing build tools and module systems. Whereas Dart felt like more of a gated community where you were expected to do things the Dart way and there wasn't much support for traditional JS.

Dart has gradual typing > working with existing build tools and module systems I'd say they replaced it with a better tool, pub. The one good argument you have there is .d.ts files. Dart lacks them, but there are tools to generate js bindings from those same .d.ts files. https://github.com/jirkadanek/definitely_typed I haven't used it though, so I can't say if it works as advertised.

> I'd say they replaced it with a better tool, pub.

Right but that route ends in forcing people to leap to a whole different ecosystem before they can even try your thing. Whereas with typescript you could put a single .ts file in your existing project without messing with anything else.

Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?

#107
post #63

Earlier quoted context omitted.

TS seemed more willing to interoperate with the rest of the JS ecosystem - gradual typing, external .d.ts files for popular libraries, working with existing build tools and module systems. Whereas Dart felt like more of a gated community where you were expected to do things the Dart way and there wasn't much support for traditional JS.

Dart has gradual typing > working with existing build tools and module systems I'd say they replaced it with a better tool, pub. The one good argument you have there is .d.ts files. Dart lacks them, but there are tools to generate js bindings from those same .d.ts files. https://github.com/jirkadanek/definitely_typed I haven't used it though, so I can't say if it works as advertised.

What's awesome about `pub`? If you're talking to someone like me who uses `npm`, `webpack`, and is now considering `rollup` ... what am I missing if I don't look at `pub`?

Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?

#108

Why waste your time with half-baked type systems that try to achieve some compromise over JS idiosyncrasies. Go all in with purescript[0] :D Simple, elegant, strong typed and compiles to JS. [0]: http://www.purescript.org/

Because freedom? Typescript is a superset of JavaScript, which means all JavaScript is valid typescript. So you're never faced with the difficult choice of locking yourself to one language/platform. JavaScript is awesome, it just doesn't scale to large projects because you cannot efficiently refactor it. Typescript solves this problem beautifully. You can easily add whatever type information you need to effectively work with the codebase, whilst being compatible with all JavaScript libraries and the ecosystem.

Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?

#109
post #76

Edit: Misleading charts, figures and conclusions ahead, see @nathancahill's reply https://npm-stat.com/charts.html?package=babel&package=types... Babel has faltered since the V6 release, TypeScript is still growing fast, so I'd expect the React world to follow suite, even if Facebook itself pushes Flow... NPM downloads in August (rounded): typescript: 2,000,000 babel: 620,000 (down from 890,000 in November 2015) flow…

[deleted]

Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?

#110

Speaking as the person who implemented JSX support for TypeScript, I question the premise! JSX support (and implementation of React semantics for typechecking that JSX) was a very popular feature request. I can tell you just from how quickly people notice when something JSX-related changes in the nightly build that there are a lot of people using TypeScript with React. Also, since this seem to be a popular misconcept…

> It would only increase the concept count in an educational setting where you want to only show the thing you're trying to explain. As someone who has written a long tutorial, this makes total sense. When I was first looking at the react ecosystem, it was very frustrating because of the high cost of picking pieces to work together. I really liked http://teropa.info/blog/2015/09/10/full-stack-redux-tutorial... becaus…

This is basically my frustration with the whole trend toward smaller pieces over big monoliths. I don't need a best-in-class every tiny little thing; I just want reasonable tools I can expect to work together well.
Post reply on HN