Live data from Hacker News

The State of Babel

babeljs.io

41–50 of 109 posts

Re: The State of Babel

#41
post #30

As an outsider to FE development, when I see posts like this, I just shudder at the complexity of the ecosystem.

From the babel web page: > Babel transforms your JavaScript, You put JavaScript in, And get JavaScript out That says all you need to know about the javascript ecosystem.

I am a Ruby dev so I definitely don't pretend to know, however it does seem wild that something like Babel is even needed.

It seems to me that it's like trying to mix Ruby 1.8.7 and 2x in the same project and needing a tool to translate it into 1.9.3. Why not just write in 1.9.3 if that's the required target?

I clearly don't know what I'm talking about but what's wrong with actually just writing the JavaScript that Babel spits out? Why is something like Babel even tolerated? What I mean is that I would never try to mix five different Ruby versions and expect that to be a good practice. Someone educate me -- I'm not entirely sold on what's happening or why it's considered good.

Re: The State of Babel

#42

Is this where CoffeeScript left off? How would you compare it to CoffeeScript?

There are many differences. One is that CoffeeScript will always need to be compiled. Code written in, e.g. ES7, will not have to be compiled down with Babel anymore once browsers in the wild all support ES7.

Also, AFAIK CoffeeScript restricts you to using JS features found in ES5.

Re: The State of Babel

#43
post #26

Earlier quoted context omitted.

This is a point that is brought up a lot, and I'm happy that our community is having these discussions, but I don't think that this is the best place to bring it up again. This post is intended to convey a lot of technical, inside information about this tool to people who are already using it. If you don't know where to begin with Babel, this is not a good resource. Also, constant negative feedback discourages the cr…

By the way, it's absolutely painless to setup Babel. To use ES6/ES7/ES8 (e.g. async/await), it's just: npm install --save-dev babel-cli babel-preset-latest And then in the package.json: "scripts": { "build": "babel src -d dist --presets latest" }

That's definitely not the impression given by the setup page: http://babeljs.io/docs/setup/

I'm an experienced front-end developer and I must say that that list is intimidating.

Re: The State of Babel

#44
post #26

Earlier quoted context omitted.

This is a point that is brought up a lot, and I'm happy that our community is having these discussions, but I don't think that this is the best place to bring it up again. This post is intended to convey a lot of technical, inside information about this tool to people who are already using it. If you don't know where to begin with Babel, this is not a good resource. Also, constant negative feedback discourages the cr…

By the way, it's absolutely painless to setup Babel. To use ES6/ES7/ES8 (e.g. async/await), it's just: npm install --save-dev babel-cli babel-preset-latest And then in the package.json: "scripts": { "build": "babel src -d dist --presets latest" }

That's definitely not the impression given by the setup page: http://babeljs.io/docs/setup/

I'm an experienced front-end developer and I must say that that list is intimidating.

Re: The State of Babel

#45
post #30

As an outsider to FE development, when I see posts like this, I just shudder at the complexity of the ecosystem.

From the babel web page: > Babel transforms your JavaScript, You put JavaScript in, And get JavaScript out That says all you need to know about the javascript ecosystem.

Except that they are two different versions of JS. It's like transpiling from Java 8 to 6

Re: The State of Babel

#46
post #39
post #30

Earlier quoted context omitted.

From the babel web page: > Babel transforms your JavaScript, You put JavaScript in, And get JavaScript out That says all you need to know about the javascript ecosystem.

What? That it has a huge focus on backwards compatibility because it can't just rely on having the correct language version installed?

You can rely on having the correct version installed. This is an unwillingness to accept that it's not the version you want.

You work out the minimum requirements and write to that, you don't start out with the latest and greatest and work backwards.

Re: The State of Babel

#47
post #30

Earlier quoted context omitted.

From the babel web page: > Babel transforms your JavaScript, You put JavaScript in, And get JavaScript out That says all you need to know about the javascript ecosystem.

Except that they are two different versions of JS. It's like transpiling from Java 8 to 6

I'd consider transpiling from have 8 to 6 equally crazy. If the target is Java 6 you write Java 6.

Re: The State of Babel

#48
post #30

Earlier quoted context omitted.

From the babel web page: > Babel transforms your JavaScript, You put JavaScript in, And get JavaScript out That says all you need to know about the javascript ecosystem.

I am a Ruby dev so I definitely don't pretend to know, however it does seem wild that something like Babel is even needed. It seems to me that it's like trying to mix Ruby 1.8.7 and 2x in the same project and needing a tool to translate it into 1.9.3. Why not just write in 1.9.3 if that's the required target? I clearly don't know what I'm talking about but what's wrong with actually just writing the JavaScript that B…

Nobody's really mixing versions, it transpiles ES6 and above to ES5. You don't have to use Babel, you only use it if you want to use the latest version of JS, ES6. You can happily just use ES5, and many people do.

Why use ES6? Firstly, it's a much better version, it solves a lot of problems (chief of all, it has a module system which ES5 doesn't have, not built in at least). Second, JS technology moves incredibly fast. ES6 will likely be supported 100% before the end of next year in all major browsers. So by then you can drop babel and just have raw code. Same with node.

It was supposed to be fully implemented end of this year or thereabout, but it seems that implementing the module system is problematic. Sadly, it's the most important thing, without which you can't drop babel.

Re: The State of Babel

#50
post #46
post #39

Earlier quoted context omitted.

What? That it has a huge focus on backwards compatibility because it can't just rely on having the correct language version installed?

You can rely on having the correct version installed. This is an unwillingness to accept that it's not the version you want. You work out the minimum requirements and write to that, you don't start out with the latest and greatest and work backwards.

That's not the way FE works. You want to focus on the latest browser APIs as possible, to build more complex interfaces more efficiently. For the unlucky ones stuck on old browsers, you provide a fall back. Luckily modern browsers all auto-update, it's just those stuck with IE10 you need to worry about.
Post reply on HN