Live data from Hacker News

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

discuss.reactjs.org

111–120 of 247 posts

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

#111

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/

A better debugging experience, for one.

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

#112

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 w…

Does that include ES6 ? What parts of JS do they consider a subset of typescript ? Can i keep my type declarations in a different file than my .js code like flow does ? (thus ensuring compatibility while keeping the functionality of typescript)

How far can i go with typescript until i need to use babel ?

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

#113
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.

Good call, that's a very different chart.

https://npm-stat.com/charts.html?package=babel-core&package=...

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

#114
post #87
post #81

Earlier quoted context omitted.

What do you mean "fait accompli"? Was the Dart team supposed to give the community a chance to abort the language from existing, and the community was upset that it was completed and published without the input of people who wanted it not to be?

> Was the Dart team supposed to give the community a chance to abort the language from existing No, he means that the Dart team was supposed to solicitate opinions on how to build Dart and what the best objectives for it would be, but instead they showcased it in "almost done" form, and only then tried to attract a community.

This. While yes, it was a long way from "standardised" and a lot changed between what Google initially published and the Ecma standard, many fundamental design decisions were made internally and there was never any real influence externally over that. Those are fundamental design decisions where to change them you essentially need to start from scratch.

The other big problem was that it was done with the VM being a major part of the project with the intent of getting it into Chrome, obviously without having talked that much with several of the people who have significant influence over such things in (then) WebKit, even those within Google. That the VM was going to be outright objected was entirely predictable.

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

#115
post #72
post #7

Because a lot of notable ReactJS projects are irritatingly enamored with all the latest ES6/ES7/ESCloudCuckooLand features, not all of which are supported by TypeScript. I've noticed this a lot in the Redux realm. For every possible problem there seems to be a solution that harnesses one particular new/proposed bell & whistle.

As far as I've seen, it's really only Object spread (likely ES2017 feature) that's commonly used that is not yet supported by TypeScript. Microsoft has promised support for it in TS 2.1, and generally stays on top of ECMAScript proposals that have gained enough traction that they seem likely to ship.

On the other hand, Flow is removed from the code transformation, so it doesn't have to bother with keeping up with the spec. That's a pretty strong point in Flow's favor in my opinion, single responsibility principle and all that :)

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

#116
post #89

Earlier quoted context omitted.

> Dart doesn't introduce that many advantages over JS for all of its differences As someone with experience in both languages, I could not disagree more. > Dart was originally presented as a wholesale replacement of Dart I think you meant replacement of JS here. I guess it depends entirely on what you think of JS as a language. I, for one, would rather a language that fixes core issues with JS, instead of just being…

> As someone with experience in both languages, I could not disagree more. Elaborate then. Because one's major advantages can be another's (and sometimes, objective) trivialities...

https://www.dartlang.org/guides/language/language-tour

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

#118

I was always wondering why HN crowd is ok with TS and so prejudiced against Dart - Dart has NG2, await async in older browsers and good tooling (webstorm, vscode) and much saner package system. When doing lot of small web apps - it's easier to mantain.

Dart is a special cookie. You can't use dart with all of Javascript's ecosystem.

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

#119
post #106

Earlier quoted context omitted.

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.

Yes, I agree with your point that typescript is easier to hop into if you have an existing js project.

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

#120
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.

Oh... indeed, I updated my post.
Post reply on HN