[dojo-contributors] Tentative agenda for today meeting

Ben Hockey neonstalwart at gmail.com
Wed Oct 3 12:26:50 EDT 2012


On Oct 3, 2012, at 11:01 AM, Richard Backhouse wrote:

> Hypothetically if a developer referenced deviceTheme as an AMD module and then wanted to produce a build that would load it and all its dependencies would it work ?

it depends on what you mean by "work".  

deviceTheme would not do what it is supposed to do when loaded in that case so it would not work.  this really needs to be understood because this is why we are all reluctant to do anything to further accommodate loading this file via any AMD loader.  it does not work!

however if you'd like to know if the dojo builder properly handles the call to define and finds the dependencies for that file, i presume the answer is yes - i have to say "presume" because i have not tried it myself but i say it with a great deal of confidence.   for modules tagged as AMD, the builder evaluates the text of the module by passing it a simulated version of define and require which will aggregate the dependencies (see https://github.com/dojo/util/blob/master/build/transforms/depsScan.js#L206).  it does this "eval" based on the assumption that evaluating the contents of an AMD module does not result in executing any code other than the call to define.  as long as the simulated define does not execute the factory of the module then there's no issue in evaluating the text of the module in order to receive the call to define (in whatever form it takes) and collect the dependencies declared by that module.

ben...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-contributors/attachments/20121003/becf916b/attachment.htm 


More information about the dojo-contributors mailing list