Re: [WICG/webcomponents] "open-stylable" Shadow Roots (#909)

Just chiming in with an additional usecase; using declarative shadow DOM, you can achieve out of order streaming of content, without the need for JS to replace content when it's ready. Here's a blogpost on that: https://lamplightdev.com/blog/2024/01/10/streaming-html-out-of-order-without-javascript/

The streamed HTML for that would look something like this:
```html
<html>
  <body>
    <template shadowrootmode="open">
      <h1>Hello world</h1>

      <slot name="id-1"></slot>

      <footer>Copyright</footer>
    </template>

    <div slot="id-1">Content loaded!</div>
  </body>
</html>
```

The downside to this is that it uses a shadowroot on the body, because you need slots for this, which then bars you from global styling. It'd be great to have _something_ like `<template shadowrootmode="open-stylable">` for this. (Or dare I say a different way to achieve composition/slot-like API without the requirement of shadow dom 🫣)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/909#issuecomment-1891551029
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/909/1891551029@github.com>

Received on Monday, 15 January 2024 08:27:48 UTC