Open iberdinsky-skilld opened 1 year ago
if you are talking about webform it always (!!!) has fallback
take any example , let see choises
which means next: 1. you may do composer require choices in you main composer file which is correct way
OR you may use approach with merge-plugin proposed by webform.
but still good way to control all packages in your project from one place
shortly - webform does care if you have library or no webform will work if you dont have library library may be delivered in normal way described in d.org webform has its own way which requires merge-plugin - but you are free to not use it thats flexibility which does not breaks drupal paradigm
Another very important thing, which is missed in your PR library definition, according webform - https://git.drupalcode.org/project/webform/-/blob/6.1.x/webform.libraries.yml#L1030 as you may see library is declared here and finally internal library has a dependency from external https://git.drupalcode.org/project/webform/-/blob/6.1.x/webform.libraries.yml#L491
and finally element (component) may attach internal library which has:
According last disqussion i found way how to define components dependencies inside component
More info:
https://www.drupal.org/docs/8/modules/webform/webform-cookbook/using-the-composer-merge-plugin-to-download-libraries-with https://github.com/wikimedia/composer-merge-plugin
Approach taken from webform:
https://git.drupalcode.org/project/webform/-/blob/6.1.x/composer.libraries.json
libraries temporary gitignored in PR.
library can be defined in ui_patterns.yml
In fact it can be improved with custom asset type which can be installed into /templates/patterns/atoms/button/assets/choices