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.
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.
Doesn't Closure just minimize and renames vars? jQuery already has a .min version. Minifying with closure again will probably be minimally helpful and potentially dangerous.
Edit: I just did it.
This is on top of the already mined version. There's a demo here: http://closure-compiler.appspot.com/home
I tried with their online compiler, it works well.
Out of curiosity, I put together a SlickSpeed test of the latest Prototype and jQuery libs, shrunk with YUI and Closure. You can run the tests here.
As others have noted, compiling with ADVANCED_OPT does not work but if someone wants to do the work, I'll be happy to add the results to the SlickSpeed test.
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.