Problem/Motivation

Inspired from what Display Builder does in https://git.drupalcode.org/project/display_builder/-/blob/1.0.x/src/Plug...

  protected function useAttributesVariable(array $renderable): bool {
    $random = \uniqid();
    $renderable['#attributes'][$random] = $random;
    $html = $this->renderer->renderInIsolation($renderable);

    return \str_contains((string) $html, $random);
  }

It should be possible to test when drilling if attributes is used or not with this logic.

It should simplify:
- src/Render/Element.php::isRenderElementAcceptingAttributes
- src/Render/Element.php::isThemeHookAcceptingAttributes

Issue fork ui_styles-3613181

Command icon 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

grimreaper created an issue. See original summary.

grimreaper’s picture

Version: 8.x-1.x-dev » 2.x-dev

grimreaper’s picture

Assigned: grimreaper » pdureau
Status: Active » Needs review

One question if you are ok.

pdureau’s picture

Assigned: pdureau » grimreaper
Status: Needs review » Reviewed & tested by the community

  • grimreaper committed 6bd34445 on 2.x
    task: #3613181 Improve drilling: use rendering in isolation
    
    By:...
grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.