[META] Missing features in SDC needed for XB

Created on 19 July 2024, 3 months ago
Updated 10 September 2024, about 1 month ago

Overview

Experience Builder depends on the SDC for developers to define components. There has been some work to define the ways to build components with SDC: 📌 Document supported component modeling approaches Active . There's also Allow specifying default props values when opting an SDC in for XB Fixed has started working towards allowing to opt-in individual components to unblock the development of the frontend application. However, these are not taking into account all of the aspects of the intended UX/DX, or limitations of SDC. We need to define both how we want SDCs to be integrated with XB, but also what are the changes needed to SDC to make this happen.

XB has been complementing SDC's functionality by introducing a Component config entity ( 📌 "Developer-created components": mark which SDCs should be exposed in XB Fixed ) and adding "missing information" there (e.g. field type + widget + default value Allow specifying default props values when opting an SDC in for XB Fixed ). But eventually the goal is that SDCs truly do contain all the information that XB needs for SDC to be usable in XB, to ensure that the original DX for SDCs remains: "drop in a directory and that's it", not "… oh and also go and modify this configuration".

This is the list of additional metadata/functionality that XB needs, which SDC does not yet provide:

Proposed resolution

Requirements that must be met for XB to allow an SDC to be used:

  1. Every required prop must have >=1 example — the first example value will be used as the default when
  2. every required prop must have >=1 example. (to be reconciled with #19's addition of default support)
  3. every prop (optional or required) must have a title → surfaced by 📌 Follow-up for #3461422: display SDC prop's human-readable name (`title`), not its machine name Needs review

(Future criteria: SDC's status must/must not be a certain value, enum values must have labels, etc.)

Consequences for choices of how XB uses SDCs:

  1. Changing the default value requires changing that prop's examples in the *.component.yml file. Because XB wants to use SDCs unchanged
  2. Consequently, using an existing component but wanting a different default and the site is already using this component requires replacing the component (using the site's default theme), because that keeps the component ID unchanged.
  3. To be able to do that, we must be able to have config-defined SDCs (at which point that name is a bit odd) in addition to code-defined SDCs. These must be exportable to actual (code-defined) SDCs, but the config-defined ones allow a Site Builder to modify defaults on a live site, without needing code deployment.

User interface changes

📌 Task
Status

Needs work

Component

Page builder

Created by

🇫🇮Finland lauriii Finland

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

Comments & Activities

Production build 0.71.5 2024