Posted by askibinski on November 14, 2009 at 2:36pm
Jump to:
| Project: | Javascript Aggregator |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Just wanted to point out there is a new module around called closure compiler (I'm not the maintainer):
http://drupal.org/project/closure_compiler
which uses the new compiler code released by Google to optimize and compile your javascripts.
Looks to me like javascript_aggregator would be the perfect place to offer this as a checkbox option?
Comments
#1
Subscribing
#2
Looks like a cool feature. Has anyone tried implementing this. Please paste code or post a patch.
#3
Some informations found on Web.
I didn't managed to make it work yet.
* Using cUrl to upload our JS on Google Closure site and retrieve back compressed version:
http://www.bloggingdeveloper.com/post/Using-Google-Closure-Compiler-with...
http://bohuco.net/blog/2009/11/google-closure-compiler-with-php/
* PHP library ready to use:
http://code.google.com/p/php-closure/
* Drupal module (see original post by askibinski)
http://drupal.org/project/closure_compiler
Maybe we could work with it our integrate some part of code.
In our case I think we need ADVANCED_OPTIMIZATIONS compression level.
#4
In the module page it states that ADVANCED_OPTIMIZATIONS usually break scrip functionality. I'll try to use both modules together, see what happens.
#5
What happens is that closure_compiler runs over the minified JS. This causes it to make both un-minified and minified versions exactly the same. If you manually delete the minified version after it to force recreation, then minifier will really run over the compiled JS and get some benefit. However, the benefit is not substancial: in my use case it reduced a 721kb script to 719kb. Also, closure_compiler had reduced this from an original >900kb, and got better file size thant the initial minified version (which had ~850kb).
I haven't tested with JSMin+