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.
Problem/Motivation
Consider a page with 300 comments and have 300 placeholder-ed action links within the comment that are different per user.
All those action links need the entity loaded.
So the code flow for rendering the 300 comments is:
$comments = Comment::load($all_300_entities);
While for the placeholders with lazy builders the code flow is for each:
$comment = Comment::load($cid);
Proposed resolution
The idea is to allow for groups of data to load all of them at once.
e.g. if a lazy builder for a placeholder implements PreparableLazyBuilderInterface then its prepare method is called with all placeholders in that 'group'.
Remaining tasks
- Discuss
Comments