Placeholders/#lazy_builder is not supported for block component rendering

Created on 11 April 2025, 11 days ago

Overview

📌 Add support for Blocks as Components Active added support for block components.

However the block rendering directly renders the block plugin using $block->build() without support for automatic placeholdering of blocks.

Automatic placeholdering of blocks is supported by block module in BlockViewBuilder::viewMultiple().

It is not supported in layout builder, but there is an open issue since 2019 to fix that 📌 Support auto-placeholdering for blocks placed in Layout Builder Needs work .

Proposed resolution

I have a feeling that the logic from BlockViewBuilder::viewMultiple() to build the render array could be copied more or less into the block component plugin, doesn't seem like it would need a huge refactor or anything.

Note that BlockPluginInterface now supports a ::createPlaceholder() method since 📌 Create placeholders for more things Active as of 11.2, that might need a method exists check for earlier Drupal versions but would be good to respect that since it leads to significant performance improvements with the current state of 11.2 as well as various in-progress issues.

User interface changes

🐛 Bug report
Status

Active

Version

0.0

Component

Component sources

Created by

🇬🇧United Kingdom catch

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024