On Fri, Mar 12, 2010 at 8:48 PM, Yves Moisan <[email protected]> wrote:
> Le 20
>>>
>>> Thank you Eric for this thorough explanation.  To put things into
>>> perspective, if I wanted to have the leanest possible OL lib with the
>>> MapFish build I could exclude selected MapFish components from the build
>>> and
>>> that would cascade down to OL ?
>>>
>>
>> Yes, this will produce the leanest MF+GX+OL build.
>>
>
> Hi Eric,
>
> I did a small test that I'd like to tell you about.  I created "dummy.js" at
> the root of OL.  I added "rummy.js" one level down the directory tree.  If I
> run the build script, both files get included, as expected.  dummy.js gets
> included first and rummy.js gets included after in the compressed file.  At
> first I thought dummy.js was included first because it was at the root of
> OpenLayers and rummy.js was one tree level down, but it looks like it's just
> because files are ordered alphabetically.  If I put a file called dummy-3.js
> at the same location as rummy.js, it will get included *before* dummy.js.
>  I'm not sure why, but I'll take it.
>
> Now if I add a dependency in dummy.js like so :
>
> /**
>  * @requires OpenLayers/rummy.js
>  */
>
> I should expect its contents to be included in the compressed file before
> dummy.js.  Checked.
>
> Now the question I had was : if I put dummy.js in the exclude part of
> jsbuild's .cfg file, should I expect *both* dummy.js and it's required
> contents (rummy.js) to be excluded from the build ?  I thought that's what I
> would get, but the answer is no.  Only dummy.js' content is excluded.

I guess the include section is ignored if you have an exclude section.
Having an exclude section means include all the files except those
listed in the exclude section.

And it makes sense that excluding dummy.js does not exclude rummy.js,
as rummy.js can be required by other files.

>
> The rationale for me is that @requires is an "include" dependency, but not
> an "exclude" dependency.  That is, i can't rely on dummy.js being excluded
> from the compressed file given that dummy.js shows in the list of excludes.
>  It's understandable because there may be other files besides dummy.js that
> @include or @requires rummy.js.  So my question is : how can MapFish cascade
> "exclude dependencies" and produce a lean compressed js file ?

It cannot, you should just include that you need.

>
> Also, I noted that putting dummy.js in the list of `first` includes in the
> jsbuild cfg file does indeed put dummy.js right up the top of the compressed
> js file, but rummy.js's content is *not* included before, which it should.
>  So one cannot really prepend a js file that has @requires dependencies.
>  Are we left with manually specifying include/exclude dependencies ?

I've also observed issues with the "first" section, where, IIRC,
@requires and @include directives within files listed the "first"
section aren't taken into account. Probably a bug in jsbuild.

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : [email protected]
http://www.camptocamp.com
_______________________________________________
Dev mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/dev

Reply via email to