Babel 6.0 Released
babeljs.io
babeljs.io
> This means when you install Babel it will no longer transpile your ES2015 code by default.
what I really see is "This means that Babel no longer works out of the box and is now harder to use."
Was any thought given to how much additional complexity this adds to what was previously (https://babeljs.io/docs/setup/#babel_cli) a very simple way to get started?
I may do a followup blog post about it.
>You have invoked the "Oh, but there's a setting to turn off that stupid behavior" defense. I am showering you with negativity.
My main concern was raised in the longer thread with you. It is negative because I don't see this as a positive move. Nobody explained why changing the default behavior is a good move (even if it's easy to add back), or what it has to do with a desire for modular internals (since those don't preclude that).
In any case, Babel has been a valuable tool and I really hope this direction comes out for the best.
npm install babel-cli babel-preset-es2015
echo "class Foo {}" > test.js
babel --presets es2015 test.js
From: https://twitter.com/sebmck/status/659806490904166401Time to transpile "class Foo {}"
babel 5.8.23: 0.55 real, 0.54 user, 0.05 sys
babel 6.0.2: 2.37 real, 2.19 user, 0.23 sys
Why is babel 6.0 four times slower than 5.8? babel 5: 0.47s user 0.06s system 101% cpu 0.519 total
babel 6: 0.47s user 0.06s system 102% cpu 0.508 total
Want to hop in our Slack channel? http://slack.babeljs.io(edit) Then I leave the babel 6.0.2 install as is and then run it against a node 4.2.1 binary - the babel 6.0.2 speed is once again 0.55s - no difference.
So I removed both the node 5.0.0 and babel 6.0.2 installs, re-installed node 4.2.1 with npm 2.14.7 and ran the following commands:
npm install babel
npm install babel-cli
npm install babel-preset-es2015
node_modules/.bin/babel -V
6.0.2 (babel-core 6.0.2)
echo "class Foo {}" | time node_modules/.bin/babel --presets es2015
2.55 real, 2.37 user, 0.23 sys
So the babel 6.0.2 speed difference is not due the node version, but may have something to do with the different npm versions and how they install node_modules, or the fact that I installed the modules one at a time.Using Mac OS X 10.9.5 if it matters.
$ uname -v
#94-Ubuntu SMP Thu Jun 18 00:27:10 UTC 2015
$ node -v
v4.2.1
$ npm -v
2.14.7
$ npm install babel
$ npm install babel-cli
$ npm install babel-preset-es2015
$ node_modules/.bin/babel -V
6.0.2 (babel-core 6.0.2)
$ echo "class Foo {}" | time node_modules/.bin/babel --presets es2015
2.49user 0.12system 0:02.58elapsed 101%CPU
Compared to babel 5.8.23 on same Linux VM: $ babel -V
5.8.23 (babel-core 5.8.24)
$ echo "class Foo {}" | time babel
0.58user 0.02system 0:00.57elapsed 106%CPUTake a look at Rollup.
Great job btw!
I have been wondering about this a lot. It feels like about a year since writing then transpiling ES6 became a fairly mainstream approach, and we're nowhere near having full ES6 support in enough (or actually any, for now at least) browsers with a high proportion of usage.
This is manageable because you can just reason "well, I'll transpile everything to ES5" and be done with it. But what happens when most browsers do support ES6, but not ES7, or ES8 - what about when people don't update browsers, etc. I am really worried about this becoming such a nightmare that the default will always to be to transpile everything to an older version (probably 5 or 6) for the next 2-3 years just for safety, even when some browsers do support new versions coming out.
Can anyone point me to any resources which address and discuss this issue? Your idea about specific browser version targeting in the transpiler is a great one, and one I'd not even considered before, thanks.
Caniuse has some data on Javascript support, but I'm not sure if it is at a sufficiently detailed level for this purpose.
Even if you can list a version number for each of the major browsers you need to support, that'd be awesome.
We actually tell all of our clients using our Web app to update to the latest browser when possible. Hopefully the days of companies not upgrading their browsers are almost behind us... But I'm sure many will be stuck supporting Safari 8 for example, which has very little es6 support, for a while. I know of some large corporations who can't upgrade to IOS 9 and thus Safari 9 because of ivp6 issues...
Some features are pretty well supported in the major desktop browsers, but if you also include mobile browsers it doesn't look that good.
I decided to check back in a couple years.
Hmm, while this might work out for Babel, this is exactly how projects lose focus and falter.
The Eclipse IDE is a prime example of this BS -- there are tons of others.
I can only see this improving things as people start using what was Babel internals directly and reporting issues on them as they are discovered.
Facebook has been doing this a lot the past few weeks and they've found a bunch of issues that we never caught.
But "we're now becoming a platform" raises red flags that it could mean things further than that -- the kitchen sink approach.
(Which is what people used Babel for in the first place).
To me this signals: "we're now an abstract collection of tools for various js related tasks, no singular focus on being the best transpiler".
If literally anyone else wants to chat, feel free to ping me on other channels.