Problem/Motivation
I originally though people would add Twig namespaces to label their entire component library. Which is why I used the term "component library" in many places in the code. But there's nothing in the code that limits developers. And my naming makes it seem like people are abusing the API. It's fine if someone wants to have a @form namespace that points to just their form-related components. And the code shouldn't be hinting at a limit that doesn't actually exist.
Proposed resolution
Rename "component-libraries" keyword in the theme/module yml files to just "components:namespaces".
Old way:
component-libraries:
STARTERKIT:
paths:
- components
- templates
New way:
components:
namespaces:
STARTERKIT:
- components
- templates
User interface changes
None.
API changes
We should allow the old "component-libraries" keyword for backwards compatibility.
Comments
Comment #2
johnalbinUpdated new yml syntax so that it will work with other yml settings I'll be adding to the components module.
Comment #3
johnalbinComment #5
johnalbinComment #7
nikitas commentedi am using radix (4.10) and i had to remove component-libraries and add components instead:
Old way
New way
Comment #8
afschRegarding to #7, I think that works too. I also found a similar an approach in a different module https://www.drupal.org/project/radix/issues/3193046 (see the patch). It works as well.