- Issue created by @wim leers
- Status changed to Active
8 months ago 12:52am 14 August 2024 - Assigned to lauriii
- š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
Provided more context about the problem space.
- š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
- š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
So, @effulgentsia is not convinced that embedding a heading (or other) component in another component of bubbling up the top-level props of the child component into an object prop in the parent component makes sense. Which means he's questioning š Document supported component modeling approaches Active , because that's what š Introduce an example set of representative SDC components; transition from "component list" to "component tree" Fixed implemented and š Follow-up for #3446722: `side_by_side` + `accordion` (+ maybe `text`) components Active is the remaining part for š
That would probably mean new criteria for SDCs to be eligible for XB.
This deeply impacts https://www.drupal.org/project/demo_design_system ā too ā because depending on the outcome of that discussion, https://git.drupalcode.org/project/demo_design_system/-/tree/1.0.x/compo... may or may not need to change (if they're using the pattern that š Follow-up for #3446722: `side_by_side` + `accordion` (+ maybe `text`) components Active is adding).
- Issue was unassigned.
- Status changed to Postponed
8 months ago 8:00am 26 August 2024 - šŗšøUnited States effulgentsia
Wim Leers ā credited effulgentsia ā .
- š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
I asked @effulgentsia and @lauriii to respond to #5. They did, but unfortunately not here, but in a private chat. I captured @effulgentsia's response in #7.
Here's @lauriii's:
This is not on the critical path for the demo because this can be worked around
(By "the demo" he means š± Milestone 0.1.0: Experience Builder Demo Active .)
They both think we should do a working session with @tedbow, @jessebaker, @lauriii, @effulgentsia, I and ideally @ctrlADel too.
- š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
An example of this problem in the current XB code base: the
shoe_button
SDC'sicon
prop. That surely seems like a legitimate use case? - Assigned to larowlan
- Status changed to Needs review
22 days ago 3:44pm 18 March 2025 - š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
The 3 options listed in the issue summary all seem less than ideal.
It seems better/simpler to add a dependency on https://www.drupal.org/project/field_union ā and help get #3011348: Add widget support ā done. Then we'd be able to, per https://git.drupalcode.org/project/field_union/blob/8.x-1.x/Readme.md#ho... :
FieldUnion::create([ 'id' => '<sdc provider>.<sdc name>.<sdc prop that is object-shaped with a single level underneath>', 'fields' => [ // ā¦ all the nested data ], ]);
which would then allow this in the SDC's
Component
config entity in XB:dependencies: config: - field_union.field_union.<sdc provider>.<sdc name>.<sdc prop that is object-shaped with a single level underneath> ā¦ settings: prop_field_definitions: <sdc prop that is object-shaped with a single level underneath>: field_type: <sdc provider>.<sdc name>.<sdc prop that is object-shaped with a single level underneath> field_storage_settings: {} field_instance_settings: {} field_widget: '@todo #3011348' default_value: { ā¦ all the first example values for all the nested data ā¦ } expression: 'This should already be expressible using the existing PropExpression infrastructure.'
Assigning to @larowlan to get high-level feedback š¤š
- šøšŖSweden johnwebdev
Correct me if I'm wrong:
I think one problem with Field Union is that it doesn't support arrays in a union. If it does, please just ignore this comment.
Taking the applicant from the example of the module, https://www.drupal.org/project/field_union ā
I'm unable to have a categories instead of category field on the union, e.g. an applicant having two categories. Two categories might not make sense, but perhaps I want multiple tags.
In an ideal world you would be able to mix object and array however you want. That would enable such a powerful modeling tool.
- š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
Very good question, @johnwebdev! That would indeed prevent some use cases. Although it could be argued that you could just add a
category_1
,category_2
, etc. (single-cardinality) fields to theFieldUnion
, and make either 0, 1 or all of them required. It'd achieve the same. It'd only become truly weird/awkward for an unlimited cardinality field.OTOH ā¦ AFAICT the
fields
in aFieldUnion
areFieldStorageConfig
s, notFieldConfig
s. That'd mean you totally could specify them as multiple cardinality ā¦ which would make your argument mootSearched the issue queue and found #3052670: Support multi-valued "field union"s ā , which confirms that this would work, see https://git.drupalcode.org/project/field_union/blob/8.x-1.x/tests/src/Ke...
@larowlan, can you confirm I interpreted this correctly? š
- š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
Addition to #13: š Add constraint validation support Active would also be a hard blocker for XB relying on
field_union
ā without it, we'd weaken XB's compliance with product requirement14. Configuration Management
. - š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
Changing the issue title to eliminate depth >1 from scope.
Imagine widgets in collapsibles in collapsibles in collapsibles in collapsibles ā¦
- šøšŖSweden johnwebdev
#15 hmm, I interpeted that as you can have an array of applicants => a field union field with muliple cardinality... but the applicant => the field union => cannot have any fields in it that are multi-valued.
But let larowlan confirm that!
- š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
Per discussion with @lauriii and @effulgentsia yesterday, @lauriii thinks this should not block stable, but should be possible to add post-
1.0
.