- Issue created by @balintbrews
- πΊπΈUnited States tedbow Ithaca, NY, USA
wim leers β credited tedbow β .
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Crediting @tedbow for #3500043-3: Publishing code components β .
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Related: β¨ Usage info for code components with unpublished changes Postponed . Because β¦ it'd be 100% safe to change props and slots whenever as long as there are no instances yet. And thanks to π Calculate field and component dependencies on save and store them in an easy to retrieve format Active , that's now actually possible.
IOW: the conversation here needs to be forked along two paths:
- 0 instances exist: anything is allowed
- >=1 instances exist: care is needed
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Note: a new required prop would actually be trivial to support. Because XB requires required props to have an example value!
Especially since π Component trees with dynamic prop sources that introspect field values don't add the relevant fields to their dependencies Active just added
::getDefaultExplicitInput()
, this would be easy to support.Conceptually speaking, the needed changes would be:
ComponentTreeHydrated
would have to change from
$source->renderComponent($stored_explicit_input)
to
$source->renderComponent($stored_explicit_input + $source->getDefaultExplicitInput()) </li> <li>EITHER <code>ValidComponentTreeConstraintValidator
would need to be updated to relax from
$component_source->validateComponentInput( inputValues: $stored_explicit_input, component_instance_uuid: $component_instance_uuid, entity: $host_entity, ),
to also do
+ $source->getDefaultExplicitInput()
OR
\Drupal\experience_builder\Controller\ClientServerConversionTrait::convertClientToServer()
should do+ $source->getDefaultExplicitInput()
, which would ensure that any edit to any component tree would automatically add new required props' default values.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Important for usability of Code Component creators.
Critical for XB's data integrity when we add support for changing props/slots.