googlearchive / IMD

An AMD-compatible module registry for use with HTML Imports
73 stars 24 forks source link

Out of order dependencies should work #17

Open llamadonica opened 7 years ago

llamadonica commented 7 years ago

webcomponentjs's HTMLImport polyfills don't guarantee what order js files are evaluated. So relying on module definitions already being there might not be safe. The AMD spec also hints at this:

Multiple define calls can be made within a single script. The order of the define calls SHOULD NOT be significant. Earlier module definitions may specify dependencies that are defined later in the same script. It is the responsibility of the module loader to defer loading unresolved dependencies until the entire script is loaded to prevent unnecessary requests.

So ... we're not loading, but it may make sense that defines should be generally allowed to be out of order.