[OpenLayers-Trac] [OpenLayers] #2925: Some remarks about #2900: Add Google's closure compiler to build tools

OpenLayers trac-20090302 at openlayers.org
Thu Nov 11 08:48:33 EST 2010


#2925: Some remarks about #2900: Add Google's closure compiler to build tools
------------------------+---------------------------------------------------
 Reporter:  fbuchinger  |       Owner:              
     Type:  feature     |      Status:  new         
 Priority:  minor       |   Milestone:  2.11 Release
Component:  general     |     Version:  2.10        
 Keywords:              |       State:              
------------------------+---------------------------------------------------
 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
 [http://trac.osgeo.org/openlayers/attachment/ticket/2900/closurecompile.py
 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.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/2925>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list