Ticket #2925 (closed feature: fixed)

Opened 3 years ago

Last modified 2 years ago

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.

Attachments

closurecompile.py Download (0.7 KB) - added by fbuchinger 3 years ago.
a modified version of pwd's script (uses urllib2 instead of httplib)

Change History

Changed 3 years ago by fbuchinger

a modified version of pwd's script (uses urllib2 instead of httplib)

Changed 2 years ago by crschmidt

  • status changed from new to closed
  • resolution set to fixed

fbuchinger: If you can replicate the misbehavior you had with the Java jar, I'd be interested. I've implemented support for both the webservice and the jar, and I've just grabbed your changes to the webservice support to use urllib2. For smaller builds, using closure_ws is fine, and for larger builds, you should probably just grab the local jar rather than slamming google's service with requests.

If you can reproduce the syntax error, please open a new ticket in the 2.11 milestone and assign to me.

Note: See TracTickets for help on using tickets.