Live data from Hacker News

Streaming HTML out of order without JavaScript

lamplightdev.com

21–30 of 104 posts

Re: Streaming HTML out of order without JavaScript

#21
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...

SPA like React, Vue, Angular, Svelt, solid, should be not needed if HTML implemented these features. Or make JSX a standard again such as E4X.

Re: Streaming HTML out of order without JavaScript

#22
post #17

[flagged]

The Javascript code in the article is server-side and not essential - it's just one way to take advantage of open shadowrootnodes and it could be written in PHP or anything else. It's showing how you can output your HTML in a very different order, with arbitrary delays, and still get the page layout you expect.

Re: Streaming HTML out of order without JavaScript

#23
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 last example reminds me of the once-proposed html imports feature. It was being pushed by Google back when Polymer was a thing and would've given us actual web components delivered as html documents with full support for html, css, and js just like we use normally. If I remember correctly there were a few issues with the approach that needed to be resolved and nobody stepped up to make it a reality. So instead we…

In the end it was only Firefox who implemented HTML Imports, and Google has gone mad and pushed everything in to Javascript.

Re: Streaming HTML out of order without JavaScript

#24

Earlier quoted context omitted.

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

SPA like React, Vue, Angular, Svelt, solid, should be not needed if HTML implemented these features. Or make JSX a standard again such as E4X.

All of the libraries you’ve listed offer features above and beyond what we’re talking about here. Plus, web components exist, they do most of it and yet the libraries still exist.

Re: Streaming HTML out of order without JavaScript

#25
post #19
post #3

[flagged]

There are things that are slow that can't be made to be fast. And there are even more that CAN be made fast but only at extreme cost.

Let's come back to this once we've stopped writing software that is 90-99.9% waste (in round trips and in cycles).

Re: Streaming HTML out of order without JavaScript

#27

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!

This might lead to SEO problems as you wont know what the SE will see rendered i it’s text only view.

Re: Streaming HTML out of order without JavaScript

#28
post #19
post #3

[flagged]

There are things that are slow that can't be made to be fast. And there are even more that CAN be made fast but only at extreme cost.

The downside here is the need to proxy everything through the same server. That will add latency and possibly throttle bandwidth if that data is coming from third parties.

The scenario where this could be good is something where there are background jobs running behind the service that would have been API-ed through the same web server anyway.

But I have an ingenious solution for the best of both worlds! An Iframe.

Re: Streaming HTML out of order without JavaScript

#30

The site loads pretty slowly for me [1], and when they site has fully loaded the list has already been completed, there is no streaming from what I can see. Is Firefox the reason here? 1. https://check-host.net/check-report/16234f41keed

It worked fine for me in Firefox.
Post reply on HN