-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
importHref loads imports, async. Fixes #3113 #3114
Conversation
Should we use this or make the default |
👍 |
* @return {HTMLLinkElement} The link element for the URL to be loaded. | ||
*/ | ||
importHref: function(href, onload, onerror) { | ||
importHref: function(href, onload, onerror, optAsync) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say we make this default to false
for back-compat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
LGTM with nit |
PTAL |
var l = document.createElement('link'); | ||
l.rel = 'import'; | ||
l.href = href; | ||
|
||
optAsync = typeof optAsync !== 'undefined' ? optAsync : false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can just be optAsync = Boolean(optAsync)
since the default is false
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Last nit, then I can merge :) |
PTAL |
importHref loads imports, async. Fixes #3113
This changes the default behavior of
importHref
to load imports async, taking them out of the rendering path. Witnessing this is a a couple of apps we're working on, not doing so causes layout flashes as the import is added to the DOM and loads.Adds an optional
async
arg toimportHref
. Defaults to true for perf and similar to xhr.R: @kevinpschaaf @sorvell @azakus