Opened 11 years ago

Closed 10 years ago

#7556 closed enhancement (duplicate)

dojo.require - allow array for moduleName

Reported by: Les Owned by: James Burke
Priority: high Milestone: 2.0
Component: Core Version: 1.1.1
Keywords: Cc:
Blocked By: Blocking:

Description

I frequently need to call dojo.require sequentially. Would it be possible to alternately pass an array of modules as the first argument to dojo.require?

Change History (5)

comment:1 Changed 11 years ago by dante

Owner: changed from anonymous to James Burke

something like:

dojo.forEach(["dijit.form.Button","dijit.Dialog"], dojo.require);

seems too easy to do out of the box already?

comment:2 in reply to:  1 Changed 11 years ago by Les

Replying to dante:

something like:

dojo.forEach(["dijit.form.Button","dijit.Dialog"], dojo.require);

seems too easy to do out of the box already?

Yes, this will work for me. Thx.

comment:3 Changed 11 years ago by James Burke

Milestone: tbd2.0

Note that using dojo.forEach will make it hard for the build system to find your dependencies if you want to do custom builds: the build system uses simple regexps to find dojo.require dependencies.

I can see where this could be useful, but I think more appropriate to consider for Dojo 2.0 when we can consider changing APIs.

comment:5 Changed 10 years ago by James Burke

Resolution: duplicate
Status: newclosed

Les, thanks for the reminder that this ticket predates the other one. I am going to use the other ticket though to track the change.

Note: See TracTickets for help on using tickets.