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.
The reason for its size is my site is my playground. It's where I get to experiment with all the things I want to experiment with.
I also work on quite a few open source projects, which I usually test on my site before releasing them publicly just to make sure they work in production without errors.
I suppose the author just wants to know a little about how their blog and writing is performing in the wild
Sort of off topic, but it would be interesting if the browser handled these common cases instead and gave the user a way to opt-in/out. I suppose it sort of does by broadcasting those events to the js listeners in the first place.