Figure out how we want to incorporate web components in Drupal 10

Created on 30 August 2021, over 3 years ago
Updated 14 April 2023, almost 2 years ago

Problem/Motivation

Drupal 10 will not support IE 11. That means that it will now be possible to use web components within Drupal without polyfills.

Some opportunities and questions presented by that:

  • Where does it make sense to use web components within Drupal core? One example is that Shadow DOM can help us with #2195695: Admin UIs on the front-end are difficult to theme . Another example might be to use web components as a better implementation of Drupal render system placeholders, per As an alternate to BigPipe, add a PlaceholderStrategyInterface implementation that renders placeholders as web components Active . Where else?
  • What do we want to add to core to better support front-end developers and/or site builders in adding web components to their sites? For starters, how do we want site builders adding a web component's JS code to their site? Libraries API and Component are two current ways, and there are likely others. Do we want core to provide an implementation of one of those or something else?
  • Besides adding the JS library of the web component, how else do we want to expose that component to the site builder to use? For example, do we want to automatically provide blocks for some web components (that's what the Component module does)? Do we want to automatically make a CKEditor toolbar button for adding that web component available to be added to a text format's CKE configuration? What else?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🌱 Plan
Status

Postponed

Component

Idea

Created by

🇺🇸United States effulgentsia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States cosmicdreams Minneapolis/St. Paul

    Hey gang, if Add Single Directory Components as a new experimental module Fixed becomes an experimental module for Drupal 10.1, would it be appropriate to revisit this question? I haven't spent a lot of time reading through / understanding the feature, but my read of the issue thread is making me hopeful that we might have support for ANY kind of component in core, including Web Components.

  • 🇺🇸United States cosmicdreams Minneapolis/St. Paul
  • 🇺🇸United States cosmicdreams Minneapolis/St. Paul

    Last year, I built a fun but complex web component that would be a good test of single directory components / storybook integration and the whole stack of concerns.

    pokemon-card

    The challenge ahead

    • Can we parameterize inputs like type of Pokemon?
    • Can we support external libraries like svelte / lit without loading them once per component
    • Does SDC support work for various ways a component can be implemented? Svelte / Vue / lit / vanilla (just off the top of my head)
    • And how does implementing the component work for frontend devs
Production build 0.71.5 2024