Overview

While working on #3532718: Improve the front-end DX of `<img srcset>`, I realized that both

are actually NOT what we should be doing, but it's the pragmatic work-around until we have adapter support: #3464003: [PP-1] [later phase] [needs design] Introduce "adapters" UX.

If we ship the beta like this, it’ll mean supporting these computed field properties forever, unless we do a fully automated update path early on, before enormous amounts of content can be created. We know and proved it’s technically possible (see ComponentInputsEvolutionTest::testBlockPluginUpdatePath()), but … ideally we avoid this.

Proposed resolution

Allow adapters that consume a single prop shape and output that same single shape.

This would bypass the need for:

  • design
  • UI changes
  • hopefully any front-end changes
  • hopefully minimal back-end changes

User interface changes

None.

Comments

wim leers created an issue. See original summary.

wim leers’s picture

Issue tags: +beta target

Discussed in detail with @effulgentsia, I'll spend 2 time-boxed hours on this tomorrow. Given the impact, we agreed to tag it beta target.

That would remove the need to replicate this crutch/work-around in more places, and simultaneously avoids the need to do all of #3464003: [PP-1] [later phase] [needs design] Introduce "adapters" UX.

wim leers credited lauriii.

wim leers’s picture

Also, this would allow solving https://git.drupalcode.org/project/experience_builder/-/merge_requests/1..., which @lauriii pointed out yesterday.

effulgentsia’s picture

Project: Experience Builder » Drupal Canvas
Version: 0.x-dev » 1.0.0-alpha1
wim leers’s picture

Version: 1.0.0-alpha1 » 1.x-dev
Assigned: wim leers » Unassigned
Issue tags: -beta target

We won't have time for this, sadly.

wim leers’s picture

Because this hasn't happened, the Acquia DAM team has opened #3550750: Adding bundle-specific expression branching support to `ReferenceFieldTypePropExpression`. While understandable, it's very concerning, because it shows that the longer we don't have this, the bigger and more complex the update path towards adapters will become.

Similar challenges at #3545859: Add a `host-entity-url` prop source for linking to the host entity for Drupal CMS' needs.

wim leers’s picture

1.0.0 shipped on Dec 4. This is too late. We can't avoid a future update path now.

However, #3563380: Allow linking integer timestamps to `type: string, format: date`: allow `DynamicPropSource` to optionally use a single-input adapter plugin is about to land, and brings something different, but arguably more valuable.

This is irrelevant, because 1.0.0 has already shipped, so any pain this was aiming to avoid, is now too late.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.