Has anyone compiled jQuery against Google's newly-released Closure compiler?
There has been reported huge savings in code size. I'm curious what the benefit is if jQuery was compiled with it.
John Resig reported a bug on recursive functions when he attempted to compile a nightly of jQuery 1.4, so there are a few kinks to be worked out. I wouldn't use a jQuery compiled with Closure Compiler without making sure it passes the jQuery testbed.
http://code.google.com/p/closure-compiler/issues/detail?id=1&can=1#c2
I tried with jQuery jQuery 1.3.2
jQuery-1.3.2.min.js 57254 Bytes
jQuery closure compiler 49730 Bytes
-----------------------------------
Reduced by 7524 Bytes
Saved 13.31% off the original size
Saved 10.87% off the gzipped size
Gain of ~7KB
But it also reports 15 Warnings and I didn't test if it still works
The closure compiler eliminates any code that you don't actually use. The typical web page will only use a small fraction of jQuery functions, so the most benefit will come from compiling your code together with the full version of jQuery.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With