Overview
#3523841: Versioned Component config entities (SDC, JS: prop_field_definitions, block: default_setting, all: slots for fallback) + component instances refer to versions ⇒ less data to store per XB field row brought versioned ComponentSource-specific settings: as either the component itself evolves (an SDC/code component gains new props, a block plugin gains new settings, the field type used for a particular SDC/code component prop shape changes, etc.), we'll be able to still access instances that were created for a previous version and keep those component instances operational.
Furthermore, this also allows storing less information in the ComponentTreeItem's inputs field property.
#3523841 introduced all the necessary infrastructure on the server side (a lot), optimized the storage of inputs for all GeneratedFieldExplicitInputUxComponentSourceBase-powered component sources, updated the client side (a little) to adjust for the changes, and hence kept it all working.
Part of that is:
If we take those scenarios as inputs, we should be able to create a determinstic hashing approach that gives us a unique version ID for each component and set of those constraints.
But that issue did notenable the validation that verifies the versions are indeed deterministic hashes. The logic for that already exists, but if we enable it, 110 tests fail.
So, clearly, the logic in \Drupal\experience_builder\Entity\VersionedConfigEntityBase::generateVersionStringForData() which uses
$typed_data = \Drupal::service(TypedConfigManagerInterface::class)->createFromNameAndData($config_schema_type, $data);
assert($typed_data instanceof Mapping);
$normalized_data = $typed_data->toArray();
… does not quite result in the expected normalization that should result in deterministic hashes 😭
Proposed resolution
Investigate why the result of TypedConfigManagerInterface::createFromNameAndData()->toArray() is not deterministic.
User interface changes
None.
Issue fork experience_builder-3528159
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
wim leers#3523841: Versioned Component config entities (SDC, JS: prop_field_definitions, block: default_setting, all: slots for fallback) + component instances refer to versions ⇒ less data to store per XB field row is in.
I'm hoping @larowlan can push this one across the finish line too while I sleep 😇🙏
Comment #5
larowlanComment #6
wim leersYou got this to green already?! Reviewing! 🥳
Comment #7
wim leersWow, I'm so glad @larowlan looked at this with fresh eyes 😄
So … #2544708: The `label_display` setting in `type: block_settings` has the wrong config schema type struck again! It previously negatively impacted XB ~1.5 month ago in #3519179: Cannot place a code component with an image prop.
Comment #8
wim leersThis looks great! I'm relieved to see it was ~95% working already, and basically fixing 2 small bugs was all this took. Whew!
Even though the majority of the infrastructure already existed, I think expanding the issue title to precisely describe what this is about may come in handy during future git archeology 🤓
Comment #10
wim leersComment #11
wim leersThis is great, but I realized that actually the deterministic hash must capture more: #3528362: Deterministic Component version hash should depend not only on source-specific settings, but also slots + explicit input schema.