If TypeScript is so great, how come all notable ReactJS projects use Babel?
discuss.reactjs.org
If TypeScript is so great, how come all notable ReactJS projects use Babel?
1–10 of 247 posts
Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?
#2I think this has been fixed now. But a couple of weeks ago, I had a case where TS compiler output has to be ES6 (since the code base were using something like constructor.name which isn't in ES5), but then Jest (the test framework) doesn't like ES6 syntax, so Babel is needed to compile whatever Jest didn't like down to just ES5 syntax.
Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?
#3Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?
#4OT: is it me or is Babel incredibly slow in translating ES6 to regular JS?
Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?
#5From personal experience, you probably want Babel anyway even with TS to deal with some weird edge cases. I think this has been fixed now. But a couple of weeks ago, I had a case where TS compiler output has to be ES6 (since the code base were using something like constructor.name which isn't in ES5), but then Jest (the test framework) doesn't like ES6 syntax, so Babel is needed to compile whatever Jest didn't like d…
Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?
#6From personal experience, you probably want Babel anyway even with TS to deal with some weird edge cases. I think this has been fixed now. But a couple of weeks ago, I had a case where TS compiler output has to be ES6 (since the code base were using something like constructor.name which isn't in ES5), but then Jest (the test framework) doesn't like ES6 syntax, so Babel is needed to compile whatever Jest didn't like d…
Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?
#7I'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.
Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?
#8I love TS and using ng2 at work. If I was using React I would probably also skip on TS.
Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?
#9Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?
#10Because 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.
Many React projects use JSX, decorators and class properties to the max, so they needed babel in the first place.
Now if you want to add types, Flow is easier to integrate than switching to another compiler.