W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2013

Re: [whatwg] Script preloading

From: Jake Archibald <jaffathecake@gmail.com>
Date: Wed, 10 Jul 2013 10:32:39 +0100
Message-ID: <CAJ5xic8_6N9_xf6XVoNoYbtO+PfHtG5g1b7UEK1SL_h6=Ljptg@mail.gmail.com>
To: Garrett Smith <dhtmlkitchen@gmail.com>
Cc: WHATWG <whatwg@whatwg.org>, travis.leithead@microsoft.com, Ian Hickson <ian@hixie.ch>, Kyle Simpson <getify@gmail.com>
On 9 July 2013 22:31, Garrett Smith <dhtmlkitchen@gmail.com> wrote:

> On 7/9/13, Ian Hickson <ian@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.
Received on Wednesday, 10 July 2013 09:33:05 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:03 UTC