4 ms·
His argument is based on an example where he puts JS in <head>, when it's been a recommendation for ages to put JS at the very end of <body>.
by olegkikin 9y ago
His argument is based on an example where he puts JS in <head>, when it's been a recommendation for ages to put JS at the very end of <body>.
- aphexairlines 9y agoIt looks like he needs the JS to load first for the browser to make sense of his custom elements: "If our example document wasn’t reliant on JavaScript to construct the <my-app> custom element, the contents of the document would likely be interactive as soon as enough CSS and content was available to render meaningfully."
- slightlyoff 9y agoHowdy; author of the article here. TTI would be pushed back regardless of where the script was included so long as it executed for more than 50ms (very likely). I used a trivial document that contains many pathologies I see in traces to illustrate the point, not to suggest what ideal apps will do.
- youngtaff 9y agoJS at the end of the body is quite an out of date approach these days the recommendation is to use defer or async attributes. Challenge is will all these approaches is JS will generally still delay Time To Interactive