Live data from Hacker News

Streaming HTML out of order without JavaScript

lamplightdev.com

11–20 of 104 posts

Re: Streaming HTML out of order without JavaScript

#11
post #4

At the core, this seems to be about shadowrootmode=open, a new html feature which already landed in Chromium and Safari: This is and sunny funny renders as: This is funny and sunny So it looks like HTML got a bit of a native template system now. What I have been wanting for decades is a native template system in HTML which supports urls. Similar the the script tag, but which loads html: I always wondered why this was…

This looks exactly like svelte named slots syntax: https://blog.logrocket.com/comprehensive-guide-svelte-compon...

Re: Streaming HTML out of order without JavaScript

#12
post #4

At the core, this seems to be about shadowrootmode=open, a new html feature which already landed in Chromium and Safari: This is and sunny funny renders as: This is funny and sunny So it looks like HTML got a bit of a native template system now. What I have been wanting for decades is a native template system in HTML which supports urls. Similar the the script tag, but which loads html: I always wondered why this was…

The "template" use case was a very common one from iframes/framesets in the early 2000s, and the markup often looked a lot like your desired example.

My memory's hazy, but I remember it becoming more and more complex to maintain as the web's security and performance model evolved, as you needed to manage and secure all of these disparate, discrete DOM trees in the same page context.

Wouldn't what you suggested just been "reinventing" frames/framesets if you added the ability to arbitrarily pull in templates via the network?

Re: Streaming HTML out of order without JavaScript

#13
post #4

At the core, this seems to be about shadowrootmode=open, a new html feature which already landed in Chromium and Safari: This is and sunny funny renders as: This is funny and sunny So it looks like HTML got a bit of a native template system now. What I have been wanting for decades is a native template system in HTML which supports urls. Similar the the script tag, but which loads html: I always wondered why this was…

https://www.w3.org/TR/html-imports/

There are long and boring reasons why it never went anywhere.

Re: Streaming HTML out of order without JavaScript

#14
That's cool and definitely the future of HTML streaming,

it simplifies things a lot: js enabled out-of-order streaming leads to SEO problems and frameworks usually need to come up with workarounds - detect bots and turn of streaming for that case.

With such technique no workaround is needed, less things to worry about.

Excellent!

Re: Streaming HTML out of order without JavaScript

#15
post #4

At the core, this seems to be about shadowrootmode=open, a new html feature which already landed in Chromium and Safari: This is and sunny funny renders as: This is funny and sunny So it looks like HTML got a bit of a native template system now. What I have been wanting for decades is a native template system in HTML which supports urls. Similar the the script tag, but which loads html: I always wondered why this was…

It's also in firefox, at least in 123.

Re: Streaming HTML out of order without JavaScript

#16
post #4

At the core, this seems to be about shadowrootmode=open, a new html feature which already landed in Chromium and Safari: This is and sunny funny renders as: This is funny and sunny So it looks like HTML got a bit of a native template system now. What I have been wanting for decades is a native template system in HTML which supports urls. Similar the the script tag, but which loads html: I always wondered why this was…

https://www.w3.org/TR/xinclude

The W3C specced something out around 20 years ago, but browser devs are allergic to all things XML.

Post reply on HN