Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hey.
We needed this module on a site built with Drupal 8 so I ported the module to Drupal 8.
Patch follows ...
Comment | File | Size | Author |
---|---|---|---|
#22 | views_lazy_load-drupal10_port-2843216-23.patch | 27.8 KB | AndrewsizZ |
#16 | innerdiff_9-16.txt | 151 bytes | ravimane23 |
#16 | views_lazy_load-drupal8_port-2843216-16.patch | 26.49 KB | ravimane23 |
#9 | views_lazy_load-drupal8_port-2843216-9.patch | 26.45 KB | gambry |
#9 | interdiff-5-9.txt | 6.21 KB | gambry |
Issue fork views_lazy_load-2843216
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
stBorchertAnd here is the promised patch.
Comment #3
stBorchertUpdated patch with composer.json.
Comment #4
stBorchertWhoa, forget to remove the test string in the loading area ...
Comment #5
stBorchertFinally ...
Comment #6
SteffenRHi stborchert,
I'm just testing your d8 port of views_lazy_load - looks great and works "like charm" / same loading experience as in drupal 7.
Would be great to have this patch in a new 8.x-1.x branch of the module to use it in a recent project, that relies on a composer based workflow.
Thx for sharing.
Comment #7
benjy CreditAttribution: benjy at PreviousNext commentedI've created the 8.x-1.x branch and enabled testing. We'll want to convert the test here before we commit it. Additional feedback below.
Convention in core is for this to be:
then we can use the local settings instead of the global drupalSettings I believe.
The library is been added below so this comment isn't relevant anymore.
This will always return FALSE, needs fixing.
We shouldn't use REQUEST, we should use \Drupal::request() or better yet, inject the service if possible here.
The current request can also be used here now, $request->headers->get->('User-Agent')
Is this meant to be concat, if so, do we need a space?
Comment #8
aguilarm CreditAttribution: aguilarm commentedRequiring this module with composer for drupal 8 right now, fwiw, will require applying this patch before it works. The 8.x-1.x-dev in it's current state is still the d7 code.
Comment #9
gambryAttached a patch fixing feedback from #7.
Few notes:
This is the way most plugins do, see Block for example.
views_lazy_load_get_excluded_user_agents()
from .module, which now pulls data through the State API. Not sure if we like it for consistency, I would rather prefer to have the State service injected and called within the LazyLoadDisplayExtender plugin.$info = $this->displayHandler->getOption('empty');
is supposed to do. From the D7 code looks like we pass this option to the area->init() , but it is still needed for D8?Test coverage is still missing.
Comment #10
gambryAlso the config schema definition for the plugin is missing and needs to be added.
Leaving Needs Review for community to give feedback on the notes, but this issue still Needs Work.
Comment #11
MustangGB CreditAttribution: MustangGB commentedJust curious what this module gives you that BigPipe doesn't, or can't, for D8.
Comment #12
gambryBig Pipe is in action where Page Cache isn't, so for example for authenticated users.
One example where this module may do something BigPipe can't is serving dynamic views to anonymous users when Page Cache (or something like Varnish) is ON.
Comment #13
MustangGB CreditAttribution: MustangGB commentedHmm okay, I haven't built any sites around this sort of thing in D8 yet so I don't really know what I'm talking about, but I thought Sessionless BigPipe was the solution to the anonymous user problem.
Comment #14
rahullamkhade CreditAttribution: rahullamkhade commented@MustangGB Do you know how to load view through Big Pipe?
Comment #15
admintauheed CreditAttribution: admintauheed commentedDevelopment version: 8.x-1.x-dev updated 16 Jan 2017 at 06:53 UTC
Hi can we use the above module on a live site
And is the patch applied
Thanks in advance
Comment #16
ravimane23 CreditAttribution: ravimane23 as a volunteer and at TATA Consultancy Services for Pfizer, Inc. commentedApplied the patch #9 manually in Drupal 8.9.
For Drupal 9, just minor change in info.yml file and the module will compatible with Drupal 9.
Added a new patch to make module compatible with D9.
Comment #17
bigmonmulgrew CreditAttribution: bigmonmulgrew commentedCan we please get the dev version updated to reflect the patch.
If you like, add me as a maintainer and I'll add it myself.
Comment #18
generalredneckJust want to throw this out there... You can use this in addition to something like Views Infinite Scroll (and a patch I threw over on #3202638: Lazy Load on Scroll) to do things like auto advancing articles or to defer loading large chunks of content until the user reaches it. This provides a user experience over just cloaking content from Search Engines or deferring load times.
Comment #22
AndrewsizZ CreditAttribution: AndrewsizZ as a volunteer and at ASYNC life for ASYNC life commentedAdded patch for Drupal 10