Align source contexts

Created on 7 July 2025, 21 days ago

Problem/Motivation

UI Patterns 2

UI Patterns 2 is shipped with those context for sources:

The mix between context_definitions and context_requirements is a bit complex, and some context_requirements naming are too specific (field_formatter for example).

There are some plans to add a "Content" context (not the same as "Content entity" for sources which can be stored only in a content field (for Layout Builder overrides or Ckeditor5 for example).

Display Builder

The module doesn't use context_definitions and has those context_requirements:

  • is_display_builder_views. Example: ViewExposedSource
  • is_display_builder_page_layout. Example: PageTitleSource

Those contexts don't tell about where we are in the Drupal API, what we have access from the source, but about the specific Display Builder sub-module using it. So, they sources will not be compatible with the UI Patterns 2 ecosystem and the future Display Builder ecosystem.

In a perfect world, Display Builder will have no Source plugins in its codebase.

Proposed resolution

Instead of is_display_builder_views, use the ones already defined and managed by UI Patterns 2.

Instead of is_display_builder_page_layout . Add a "Page" context which will be able to be proposed for UI Patterns 2 inclusion. See 📌 [1.0.0-beta1] Add proper page management Active

The future Content context must follow the same principles.

If it is the opportunity to propose a backward compatible simplification to UI Patterns 2 team, let's do it.

📌 Task
Status

Active

Version

1.0

Component

Main / Misc.

Created by

🇫🇷France pdureau Paris

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

Comments & Activities

Production build 0.71.5 2024