Overview
While working on #3532718: Improve the front-end DX of `<img srcset>`, I realized that both
- that issue's MR's
src_with_alternate_widthscomputed property on theimagefield type, and - its predecessor's (#3515646: Add automated <img srcset> generation)
srcset_candidate_uri_templatecomputed property on theimagefield type
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
Comment #3
wim leersDiscussed in detail with @effulgentsia, I'll spend 2 time-boxed hours on this tomorrow. Given the impact, we agreed to tag it .
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.
Comment #5
wim leersAlso, this would allow solving https://git.drupalcode.org/project/experience_builder/-/merge_requests/1..., which @lauriii pointed out yesterday.
Comment #6
effulgentsia commentedComment #7
wim leersWe won't have time for this, sadly.
Comment #8
wim leersBecause 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.
Comment #9
wim leers1.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.
Comment #11
wim leers