[Dojo-interest] Proper way of doing dynamic requires post AMD switchover
kitson.kelly at asseverate.co.uk
Fri May 11 13:40:39 EDT 2012
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.
On 11 May 2012 17:48, Karl Tiedt <ktiedt at gmail.com> wrote:
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Dojo-interest