[dojo-contributors] Re: buildin dojo.gfx?

Jesse Kuhnert jkuhnert at gmail.com
Sat Oct 7 21:48:55 EDT 2006


A sort of bastardized way of doing it might be something along the lines of:

-) Make it such that vml or svg is dojo.require() - able so that both can be
baked into a build via profile.js includes.

-) Add your conditional logic for vml/svg capable renderers around the
individual svg/vml files as one big block. Ie:

if(dojo.render.vml.capable){
// everything in the vml file
}

Not ideal certainly, but may work "for now" .

On 10/7/06, Eugene Lazutkin <eugene at lazutkin.com> wrote:
>
> Actually this is a well-known problem (for me anyway). This is how
> dojo.gfx' __package__.js looks like:
>
> ====================================
> dojo.kwCompoundRequire({
>         common: [
>                 "dojo.gfx.color",
>                 "dojo.gfx.matrix",
>                 "dojo.gfx.common"
>         ]
> });
>
> // include a renderer conditionally
> dojo["requireIf"](dojo.render.svg.capable, "dojo.gfx.svg");
> dojo["requireIf"](!dojo.render.svg.capable && dojo.render.vml.capable,
> "dojo.gfx.vml");
>
> dojo.provide("dojo.gfx.*");
> ====================================
>
> I arrived at it because my previous attempts at conditional inclusion
> were unsuccessful. I was (naively) hoping that a build system can
> include both files unconditionally, but execute only one of them
> depending on actual configuration. If there is a way to do it, please
> tell me how to do it. Actually this is the question for anybody with
> this sacred knowledge.
>
> Theoretically I can create SVG/VML branches in separate objects (like it
> was done in the early versions of dojo.gfx), and merge them to dojo.gfx
> conditionally later on, but it introduces some problems --- like include
> both of them for a build, but don't include them for a regular unbaked
> dojo. If anybody see a good solution for this problem, please chime in.
>
> Thanks,
>
> Eugene
>
> LiuCougar wrote:
> > HI,
> > I tried to build a custom dojo incorporating some custom widgets using
> > dojo.gfx. The build itself is successful, however, if I use it, I got
> > this error (in FF):
> > FATAL exception raised: Could not load 'dojo.gfx.svg'; last tried
> > '__package__.js'
> >
> > and this error causes all the remaining code which dependent on
> > dojo.gfx to be loaded via XHR  (although they are already baked into
> > the build)
> >
> > the code still works, because later the dojo.gfx.svg can be
> > successfully XHR-ed (but also the other js files whick make use of
> > dojo.gfx are also XHR-ed which invalid the purpose of a build)
> >
> > anyone have a clue how to have dojo.gfx play nice in a build?
> >
> > (In IE, everything works fine)
> >
> > Regards,
> > Cougar
> >
>
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-contributors
>



-- 
Jesse Kuhnert
Tapestry/Dojo/(and a dash of TestNG), team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-contributors/attachments/20061007/8dcca3c6/attachment.htm 


More information about the dojo-contributors mailing list