[Dojo-interest] Proper way of doing dynamic requires post AMD switchover

Kitson Kelly kitson.kelly at asseverate.co.uk
Fri May 11 13:40:39 EDT 2012


Karl:

Ok, of course you could do what we do the in parser now (trunk) and create
your own deferred wrapper for require and while it doesn't eliminate the
callback, you can at least deal with it in a deferred/promise fashion.

Regards,
Kit

On 11 May 2012 17:48, Karl Tiedt <ktiedt at gmail.com> wrote:

> Kitson,
>    No, I am really trying to avoid nesting another callback method
> here since it seemed like it should be possible.... the problem
> ultimately is that:
>
> var module = require("mid") will not return something not listed in
> define(["mid1", "mid2"])'s array... ultimately that is the problem...
>
> If a nested require with an array is the only way to make this work
> then I suppose we have to make that work, but... prior to making
> changes, testing via a debug command line... this method worked just
> fine outside of define() callbacks for any module we tested.
>
> In a deployment environment the problem is moot because the build will
> have these files... but for dev... they are require'd on the fly
> because the options change based on user privs and what not.
>
> -Karl Tiedt
> ________________________________________________________
> 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/20120511/1191843f/attachment.htm 


More information about the Dojo-interest mailing list