[dojo-contributors] self executing scripts

Tom Trenka ttrenka at gmail.com
Sun May 31 11:20:15 EDT 2009


I would have big problems with a feature like "autoRequire"; we went down
that magical road before and it caused nothing but headaches.
On the other hand, using the script tag as a way of setting up a Dojo-based
app is an elegant feature; the only real issue I have with it is that it's
not a standard thing, so it will require some explanation to anyone not
coming from an intermediate-to-advanced Ajax background.  Things like that
always make me a little leery, regardless of the elegance.

But I like it.

One thing: Pete, how come you didn't just use the new Function constructor?

regards,
trt

On Sun, May 31, 2009 at 10:11 AM, Mike Wilcox <mwilcox at sitepen.com> wrote:

> I think it's great. I had tried formatting my code this way early on,
> and saw that it didn't work. I like that you have a "dojo block" of
> code.
>
> It spawns a few other ideas:
>
> Useful if you only had one or two "main" require scripts:
> <script src="dojo.js" djConfig="parseOnLoad=true"
>        require="my.application" />
>
> May be slower to load (requiring two passes with the parser maybe) but
> I bet newbies would like it:
> <script src="dojo.js" djConfig="parseOnLoad=true"
>        autoRequire="true" />
>
> Mike Wilcox
> mwilcox at sitepen.com
> http://www.sitepen.com
> work: 650.968.8787 x218
> cell:     214.697.4872
>
> On May 31, 2009, at 10:00 AM, Peter E Higgins wrote:
>
> >
> > Hi List,
> >
> > I don't normally cross post / blog, but I am quite curious to hear if
> > anyone thinks this is a good idea for Dojo:
> >
> > http://higginsforpresident.net/2009/05/degrading-script-tags/
> >
> > The jist is: a syntax like this would work:
> >
> > <script src="dojo/dojo.js" djConig="parseOnLoad:true">
> >    dojo.require("dijit.TitlePane");
> >    dojo.require("dijit.layout.BorderContainer");
> >    // or just:
> >    dojo.require("my.application");
> > </script>
> >
> > It is "kind of magic", but I like it [though am unsure if anyone else
> > would find it handy]. If dojo.js is a 404, nothing at all will happen,
> > failing silently but easily identifiable in firebug. The progressive
> > JS case comes to mind.
> >
> > It requires a 3-line patch to base, which at the moment includes an
> > #ifdef to remove the functionality by way of a build kwArg
> > 'noSelf=true'
> >
> > Regards,
> > Peter
> >
> > --
> > Peter E Higgins
> > Dojo Project Lead : http://dojotoolkit.org
> >
> > _______________________________________________
> > dojo-contributors mailing list
> > dojo-contributors at mail.dojotoolkit.org
> > http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors
> >
>
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at mail.dojotoolkit.org
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-contributors/attachments/20090531/dc9da5cc/attachment-0001.htm 


More information about the dojo-contributors mailing list