Closed DavidBruant closed 7 years ago
Hm. All script should be loaded async, but is there a reason to specifically address that in this finding?
All script should be loaded async
How so? Or rather, I agree if you mean "async" in general, disagree if you mean with the async
attribute. With the defer
attribute, the loading is asynchronous, parsing too (even in a different thread in IE), but execution waits until the DOM is complete (but before firing DOMContentLoaded
).
@async
doesn't guarantee script order (unlike @defer
) and I really hope the polyfills load before my website code.
Agree with all of that, but I think it's out of scope for the finding. Will double check with the group at the F2F next week.
Picked up on TAG call. Alex: Should advocate following web perf best practices, no need to itemise them, that'll rot very quickly.
Action on me to find appropriate resource for web perf best practice and reference it.
Picked up at TAG F2F. We don't have a good suggestion for a long-lived, community editable resource on web perf best practices. @DavidBruant do you have any recommendations? If not, I think we can just say 'follow web perf best practices' without linking to a reference.
Going to close this since TAG is approving the finding in its current form, but if you have a reference suggestion I can amend later.
Authors should ship polyfills in a way that it can be loaded with the
defer
attribute.