Live data from Hacker News

Streaming HTML out of order without JavaScript

lamplightdev.com

31–40 of 104 posts

Re: Streaming HTML out of order without JavaScript

#31

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

Also for me, both on Firefox and Edge - I'm wondering if it's to do with being behind a corporate proxy that MITMs everything and might be buffering rather than passing through partial respones, or has a much higher threshold before streaming?

If that is the reason, it'll provide an (even more than usually) poor experience for those behind such a proxy

Re: Streaming HTML out of order without JavaScript

#33
post #19

Earlier quoted context omitted.

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).

I hear people complain about this a lot. But people who write software that is that efficient are 90-99% wasting their precious time on Earth.

Re: Streaming HTML out of order without JavaScript

#34

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

The site[0] works for me in Edge, and Firefox, as intended. The slow loading is the point, you should see how it updates real time, which doesn't happen to you for some reason. As other comment suggests, maybe something on your network doesn't like tiny (~42 characters) HTML fragments.

[0] : https://ooo.lamplightdev.workers.dev/

Re: Streaming HTML out of order without JavaScript

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

Yes, many frameworks including svelte took heavy inspiration from various parts of the Web Components specs, including named slots. So, this is the original thing that svelte and others copied.

Re: Streaming HTML out of order without JavaScript

#36
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…

is already there

Re: Streaming HTML out of order without JavaScript

#37
post #24

Earlier quoted context omitted.

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.

See: $ becoming querySelector.

Re: Streaming HTML out of order without JavaScript

#38
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…

I used to do a lot with Apache server side includes and always wished there was a client side option.

Re: Streaming HTML out of order without JavaScript

#39
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…

Includes are different than this. Pretend the template is site header, site nav, body content, and footer; each being a slot. The server then streams body content, site header, site nav and footer in that order. Now more important content gets rendered first without any JS.

This technique would be a lot more usable though when shadow roots become open style-able. It is kinda funky having to apply your CSS separately to the layout regions that live in your shadow dom.

Re: Streaming HTML out of order without JavaScript

#40

You could possibly do this using a flexbox? https://developer.mozilla.org/en-US/docs/Web/CSS/order

Flexbox order doesn't affect accessibility tree order, so that's bad for accessibility. DOM order should make semantic sense.

Managed tabindex would solve that. Sounds like a nightmare to maintain though.
Post reply on HN