Live data from Hacker News

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

discuss.reactjs.org

61–70 of 247 posts

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

#61
post #58

Earlier quoted context omitted.

It puzzles me also. Dart is solid language with great libraries, good tooling and still it is ignored by most developers. The truth is people from JS world seems to like 'cool' languages, but the one who want to be productive just uses boring Java/Dart etc.

Happy Dart programmer here. Great, easy to learn, productive language that runs on browser, server, mobile. I have no idea why Dart isn't used more.

I want to give Dart a chance, because most of it's features seem quite appealing. I decided to start learning JS/Jquery and then move onto to Dart. The fact that everything comes bundled into Dart as a whole dev environment (IDE, compiling,packaging,) and the interoperability with JS make it quite attractive. What is your experience doing web dev with and without Dart (JS vs Dart, pros and cons)? I'd be really interested in your feedback!

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

#62
Anecdotally, at Bloomberg we're in the middle of ramping up TypeScript support in our core server-side stack. Our custom IDE is Windows based, so it was very straightforward to integrate the tserver into the workflow to give developers the choice of writing vanilla JS or TS with additional annotations we send down to the IDE for the core stack. We have the largest single collection of JS I'm aware of and we're eager to see TS take off as we iron out a few corner cases and really get 2,000+ devs using it daily. This isn't the web or Node, so make of it what you will -- but the tserver integration and ease of layering on top of the existing vanilla JS in a progressive manner made it a simple decision.

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

#63

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.

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.

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

#64
I do TypeScript every day for work, and honestly I don't see the point of it. I'm also of the opinion that the iterator pattern nonsense has ruined generated code quality for ES6 transpilers, and that ES5 getters and setters have made it considerably harder for JS engines to do high level optimizations (dead store elimination, invariant hoisting, load merging, etc.).

The sky is falling.

Anyway, you're not going to dissuade anyone. TypeScript looks visually similar to Java and C# enough that managers will think they can adapt Java and C# teams to it in a couple of days; and they won't know how wrong they are until a month or two have passed.

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

#65
post #30

I do not believe compilation nor a type system belong in JavaScript. It's better to have something like "Flow" that does static analysis of the code as you write. I might even go as far as putting on a "tin foil hat" and state that Typescript is a trick to lock you into their proprietary ecosystem of expensive tools that everyone have to buy into just to communicate with you once you are locked in.

> It's better to have something like "Flow" that does static analysis of the code as you write.

What do you think is the advantage of such a thing? IME they tend to end up as an ad hoc, informally-specified, bug-ridden, slow implementation of half of a type system.

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

#66
post #50
post #30

I do not believe compilation nor a type system belong in JavaScript. It's better to have something like "Flow" that does static analysis of the code as you write. I might even go as far as putting on a "tin foil hat" and state that Typescript is a trick to lock you into their proprietary ecosystem of expensive tools that everyone have to buy into just to communicate with you once you are locked in.

My team is 'locked' into TS on a large project. We have yet to purchase any TS related tooling, and have no plans or need to do so. Given that TS transpiles to JS, I'm unsure as to how any project can be truly 'locked' into the ecosystem. I'm really unsure what you are basing your fears upon.

It's not just that it transpiles into JS, if you target ES6 pretty much all tsc does besides validation is stripping type information, access modifiers etc. while basically preserving the code structure, including whitespace. Which means that if you ever want to migrate away from TypeScript you simply run tsc one last time and then you'll have a fairly usable JS codebase.

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

#67
post #26
post #5

Earlier quoted context omitted.

webassembly can't come soon enough. as a developer who doesn't deal with browser frontends what i read in this thread is madness. (3 comments at the time of writing this...)

it's like they don't even realize how ridiculous this shit sounds..

I don't think the point of WebAssembly is to target the DOM. I think it it's to provide a common low level API across browsers that many languages can target.

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

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

Let's say that tomorrow, Microsoft releases a totally-backwards-incompatible build of Typescript, and starts charging for it.

My "way out" of the Typescript ecosystem is:

1.) Change the target to "ES6", and run a compile. 2.) Take those files and use them as my new source files. 3.) Remove Typescript from my build pipeline.

Done. Easiest language migration I've ever done.

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

#69
post #20
post #16

Earlier quoted context omitted.

I recently started using TypeScript for my React projects and I am actually pretty happy. I am not actually sure what you mean by typed immutable records in this context, can you explain in more detail?

Immutable.js ( https://facebook.github.io/immutable-js/ ) doesn't have the greatest typescript type annotations. Due to limitations of TypeScript, there is no way to write types for immutable.js heterogenous maps (homogenous Maps and Vectors are fine though). Since immutable.js collections are recommended to be used with redux, and no one wants to bother using IMJS records instead of just maps, the types end up being…

I see, but using types for some parts of your code is still better than using none.

And yes, actually I am using MobX, too, it's really a good choice for React. Although I miss redux-saga sometimes.

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

#70

Anecdotally, at Bloomberg we're in the middle of ramping up TypeScript support in our core server-side stack. Our custom IDE is Windows based, so it was very straightforward to integrate the tserver into the workflow to give developers the choice of writing vanilla JS or TS with additional annotations we send down to the IDE for the core stack. We have the largest single collection of JS I'm aware of and we're eager…

Curious, but why do you guys have a custom IDE?
Post reply on HN