Ticket #2925 (closed feature: fixed)
Some remarks about #2900: Add Google's closure compiler to build tools
| Reported by: | fbuchinger | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.11 Release |
| Component: | general | Version: | 2.10 |
| Keywords: | Cc: | ||
| State: |
Description
Here are some remarks I have about #2900 - sorry for the duplication but depite being logged in I was unable to comment on it.
First of all, I think integrating Google's closure compiler in the OpenLayers build script is a good idea. I ran the closure compiler with simple optimization on a custom OpenLayers build (already jsmin'ed) and benefited from a ~25% reduction in filesize (jsmin: 434 kb, google: 348 kb).
However, I stumpled upon the following caveats:
+ jsmin as a preprocessing step seems necessary. The closure compiler online service has a 1000kb limit on uploaded javascript code/total size of included javascript files. Uploading an unminified OpenLayers build would exceed this limit.
+ regarding pwd's attached python script: I would implement the web service communication using urllib2.urlopen() instead of httplib. urllib2 automatically figures out whether you have a proxy configured, while using a proxy with httplib seems to be more cumbersome.
+ I also tried to run the compilation locally with google_compiler.jar invoked from a python script, but this approach was more fragile. The compiler read the unminified OL build, but rejected it due to javascript errors. When I ran the same command directly on the windows shell, everything worked ok.

