support UglifyJS minification #2115

Closed
fbender opened this Issue Oct 31, 2011 · 15 comments

Comments

Projects
None yet
9 participants

fbender commented Oct 31, 2011

Title says it all … should produce smaller files than YUI (and is faster).

@ghost ghost assigned w00fz Oct 31, 2011

Owner

arian commented Oct 31, 2011

We probably need to have Node.js and UglifyJS installed..

It should be possible (right @w00fz and @fakedarren), question is if there is a major benefit. I believe UglifyJS doesn't compress a lot more than YUI compressor. It might also be confusing to have two almost identical compressors.

We could also just replace YUI compressor by UglifyJS.

dmcass commented Oct 31, 2011

The blog article below may be helpful (posted almost a year ago, though).

A Comparison of JavaScript Compressors

fbender commented Oct 31, 2011

BTW, Mozilla switched from YUI to UglifyJS as well: http://blog.mozilla.com/webdev/2011/10/25/go-speed-racer/

Owner

arian commented Oct 31, 2011

Indeed, In MooTools 2.0/Milk we'll use Closure or Uglify anyway because we'll need dead-code-branch removal.

Yea, don't have 2 different compressed versions. Just have the best (which in my experience is uglify).

Have you tried closure seanmonstar ? And could it maybe be possible to make mootools compatible with advanced optimization in the closure compiler, that would be so awesome ! ?

Olical commented Nov 24, 2011

Just thought I would do a little comparison. Here are the two minified files. and here are the statistics.

  • YUI Compressor 86834 bytes
  • UglifyJS 82024 bytes

So UglifyJS removes 4810 bytes more than YUI Compressor. Not too huge in the great scheme of things but at least it is an improvement.

This is with the comment headers removed and without compatibility.

And her is googles closure compiler..

Original Size: 135.31KB (36.65KB gzipped)
Compiled Size: 79.13KB (25.45KB gzipped)

Even better..

it can be used online here
http://closure-compiler.appspot.com/

and can be downloaded here..
http://code.google.com/closure/compiler/

Olical commented Nov 30, 2011

Heres the comparison again in order including closure. All measured in bytes.

It's close but Closure does win. I guess you then have to weigh up running a jar file or running a node module. And does compile time come into it, because UglifyJS should always be a lot faster.

  • Closure 81027 bytes
  • UglifyJS 82024 bytes
  • YUI Compressor 86834 bytes

That's the reason I've gone with uglifyjs: since I minify with every
commit, I want it to be fast as well.

But closure also has a linter, maybe that's why its slow ? Either way..
This isn't too important to me, since I don't commit compiled js which I
would consider bad practice.. It should only compile at deploy.
On Nov 30, 2011 5:18 PM, "Sean McArthur" <
reply@reply.github.com>
wrote:

That's the reason I've gone with uglifyjs: since I minify with every
commit, I want it to be fast as well.


Reply to this email directly or view it on GitHub:
#2115 (comment)

I don't commit compiled js. Each commit triggers an automatic deploy. :-)

But.. This whoule thread was about including a new compiler in the builder, and as you can use the closure-compiler via an api it is perfectly plugable in the builder..

Owner

ibolmo commented Dec 3, 2011

I've experienced this myself and the issue here is that the website is not ready to support this kind of change. I leave it to @w00fz to decide if we should wait for 2.0 or have this out for 1.5 or 1.6.

@ibolmo ibolmo modified the milestones: 1.5.1, 1.6 Mar 3, 2014

@ibolmo ibolmo unassigned w00fz Mar 3, 2014

Member

SergioCrisostomo commented Jun 13, 2014

I supose #2604 fixes this issue, when/if it gets merged.

@ibolmo ibolmo closed this in #2604 Jun 13, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment