-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fast lightweight loading attribute polyfill #50
Comments
To me this polyfill looks strange since it requires generation of |
For the meantime, if you don't care too much about backwards-compability (which for me is fine.. because missing lazy-loading is not breaking the site. Having lazyloading is a progressive enhancement to me) you can just add That said, I really would love to see that this component moves from a custom lazy-loading to the native one. The main argument to me really is SEO as crawlers (and also stuff like facebook) would not be able to see the images in the current implementation. |
@Suven yeah, it would be great to see this component become the new Nuxt standard for using images, similar to how Next deprecates standard img tag in favor of https://nextjs.org/docs/api-reference/next/image |
We do not plan to support a polyfill for You can of course always add your own polyfill... |
@danielroe sometimes it just requires to wait for 4 years to resolve the issue, right? 😂 |
I guess! Though in reality this probably could have been closed with the release of v1. |
Loading="lazy" is the future
I saw that internally you used the IntersectionObserver API by default instead of the new loading attribute.
Compatibility
I know that the loading attribute is not well supported yet... but there's a lightweight polyfill that you could use today.
It is only 2.88 KB for the minified version. Moreover, the polyfill is compatible down to IE 9.
The benefits
In order to make a huge improvement for todays web performance challenges, you could implement the loading attribute polyfill.
This means less code maintenance, consequently less potential technical debt and a faster seo friendly nuxt-image component.
It could also allow you to avoid development errors (and therefore new issues from the community) due to custom providers urls encoding, url transformations and static generation.
See: https://github.com/mfranzke/loading-attribute-polyfill
The text was updated successfully, but these errors were encountered: