News for hackers. Stuff that matters.
Re:Lighthouse scores: how to reduce render-blocking scripts by acconrad on Wednesday July 18, 2018 @05:13PM (#17562105)
Kind of a lot of words for using Async, Defer, or IntersectionObserver. But this is a weird case of using IntersectionObserver. I'd rather use it for something like lazy-loading images[1]. They have a much higher download cost and will provide a much greater boost in performance than optimizing your JavaScript. Also, by placing all of your scripts at the bottom (save for a few at the top like Modernizr), you really don't need to worry too much about async vs defer.

[1] https://www.machmetrics.com/speed-blog/how-to-lazy-loading-i...

Re:Lighthouse scores: how to reduce render-blocking scripts by RobertRoberts on Wednesday July 18, 2018 @07:24PM (#17562867)
It appears Google will be integrating lazy loading into the browser.[0]

In my almost 20 years of development experience, I find my todo list extremely long. And a core principle that has served me well is that if a feature is coming to the browsers for free, it's cheaper and easier to wait for the feature instead of spending real time/money building a cheap copy of it, and then having to rip it out a year later for the native feature.

"Feature patience" seems a fitting description.

I have recently used IntersectionObserver to replace scroll event functionality (modifying sticky positioned headers) and it's great for that, but I don't want to use it for lazy loading, seems like way to much work.

[0] https://groups.google.com/a/chromium.org/forum/#!msg/blink-d...