mortenson/twig-components

How would we integrate this into a Drupal 8 site?

frob opened this issue · 2 comments

frob commented

Would this work with https://www.drupal.org/project/components or is there another integration that I should be looking at.

@frob Good question - I'm planning on writing a Drupal module will handle automatic loading and server side rendering Twig Components, but for now you could just include the bundled components in a libraries.yml file, add that to a page, and then write your custom tags in any area that accepts HTML normally. The project template provided by generator-twig-components should output a bundled JS file for you.

https://www.drupal.org/project/components doesn't actually use Web Components, and instead allows you to provide re-usable Twig templates that can be included/extended with a namespace.

I've finally published https://www.drupal.org/project/twig_components, please check it out. 😄