[HTML Imports]: Sync, async, -ish?

'Sup yo!

There was a thought-provoking post by Steve Souders [1] this weekend that
involved HTML Imports (yay!) and document.write (boo!), which triggered a
Twitter conversation [2], which triggered some conversations with Arv and
Alex, which finally erupted in this email.

Today, HTML Imports loading behavior is very simply defined: they act like
stylesheets. They load asynchronously, but block <script> from executing.
Some peeps seem to frown on that and demand moar async.

I am going to claim that there are two distinct uses of <link rel=import>:

1) The import is the most important part of the document. Typically, this
is when the import is the underlying framework that powers the app, and the
app simply won't function without it. In this case, any more async will be
all burden and no benefit.

2) The import is the least important of the document. This is the "+1
button" case. The import is useful, but sure as hell doesn't need to take
rendering engine's attention from presenting this document to the user. In
this case, async is sorely needed.

We should address both of these cases, and we don't right now -- which is a
problem.

Shoot-from-the-hip Strawman:

* The default behavior stays currently specified
* The "async" attribute on <link> makes import load asynchronously
* Also, consider not blocking rendering when blocking <script>

This strawman is intentionally full of ... straw. Please provide a better
strawman below:
__________________
__________________
__________________

:DG<

[1]:
http://www.stevesouders.com/blog/2013/11/16/async-ads-with-html-imports/
[2]: https://twitter.com/codepo8/status/401752453944590336

Received on Monday, 18 November 2013 21:41:06 UTC