Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support declarative Shadow DOM #602

Open
StephanSchmidt opened this issue Mar 8, 2024 · 1 comment
Open

Support declarative Shadow DOM #602

StephanSchmidt opened this issue Mar 8, 2024 · 1 comment

Comments

@StephanSchmidt
Copy link

StephanSchmidt commented Mar 8, 2024

Browsers now (or in the near future) support declarative Shadow DOM.

https://caniuse.com/declarative-shadow-dom

You can then render <slot name="content"></slot>, stream this to the client, then later stream <div slot="content">Rendered with content</div> and the browser will replace the slot with the new content without the need for Javascript.

The content could come from a Go channel e.g. reading from a database, and the page could still be sent (header, footer, nav) with the data replacing the placeholder as soon as the channel delivers results.

AJAX without Javascript for a faster Time to First Byte (TTFB).

For a demo see https://ooo.lamplightdev.workers.dev/

It's like Metas BigPipe (2010) but without Javascript

https://engineering.fb.com/2010/06/04/web/bigpipe-pipelining-web-pages-for-high-performance/

@gedw99
Copy link

gedw99 commented Mar 14, 2024

thats amazing. thanks for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants