[OpenLayers-Dev] Dynamic Build Technique -- from script.aculo.us

Paul Spencer pspencer at dmsolutions.ca
Sun Oct 29 14:46:46 EST 2006


Cameron, my comment was directed at the development cycle, not  
production environments.

I would hope that you would keep the dynamic loading to support more  
rapid development.  It would really suck if you were trying to fix  
something and had to keep building a single JS to test each change.

OpenLayers already has a mechanism for producing a single js file.   
What is missing for developers is the ability to load some subset of  
the individual files for a particular application - essentially the  
ones that you would be compiling for a production environment.

It is not always the best case to develop with all files loaded if  
that isn't your target environment because you may be inadvertently  
relying on some file you weren't planning to include in your build.

The mechanism described would be ideal, IMO.

Cheers

Paul

On 28-Oct-06, at 8:54 PM, Cameron Shorter wrote:

> We dynamic loading in Mapbuilder.
> However, we have plans to drop this functionality.
>
> The downsides of dynamic loading are:
> * The user needs to download multiple JS files instead of one. This  
> is slower.
> * It is harder to compress JS if it is spread across multiple files.
> The best compression is achieved when you reduce the size of  
> variable names from "counter" to "x1" or similar. This only works  
> if the compression program is assessing all the JS source at once.  
> Ie, you can't run:
> compress file1
> compress file2
> compress file3
>
> You need to run
> compress file1 file2 file3
>
>
>
> Paul Spencer wrote:
>> This is actually pretty cool ... for me, this would replace  
>> compiling  a sub-set of OpenLayers when developing and testing for  
>> something  like WebMap.js.
>> Cheers
>> Paul
>> On 26-Oct-06, at 7:17 AM, Erik Uzureau wrote:
>>> I was looking through the script.aculo.us wiki this morning and   
>>> came accross
>>> this bit on how they allow optional loading of different   
>>> components. Seems like
>>> something we might want to look into for OpenLayers.
>>>
>>> Thoughts?
>>> -erik
>>>
>>> -------------------------------------------------------------------- 
>>> -- --------------
>>> from: http://wiki.script.aculo.us/scriptaculous/show/Usage
>>>
>>> 3. Link to script.aculo.us
>>>
>>> Link to the scripts in the head of your document:
>>>
>>>
>>> <script src="javascripts/prototype.js" type="text/javascript"></  
>>> script>
>>> <script src="javascripts/scriptaculous.js" type="text/ 
>>> javascript"></ script>
>>>
>>> By default, scriptaculous.js loads all of the other javascript files
>>> necessary for effects, drag-and-drop, sliders, and all of the other
>>> script.aculo.us features. If you don't need all of the features, you
>>> can limit the additional scripts that get loaded by specifying  
>>> them in
>>> a comma-separated list, e.g.:
>>>
>>>
>>> <script src="scriptaculous.js?load=effects,dragdrop" type=...></  
>>> script>
>>>
>>> The scripts that can be specified are:
>>>
>>>    * builder
>>>    * effects
>>>    * dragdrop
>>>    * controls
>>>    * slider
>>>
>>> Note that some of the scripts require that others be loaded in order
>>> to function properly.
>>> _______________________________________________
>>> Dev mailing list
>>> Dev at openlayers.org
>>> http://openlayers.org/mailman/listinfo/dev
>> +-----------------------------------------------------------------+
>> |Paul Spencer                          pspencer at dmsolutions.ca    |
>> +-----------------------------------------------------------------+
>> |Chief Technology Officer                                         |
>> |DM Solutions Group Inc                http://www.dmsolutions.ca/ |
>> +-----------------------------------------------------------------+
>> _______________________________________________
>> Dev mailing list
>> Dev at openlayers.org
>> http://openlayers.org/mailman/listinfo/dev
>
>
> -- 
> Cameron Shorter
> http://cameron.shorter.net

+-----------------------------------------------------------------+
|Paul Spencer                          pspencer at dmsolutions.ca    |
+-----------------------------------------------------------------+
|Chief Technology Officer                                         |
|DM Solutions Group Inc                http://www.dmsolutions.ca/ |
+-----------------------------------------------------------------+







More information about the Dev mailing list