- 🇺🇸United States cosmicdreams Minneapolis/St. Paul
Kind of actually. With Drupal 10.1's single directory components we're able to start building components that work within Drupal Core. Now we just need to demonstrate a component or set of components that provide value to the system. We're also able to compare and contrast different approaches to making components.
Here's a component I made with lit for reference: https://www.drupal.org/project/pokemon_card →
- 🇬🇷Greece user654
@cosmicdreams
Thanks for the reply.
I have a question:Do we need to build web components specific to Drupal?
Wouldn't it be better to use existing components e.g. from Lit? @pinkonomy - yes and no. It would probably be best to take some dumb components (design specific) and use them as the basis to wire into smart components (drupal specific). There are many out there but the two I think are the most well developed as far as providing reusable pieces that are within a specific design system they'd be:
- https://shoelace.style/
- https://github.com/material-components/material-webBoth are built on top of Lit and are very small as a result.
@cosmicdreams is correct that Drupal has a methodology for organizing and loading these assets.
- 🇺🇸United States cosmicdreams Minneapolis/St. Paul
@pinkonomy: I think this question goes back to the classification of components. I like to think of it as:
- display component: just frontend stuff, intakes variables prepared by the server
- layout components: components with slots, built to wrap other components
- data-driven components: components that are built to got fetch data from outside sources
Now, I suspect that either with web components / lit or not. The fact that we can componetize bits of markup and share them (like within a module or a theme) will help Drupal go a long way down the road to making it easier to interact with Drupal's from a template / component level. And whether the final component was written with vanilla / lit / whatever component library, the way we'd interact with it via twig will be the same. As a result, it would likely be a good idea to make each component be self contained.
We'll have to see.
One of the adventures I'd like to do before Drupalcon is to take a component library and see what it would take to convert it to SDC. A few I've looked at for that effort include:
Now I'll add shoelace