HEAD broken with asserts enabled

Created on 16 January 2025, 5 days ago

Overview

📌 Improve or remove ComponentSourceInterface::getClientSideInfo() Active broke HEAD when asserts are enabled.

From \Drupal\experience_builder\ClientSideRepresentation


/**
   * @param array|null $preview
   *   Optional, will be expanded to `default_markup` + `css` + `js_header` +
   *   `js_footer` in $values.
   */
  public function __construct(
    public readonly array $values,
    public readonly ?array $preview,
  ) {
    assert(!array_key_exists('default_markup', $this->values));
    assert(!array_key_exists('css', $this->values));
    assert(!array_key_exists('js_header', $this->values));
    assert(!array_key_exists('js_footer', $this->values));
  }

but then lower in that file we pass all of those array keys

return (new ClientSideRepresentation(
      values: $this->values + [
        'default_markup' => $default_markup,
        'css' => $asset_renderer->renderCssAssets($assets),
        'js_header' => $asset_renderer->renderJsHeaderAssets($assets),
        'js_footer' => $asset_renderer->renderJsFooterAssets($assets),
      ],
      preview: NULL,
    ))
      ->addCacheableDependency($this)
      ->addCacheableDependency(CacheableMetadata::createFromRenderArray($build));

Proposed resolution

User interface changes

🐛 Bug report
Status

Active

Version

0.0

Component

Page builder

Created by

ðŸ‡Ķ🇚Australia larowlan ðŸ‡Ķ🇚🏝.au GMT+10

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024