-
Notifications
You must be signed in to change notification settings - Fork 141
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
yall.js as a fallback for native loading="lazy" #75
Comments
Thanks for this, @panablue. At current, my strategy is no fallback. I considered writing a new version of yall to try and dovetail with native lazy loading, but the more I think it over, the more I'm convinced that one of two strategies should be adopted:
Native lazy loading is currently supported for images and iframes in nearly 63% of browsers at the time of this writing. As Edge creeps forward with adoption of Chromium, and Firefox appears to show interest in implementation, I'm less inclined to believe we should be pressing forward with userland solutions like this. I believe they ultimately hold the platform back, and introduce unnecessary complexity in applications in the presence of a simpler, more robust platform-provided solution. |
WebKit is working on it. https://bugs.webkit.org/show_bug.cgi?id=196698 |
@malchata Just going with one or the other certainly keeps it simple. Depending on the region and site-specific audience (prevalence of iOS, etc) I suppose sticking with a JS solution for now probably covers the most users. If it's useful to anyone, this is a simple snippet I put together for a recent project that didn't need support for
Used with HTML like:
|
Now that a significant segment of browser market share supports native lazy loading with
loading="lazy"
, what's the best way to configure yall.js as a fallback?Something like:
(LazyLoad includes a native/fallback option, but although lightweight, ideally the full plugin would only be loaded when native lazy loading is unavailable.)
The text was updated successfully, but these errors were encountered: