4 ms·
> makes sure images are only loaded when they are in the viewport To be fair that can already be done in pure HTML with the `loading="lazy"` attribute. And bro
by alpaca128 4y ago
> makes sure images are only loaded when they are in the viewport
To be fair that can already be done in pure HTML with the `loading="lazy"` attribute. And browsers will probably do the link preloading as well sooner or later, some already do in specific cases.
NextJS is nice but after all the issues with dependencies and npm I went through I'd hesitate to use it for personal projects.
- leerob 4y agoHey, could you share more about the issues you hit? Would be happy to take a look. Also FWIW the new version of the Next.js image component has been refactored onto native browser lazy loading. When it was first created, cross browser support wasn’t there so it had to polyfill support. Not only does it do lazy loading, but it also can optimize your images for you.
- satvikpendem 4y agoHey Lee, I actually have your personal site as one of my examples, hope that's alright. Do you know if Next has iframe lazy loading as well? I'm using `loading="lazy"` which works but didn't work as well as the package I'm using that's on the React side, react-lazy-load-image-component, which works for iframes as well, and it actually doesn't even mount the component until it comes into view, which didn't seem to be the case for `loading="lazy"`.