[w3c/webcomponents] Serialize shadow DOM for use in javascript disabled user agents (#788)

Web components are great, but unfortunately, they makes the web unusable with user agents with javascript disabled. Mostly because custom elements and their behaviour is defined with Javascript.

In some applications where the web components are mostly static (components that defines layouts, or that are templating static data) it makes sense to allow user agents with javascript disabled to access the content.

To be able to render webcomponents user-agents with javascript enabled or disabled (both) we need a way to attach a shadow tree (computed from server-side) to a custom element in pure HTML that does not conflict with javascript-enabled user-agents.

Would it be possible to imagine something like that:

```html
<custom-element>
  <template shadow-dom>
    <p>Hello <slot name="name"></slot></p>
  </template>
  <span slot="name">World</span>
</custom-element>
```

If the `custom-element` is not declared via javascript, the user-agent knows that `custom-element` is a webcomponent (because it is multi-word) and can attach the shadow-dom template to it, without a line of javascript.

Instead, if the user-agents declares the `custom-element` through javascript, it can redefine the shadow DOM for that element, and it can continue to work as usual.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/788

Received on Wednesday, 30 January 2019 19:18:53 UTC