[2.0.0-beta3] Consider bringing back SDC required slots feature

Created on 17 September 2024, 4 months ago

Problem/Motivation

Per the slack conversation https://drupal.slack.com/archives/C03MFN4D40J/p1726602273291509

We are ignoring required key in slots in purpose. We acknowledge it is a part of SDC definition format, but we believe it is a bad practice. You can create an issue for beta3 if you want to discuss the inclusion of this "feature".

The argument I would make about bring it back if there are definitely scenarios where a component will not work if a slot is missing, example an accordion item without a title. Without the required validation a site builder won't know their component is broken until after safe and previewing, when this probably could of been caught earlier. Thinking from the UI standpoint for this argument.

But even in twig if, as a developer, I got an exception that a required slot is missing that seems more clear then having to debug why a component is broken.

Steps to reproduce

N/A

Proposed resolution

Use the required key that SDC slots already offers.

Remaining tasks

Discuss

User interface changes

TBD

API changes

TBD

Data model changes

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States smustgrave

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

Comments & Activities

Production build 0.71.5 2024