News for hackers. Stuff that matters.
Re:Idle Until Urgent by mrspeaker on Thursday September 20, 2018 @09:45AM (#18032368)
Looking at the blog post, I'd say it was for drawer.init(), contentLoader.init(), breakpoints.init(), alerts.init(), and analytics.init(). The site works fine without javascript, so it doesn't need it - perhaps the author thinks the 50k is worth the drawer, content loading, breakpoint?, and alert features and also wants a bit of user analytics tracking.
Re:Idle Until Urgent by AstralStorm on Thursday September 20, 2018 @10:57AM (#18032885)
Even so, you could backload the drawer etc. placing them at the end of the document and attaching to potentially already rendered page.

Reorder so that your main content loads first.

Author did part of it by deferring the analytics init. Not sure why they used setTimeout though for the initialization instead of requestIdleTimeout like everything else. The page is supposed to work without JS after all.

"I mentioned above that requestIdleCallback() doesn’t come with any guarantees that the callback will ever run."

Not true - there's a timeout argument. It guarantees that the callback will by ran by then.