Overview
JS Components don't use plugins and hence this key name doesn't make sense
Proposed resolution
Allow source components to not use a plugin ID (they're already not required).
Quoting HEAD's type: experience_builder.component_source_settings.* definition:
experience_builder.component_source_settings.*:
type: mapping
label: 'Source-specific component settings'
mapping:
# @todo Rename this to `source_local_id` or something like that in https://www.drupal.org/project/experience_builder/issues/3502982
plugin_id:
type: string
label: 'The intra-source ID of this component in this source'
constraints: {}
So, change the name of the required setting from plugin_id to:
local_source_idintra_source_idlocal_idlid(also used by JSON:API spec: https://jsonapi.org/format/#document-resource-objects — see https://jsonapi.org/format/#document-resource-objects:~:text=a%20client%.... specifically)- … something else — IOW: TBD
User interface changes
None.
Issue fork experience_builder-3502982
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
larowlanComment #3
longwaveComment #4
wim leersComment #5
wim leersComment #8
wim leers@niharika.s: wow, so nice to see this almost done! 🤩
@larowlan:
The problem with that is that that won't work with:
This guarantees consistent, meaningful
Componentconfig entity IDs.See that last line there: that's immutable. There's no other way I know of in config schema to achieve this.
I think
is plenty clear: for every
Block-sourcedComponentconfig entity, thelocal_source_idmust be a block plugin ID. The validation constraint makes this firm.And the equivalent for a component source using config entitities:
Comment #9
wim leersComment #10
wim leersComment #12
wim leersThanks for taking this on, @thoward216!
Comment #13
wim leersLooks ready for review to me? 🤓
Comment #14
wim leers— @larowlan at https://git.drupalcode.org/project/experience_builder/-/merge_requests/6...
Config schema limitations
While I agree that would be nice, that's AFAIK simply not possible using config schema.
We need the
idfor aComponentconfig entity to be validatable.👆 That last bit must be a known name, there cannot be dynamicness there. At least AFAIK.
Hence:
That's why this issue summary proposed a whole range of possible names. This MR went with
local_source_id.Per-
ComponentSourcemeaning of "what this ID points at"It's then up to each individual
ComponentSource-specific settings config schema type to define what the meaning is of that identifier:Conclusion
IMHO this as good as it gets. I think it's much better than "plugin ID" because it makes no assumptions.
So: RTBC, but giving @larowlan the chance to block commit if he has a better idea 😄
Comment #16
larowlanCommitted to 0.x - thanks!
Comment #18
wim leers