Opened 10 years ago

Closed 10 years ago

#15792 closed defect (fixed)

loader executes modules before giving circular dependencies a chance to resolve in legacy async mode

Reported by: Rawld Gill Owned by: Rawld Gill
Priority: blocker Milestone: 1.8
Component: Loader Version: 1.7.3
Keywords: Cc:
Blocked By: Blocking:


In sync mode, there is nothing that can be done about circular dependencies other than reorganize the code since the load order is implied by the code. However, in all the other modes (async and the two legacy async modes), the load algorithm should try to avoid circular dependencies if possible.

An example is a module that depends on a dojo/has! condition in the deps vector. When encountered, that dojo/has will require the appropriate module, and require will try to immediately execute that module...and this can cause a circular dependency.

This case is handled correctly for async mode, but not for the two legacy async modes.

Change History (3)

comment:1 Changed 10 years ago by Rawld Gill

Milestone: tbd1.8
Priority: undecidedblocker
Status: newassigned

comment:2 Changed 10 years ago by Rawld Gill

In [29419]:

try to avoid premature execution of modules with circular dependencies that can be avoided by loader algorithm; refs #15792; !strict

comment:3 Changed 10 years ago by Rawld Gill

Resolution: fixed
Status: assignedclosed

In [29423]:

reviewed [29419] and saved a few bytes for built verions; fixes #15792; !strict

Note: See TracTickets for help on using tickets.