adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
730 stars 736 forks source link

Editor clientlibs categories are not versioned #15

Closed davidjgonzalez closed 7 years ago

davidjgonzalez commented 7 years ago

The editor clientlibs categories [1] are not versioned; they are explicitly made part of cq.author.editor to be automatically pulled into the AEM authoring editors UIs.

The issue comes arises in v2, when the editor clientlibs deviates from v1; in this scenario, both clientlibs will be loaded to unknown effect.

Oddly, the image component's editor category is versioned (core.wcm.components.image.v1.editor)

content/src/content/jcr_root/apps/core/wcm/components/image/v1/image/clientlibs/editor/.content.xml

Unversioned editor clientlibs (cq.authoring.dialog)

content/src/content/jcr_root/apps/core/wcm/components/form/text/v1/text/clientlibs/editor/.content.xml
content/src/content/jcr_root/apps/core/wcm/components/form/button/v1/button/clientlibs/editor/.content.xml
content/src/content/jcr_root/apps/core/wcm/components/form/options/v1/options/clientlibs/editor/.content.xml
content/src/content/jcr_root/apps/core/wcm/components/list/v1/list/clientlibs/editor/.content.xml
content/src/content/jcr_root/apps/core/wcm/components/form/container/v1/container/clientlibs/editor/.content.xml
davidjgonzalez commented 7 years ago

If versioning of editor clientlibs is the correct approach, there is the downstream concern of multi-tenant scenarios where AEM "Tenant A" is using v1 and Tenant V is using v2; what is the pattern for loading the correct editor clientlib based on the Tenant?

kwin commented 7 years ago

I think the right approach here at least for CSS is to always reference selectors with a version in it. That way two different versions don't overlap. For JavaScript there is no simple solution though.

henrykuijpers commented 7 years ago

@davidjgonzalez Maybe we can add to the documentation that, in case of overriding with sling:resourceSuperType, also the extraClientlibs property has to be overridden, so that it points to the correct version?