caridy (2014-07-10T18:22:31.000Z)
domenic at domenicdenicola.com (2014-07-16T20:51:33.804Z)
John is right, all the use cases you've mentioned can be solved with the current design. Here is an example of a loader extension that implements conditional loading: https://gist.github.com/caridy/1a67aaf433ae03a42a8b This particular implementation relies on the `trigger` configuration attached to the the loader instance, in this case `System`. In the example below, if `XMLHttpRequest` is detected, `bar` module will be used whenever someone try to import `foo` using the imperative or declarative form, assuming `foo` and `bar` have the same named exports, making the replacement completely transparent for the consumer module: ```js System.trigger['foo'] = { test: function () { return !!window.XMLHttpRequest; }, replaceWith: 'bar' }; ``` As for DOM ready, etc, you can apply the same principle, and since all loader hooks are promise based, you could hold a promise until reaching the DOM ready state, and that should be all.