[Dojo-interest] Multiple versions of dojo on one page, script injection and 'packages' renaming in data-dojo-config

Matias Rask matias.rask at gmail.com
Mon May 21 05:10:15 EDT 2012


It is possible to disable the global declaration of dojo, dijit and dojox
by adding "noGlobals: true" to the require config.

require({
    noGlobals: true,
    ...
});

On Mon, May 21, 2012 at 9:12 AM, Nick Fenwick <neek at nickfenwick.com> wrote:

> I got no responses to my post, so I'll sum up what I think I've learned.
>
> - 1.7.x cannot be loaded after another version of dojo has loaded in a
> way that causes it _not_ to export its own global dojo, dijit or dojox
> symbols.
>
> - These symbols will therefore overwrite any existing symbols previously
> defined by another version of dojo.
>
> - The page that originally loaded the other version of dojo will then
> make calls into the newly loaded 1.7.x dojo and possibly fail in
> mysterious ways.
>
> - The 'packages' loader configuration directive, and perhaps 'alias' (I
> haven't really got my head around the difference, not being sure what
> 'package' and 'alias' mean in a strict sense) can be used when loading
> dojo to change the way module names, like dijit/form/TextBox, are
> resolved.  This doesn't in any way affect the global symbols like
> dijit.form.TextBox.  So if you rename dijit to foo in your loader
> configuration, you'll be able to require(['foo/form/TextBox']) but it
> will still export a global symbol in dijit.form called TextBox.
>
> - We will have to wait until 2.0 for a version of dojo that doesn't
> export any global symbols and thus can be used as a fully encapsulated
> set of definitions, except the global AMD style functions like require().
>
> Nick
> ________________________________________________________
> Dojotoolkit: http://dojotoolkit.org
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
> Tutorials: http://dojotoolkit.org/documentation
>
> Dojo-interest at mail.dojotoolkit.org
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-interest/attachments/20120521/e8d73916/attachment.htm 


More information about the Dojo-interest mailing list