Ah right, lazy loading, this is the reason that I have to make sure to scroll down the entire length of a medium.com article I'm reading on my phone and back to the top again to make sure the diagrams and math-as-images load completely before I get on a subway line that doesn't have 3g service. Hate it when I forget. Otherwise I'm left staring at blurry lines that don't explain much about what trying to read until it's time to get off. Sucks when my commute is 40 minutes straight on the same line.<p>I guess an advantage of a 'native' feature could be that browsers could offer a button saying 'please pre-load this page!'
Why would I want the loading behaviour of images to be chosen by the site I am browsing?<p>I would prefer to choose for myself whether images load eagerly or lazily on all sites I visit. This way, I would always know which type of loading to expect as I browse, and I would always get the type of loading I prefer.
This attribute appears to have been proposed and implemented by Google. Has any other vendor expressed an intent to implement/actually implemented this yet?<p>It seems a little premature to describe this as native support "for the web" if the functionality is limited to one vendor and you're forced to use a polyfill everywhere else.
I hope that they ship this with image intrinsicsize / aspect-ratio or whatever it is called now. Otherwise this lazy-loading will make page jumping and layout instability worse, because images are loaded only after the user has scrolled to their position.<p><a href="https://googlechrome.github.io/samples/intrinsic-size/" rel="nofollow">https://googlechrome.github.io/samples/intrinsic-size/</a>
That's why i love React Suspense very much. It offers the flexibility in the hand of developers instead of some inflexible native API.<p><Suspense fallback={<Placeholder />}>
<Image src="" />
</Suspense><p>When SSR, this one will show a real <img> tag.
When SPA, this one will lazy load image.<p>A Win-Win for both devs and customers.
I’m excited about this. There’s usually a ton unnecessary CPU usage with the current techniques, not to mention the human time waste of re-implementing them in JS. There’s feature detection for this too, so we can gracefully degrade “loading” to existing solutions and take advantage of it right away.
I hope they add an optional setting.<p>IE: <img src="celebration.jpg" loading="optional" alt="..." /><p>Then there is a place-holder graphic in place that you could click on to load the image.
Hmm, I guess this is good news for WordPress users who won't have to rely on a plugin to do this?<p>Excited to see what else they are going to bring to the browser to speed up sites.
Why would you have ever written JavaScript to lazy-load images?<p>The browser knows what’s on the page and can optimize its loading already. Don’t screw with that. This kind of assistance from the browser is why.<p>Also, you don’t need to run code in documents. Web pages are documents.