lautis / uglifier

Ruby wrapper for UglifyJS JavaScript compressor.
http://www.rubydoc.info/gems/uglifier
MIT License
613 stars 82 forks source link

Is Harmony still considered experimental? #142

Open blovato opened 6 years ago

blovato commented 6 years ago

Hello,

We are using Uglifier in a large production application and are running into es6 issues (similar to https://github.com/lautis/uglifier/issues/127) that are solved by using harmony. We are hesitant to adopt experimental technology though and are curious why harmony is labeled as experimental and what is remaining or planned to do to take it out of that state. Any information would be very helpful!

Thanks!

lautis commented 6 years ago

Yes. In fact, the development of the Harmony version of UglifyJS has stopped. Harmony support might need to be removed at some point.

https://github.com/mishoo/UglifyJS2/issues/3010#issuecomment-374147334

lautis commented 6 years ago

It could be worth checking out if terser could be used instead of the unmaintained uglify-es for ES6 support.

blovato commented 6 years ago

Ah this is very good to know; thanks for the reply! Just fyi, we ended up transpiling with browserify and babelify before uglification to solve this issue without depending on the harmony flag :+1:

pravi commented 4 years ago

@lautis can we switch to terser as default ? terser is well maintained and can replace both uglify.js and uglify-harmony.js and many projects like webpack already switched to terser by default. https://github.com/webpack/webpack/pull/8036

pravi commented 4 years ago

With my limited programming knowledge (I'm a package maintainer/system administrator), I managed to switch uglify-harmony.js with terser.js. Here is the proof of concept patch https://salsa.debian.org/ruby-team/ruby-uglifier/-/blob/master/debian/patches/005-use-terser.patch

lautis commented 4 years ago

I'd be happy to replace UglifyJS with Terser. The number of differences is big enough that it'd make sense to release new version as a breaking change with regards to options.

There's also terser branch in this repository.

Masa331 commented 4 years ago

There is also a gem which already wraps Terser - https://github.com/ahorek/terser-ruby and is compatible with Sprockets