- Issue created by @fago
Forms support often needs some JavaScript to function nicely, e.g. Webform conditions need the states library, autocompletes need the autocomplete JS or antibot module support needs to load the antibot library.
Add support for loading drupal javascript libraries via a
<drupal-library-NAME>
custom element. It should receive some props like librariy name and the JS and CSS files to load.
Then we ship a component which takes care of loading drupal JS files in the frontend. By default, let's omit the CSS files. The frontend knows the backend base-URL and prepend that to the URLs to make URLs resolvable.
Finally, we need to take care of adding custom elements to page responses. I think, for forms we simply shall do so by default that we get all page-attachments being libraries and add it it to the form custom elements. For that to work out we'll have to resolve dependencies and add them also. Then the frontend will take them and render them.
Folks can still opt-out of loading individual drupal-libraries by adding vue component and customizing the loading behaviour.
Active
1.0
Code