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
Feat(w3c/style): preload for css, scripts (see #663) #838
Conversation
7f95f6a
to
ebb3a00
Compare
var preconnectLink = document.createElement("link"); | ||
preconnectLink.rel = "preconnect"; | ||
preconnectLink.href = "https://www.w3.org"; | ||
preconnectLink.crossorigin = true; |
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.
Should be "crossOrigin"
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.
and = "anonymous";
e3b62d9
to
ede9076
Compare
513d117
to
4201fd5
Compare
4201fd5
to
53f3223
Compare
@@ -10,8 +10,6 @@ define( | |||
function(utils, pubsubhub) { | |||
function attachFixupScript(doc, version){ | |||
var script = doc.createElement("script"); | |||
script.async = true; | |||
script.defer = true; |
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.
So, my reading is that because this script is pre-loaded, we don't need to defer it. And as it's already at the end of the document (and added after processing), async won't matter.
Made a couple more performance improvements... main bottleneck seems to be handlebars tho... once we compile the templates, we should see maybe another ±10% gain. It's noticeably better now tho. Way less thrashing. |
I sort of forgot that there was handlebars under the covers. I wonder if On Sat, Jun 25, 2016 at 5:25 AM, Marcos Cáceres notifications@github.com
Shane McCarron |
It's likely, but given their complexity: odds are low.
I don't think so. Only should be in tmpl.js.
Only if you require() it.
|
@halindrome, would you mind reviewing? I was just looking for @yoavweiss feedback on approach and if he had any additional suggestions. |
@@ -84,7 +102,54 @@ define( | |||
}, +Infinity); | |||
return (leftPad === +Infinity) ? 0 : leftPad; | |||
}, | |||
|
|||
/** | |||
* Creates a link element to use as a resource hint. |
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.
Should say, "represents a resource hint" and maybe link to spec
Did a couple of rounds of self review over last few days. Additional comments welcome. |
This mostly helps github hosted editor's drafts.
@yoavweiss, wdyt?