Re: [Imports] Considering imperative HTML imports?

On Thu, Apr 16, 2015 at 1:37 PM, Travis Leithead <
travis.leithead@microsoft.com> wrote:

>  Was an imperative form of HTML imports already considered? E.g., the
> following springs to mind:
>
>   Promise<Document> importDocument(DOMString url);
>
>
>
> I was thinking about Worker’s importScripts(DOMString… urls), and the
> above seems like a nice related corollary.
>

One big difference, I'm assuming, is whether it's asynchronous. Returning a
Promise kind of implies that importDocument may be/is asynchronous.

The trend seems to be away from adding synchronous APIs, but then you can't
express <link rel="import" src="..."> (ie no 'async') using this API. I
think the declarative, script-blocking element is more palatable than a
synchronous method because the UA can process it when there's no user
script running.

Dominic

Received on Thursday, 16 April 2015 05:10:07 UTC