otter
otter copied to clipboard
[Feature]: Configuration metadata of extended components
Context
Use case: Component (exposed) replacement in customization process.
Nowadays, from the customization repository a component can be replaced using the c11n mechanism.
The custom component can be created from scratch or it can extend a base component and add some modifications. If the base component is an exposed component (implementing ExposedComponent, Block, Page interfaces), then the custom component should be an exposed one too, therefor the metadata will be extracted for the custom component too. But in the case when the custom component extends a base one, the metadata from the base one will be generated, but it could not be used by the CMS to generate visible effects on the UI, because the component was replaced with the custom one. That's why we need to enhance the component metadata extractor to detect that a component extends another one, and to compute the configuration metadata from the base plus the custom config.
Proposal
As we already have an O3rComponent decorator, we could add a new property to this one in order to identify the base component at metadata extraction, and create the custom config computed from the base and custom config (if it's the case).
The use-case refers to component replacement but the resolution should apply to all custom components extending an exposed component.