Doc and otherwise make clearer how the 'html' preview element is generated

Created on 8 April 2025, 13 days ago

Overview

Follow-up to #3512385-15: Changes to code components are not visible in global regions until published

To write a test for that I really wanted to understand how the 'html' preview element was generated and how it should be determined if we are "in preview"

I just now realize how the html previewing works. I wasn't involved in these issue but wondering if we should document better how these classes relate to each other

  1. PreviewEnvelopeViewSubscriber
  2. PreviewEnvelope
  3. XBPreviewRenderer
  4. XbPageVariant
  5. RenderEventsSubscriber
  6. ApiLayoutController

This is all very complicated and there is no where to see who all these related to each other

Proposed resolution

Wim suggested in #3512385-16: Changes to code components are not visible in global regions until published a class-level docblock on \Drupal\experience_builder\Controller\ApiLayoutController

Lets do that and also see if any of the class names should renamed to make this clearer

User interface changes

📌 Task
Status

Active

Version

0.0

Component

Documentation

Created by

🇺🇸United States tedbow Ithaca, NY, USA

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

Merge Requests

Comments & Activities

  • Issue created by @tedbow
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    Great call, @tedbow!

  • 🇺🇸United States tedbow Ithaca, NY, USA

    One thing I don't understand is because `\Drupal\experience_builder\EventSubscriber\RenderEventsSubscriber::getSubscribedEvents` and `\Drupal\block\EventSubscriber\BlockPageDisplayVariantSubscriber::getSubscribedEvents` both subscribe to `RenderEvents::SELECT_PAGE_DISPLAY_VARIANT` but don't set a priority what guarantees that `RenderEventsSubscriber` will 2nd ? If BlockPageDisplayVariantSubscriber ran 2nd wouldn't it just overwrite RenderEventsSubscriber settings?

  • Merge request !871#3517977 Document html preview → (Merged) created by tedbow
  • Pipeline finished with Failed
    12 days ago
    #469383
  • Pipeline finished with Canceled
    12 days ago
    Total: 846s
    #469408
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    #3: hah, nice catch! I think that's indeed only working thanks to XB's module name starting with e, and Block with b, and hence XB's event subscriber running later 😅

    We should specify a priority in \Drupal\block\EventSubscriber\BlockPageDisplayVariantSubscriber::getSubscribedEvents() :)

  • Pipeline finished with Success
    12 days ago
    Total: 1584s
    #469421
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    +1'd @tedbow's latest idea on the MR, this now seems close!

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
  • Pipeline finished with Canceled
    7 days ago
    Total: 65s
    #473132
  • Pipeline finished with Canceled
    7 days ago
    Total: 64s
    #473133
  • Pipeline finished with Failed
    7 days ago
    Total: 1527s
    #473134
  • Pipeline finished with Canceled
    7 days ago
    Total: 64s
    #473558
  • Pipeline finished with Canceled
    7 days ago
    Total: 732s
    #473559
  • 🇺🇸United States tedbow Ithaca, NY, USA

    Tests were failing. I think I have fixed them

    If so, I think this issue is good to go

  • Pipeline finished with Success
    7 days ago
    Total: 1663s
    #473563
  • Pipeline finished with Skipped
    7 days ago
    #473577
    • tedbow committed 82cf336d on 0.x
      Issue #3517977 by tedbow, wim leers: Doc and otherwise make clearer how...
  • 🇺🇸United States tedbow Ithaca, NY, USA
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    🥳

Production build 0.71.5 2024