by wrong_variable · 10y ago · 0 comments
Just today I had to deal with the fact that babel wraps ALL your generators in some shit function.
Why ? just why ? generation function was supported in browsers longer then the age all the babel maintainers combined.
The worst part is I do not use babel myself - I wouldn't touch it with a ten foot pole but am forced to use it due to my stupid cowokers writing everything using babel - ( why does babel need .babelrc file ?? - is babel such a prominent part of your life that you need .rc files ?? and why does the .rc file need to be specified in every freaking folder ! )
1) babel's docs are also terrible
2) The people maintaining babel seem to actively market babel and then at the same time ignore questions and requests for better docs from the community.
3) Slowest compiler I have had the pleasure of dealing with - my babel watch process consumes a grand total of 150 MB of memory !!
Edit - had to follow HN guidelines
I agree that Babel is slow. Hey, there's always Buble: http://buble.surge.sh/, but then you lose a lot of configurability. There's always a trade-off.
And yes, the generator stuff is far more verbose than it needs to be, but because Babel is trying to cover all browsers by default. It's like jQuery. Good news is you can opt out.
That is not my main concern. Babel can wrap the code in 10 functions for all I care ( performance is also not a concern since we are not sending rockets to mars - just another technology sweatshops trying to sell viagra )
The wrapped function throws errors - since apparently you need to download some babel plugins for it to work. (ノಠ益ಠ)ノ彡
Babel code is actually faster than the native implementation of most of the ES2015/6 features atm.
>The wrapped function throws errors - since apparently you need to download some babel plugins for it to work. (ノಠ益ಠ)ノ彡
So you forgot to download some plugins and it's Babel's fault?
And, sorry, where does the entitlement come from? It's you who needs and uses Babel, even imperfect and buggy as it is, to get the job done, not the inverse.
Its the entire web community writing code in a barely function compiler.
- babel by itself doesn't actually do anything. It depends on the preset you chose. There are now a bunch of presets that leave parts of ES6 alone (i. e. to use ES6 import with webpack).
- I have actually never looked at the docs :). Never had a problem with it (unlike the package manager from config file hell, i.e. webpack).
Please resist commenting about being downvoted.
It never does any good, and it makes boring reading.
Please don't bait other users by inviting them to downvote
you or announce that you expect to get downvoted.In fairness though, you can configure babel to use native generators if you intend to only support platforms which implement them. However, generators have also not been well supported for very long: http://kangax.github.io/compat-table/es6/#test-generators
When I look at the compat tables, everything is getting green, looks like a bright future, without the need of Babel anymore.
But I find myself using post-ES2015 features all the time, because, why not? Babel gets me the latest fix.
(static) class properties, decorators, bind... Also JSX! Even if all browsers are completely on ES2015 in the next months, I can't throw Babel out :D
But luckily it seems like the next ES releases are all much smaller, so maybe the browser-manufacturers will have caught up in 2016...
Which unfortunately loses the ES7 features.