This module's description mentions at the top "There is also an initiative to get this feature into core" -- that initiative at https://www.drupal.org/project/drupal/issues/3167034#comment-13845238 has been merged way back in September 2020. We're looking at "should we use this module?" and have a few questions:
1. What benefits does this module have that Drupal Core is not doing?
2. Future of this module: I see it is marked as minimally maintained and feature complete. If there's not a significant benefit compared to Drupal Core, I suppose this module could be marked as deprecated?
3. Bonus: update the module description to note that #3167034 is now merged and with answers to the above.
Thanks in advance for any guidance.
Issue fork native_lazy_loading-3324493
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
gaëlgYes, it would be useful to know if this module is still required. The last time I checked, it was required for responsive images as the core did not handle them. But now that #3192234: Apply width and height attributes to allow responsive image tag use loading="lazy" has been released into 10.1.0, it may be useless.
The best way to know is to test on Drupal 10.1 without this module. If native lazy loading works well, with no layout shift, even for responsive images, even for images inserted in HTML text fields (with CKEditor), then I guess this module is now useless for D10.1+, which would be great.
If so, I'll mark it as deprecated and briefly explain why on the project page.
Note that, as native lazy loading in core seems to be configurable, if you upgrade an existing website to D10.1 and uninstall Native Lazy Loading contrib module, you may have to manually configure your image formatters to get native lazy loading. I may be wrong, I did not test that for now.
Comment #3
gaëlgComment #4
ken hawkins commentedThanks for the quick reply, very helpful!
As we investigate, we'll be sure to come back with any interesting notes.
Comment #5
gaëlghttps://www.drupal.org/node/3279032
Comment #6
prudloff commentedI did some tests and I think this module can be deprecated:
template_preprocess_image()now does the same thing asnative_lazy_loading_preprocess_image()native_lazy_loading_preprocess_image_formatter()andnative_lazy_loading_preprocess_responsive_image_formatter()don't seem necessary anymore to add the width and height attributes. (template_preprocess_image_formatter()adds them for non-responsive images. For responsive images, I am not sure which function adds them.)_responsive_image_build_source_attributes()adds the width and height attributes on source tags sonative_lazy_loading_preprocess_responsive_image()is not needed anymore.Also I don't think we need an upgrade path because the default value in core is "lazy" (even for existing view modes).
Comment #8
prudloff commentedComment #9
gaëlg