0.1.11 will not work with babel anymore
BowlingX opened this issue · 5 comments
Hi :)
thank you first for the library.
0.1.11 introduces a breaking change (but is a patch release) and removes all babel compiler hints / .babelrc file. It's not usable in a out of the box babel/webpack configuration anymore.
Is there any migration path?
david
Hi David,
I have to admit that the versioning of this release is not very informative in regards to semver. Sorry for that.
I removed babel because it was a constant source of bugs and inconveniences across environments. Should I include the regenerator runtime in order to provide out of the box compatibility? If yes, what happens in an environment where generators are already supported (see #8 and #1 )? default export
vs module.exports
was another thing (see #6). And so on and so forth.
So in the end I decided to make this a node module in the actual sense of the word and treat transpilation as out of scope.
As far as migration paths go you'll have to treat this package like any other node-only package that you want to transpile for e.g. use in browser.
babel-register and Webpack loader configs should help.
And some more info in the README would certainly help.
@BowlingX I ran into an issue with this library not working properly with Babel, as well. My problem was that I was trying to use UglifyJS with webpack to compress my build, and UglifyJS only works with ES5. I discovered that I could solve the problem neatly by upgrading to the standalone uglifyjs-webpack-plugin
, which uses a fork of UglifyJS that works with ES6. Once I did that, I had no further problems with this library at all.
Does that help you out?
I just had lunch with a co-worker of mine and he suggested to generally get rid of the es6 features as there are very few anyway, so that no special config/treatment is needed when transpiling. The most important change will probably be switching from generators to loops when iterating over nodes. The downside of that will be that instead of being somewhat O(n)-ish, iterating over nodes is going to be straight O(n).
I hope I can get this done by monday.
@BowlingX
Does v1.0.0 work as expected with your webpack config now?
@singingwolfboy yeah :) this was the issue. @lukasbuenger thank you a lot for publishing the new version, I think I will close the issue for now.