On 9 July 2013 22:31, Garrett Smith <dhtmlkitc...@gmail.com> wrote: > On 7/9/13, Ian Hickson <i...@hixie.ch> wrote:<script id="jquery" > src="jquery.js" async></script> > > <script id="shims" src="shims.js" async></script> > > <script dependencies="shims jquery" src="myscript.js" > async></script> > > > > Why limit "depends" to be used by only scripts to refer only to other > scripts? > > If you put <link depends=idref> on style then stylesheet evaluation > could be deferred, too. >
I like this idea and want to start a family with it. > This would then cause the scripts to execute, first jquery.js and > > shims.js (in any order), and then myscript.js. If any hadn't finished > > downloading yet, it would first wait for that to finish. > > > > (We could make markNeeded() return a promise, too.) > > > Or use a callback. Blocking on resource loading is bad. > Promises don't block. New APIs that want callbacks for async success/failure should use Promises.