Live data from Hacker News

Streaming HTML out of order without JavaScript

lamplightdev.com

91–100 of 104 posts

Re: Streaming HTML out of order without JavaScript

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

We had HTML imports a decade ago https://web.dev/articles/imports

This would have been better than world peace. But this threatened a lot of warmonger advertisers. So it was "deprecated" and then obliterated.

Re: Streaming HTML out of order without JavaScript

#92

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

Firefox just added support for declarative shadow dom, so that might be it if you're not on the latest version. Alternatively I could imagine some kind of proxy between you and the site buffering things up.

> some kind of proxy between you and the site buffering things up.

Yeah I think that might be it, because it works fine on FF (iOS) outside.

Re: Streaming HTML out of order without JavaScript

#93
post #85
post #16

Earlier quoted context omitted.

https://www.w3.org/TR/xinclude The W3C specced something out around 20 years ago, but browser devs are allergic to all things XML.

[flagged]

What? This feels like a largely unrelated rant.

Re: Streaming HTML out of order without JavaScript

#95

Earlier quoted context omitted.

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

There is a new reading order attribute coming to fix this.

There already is one in ARIA that supports this: aria-owns [1] and to some degree aria-flowsto [2]

But with everything in ARIA, it always depends on real-world support of screen readers, which is very poor. You have to work with what actually works unfortunately.

Imo changing order just to change the streaming order for a tiny performance gain is not worth breaking the UX for people with accessibility needs.

[1] https://developer.mozilla.org/en-US/docs/Web/Accessibility/A... [2] https://developer.mozilla.org/en-US/docs/Web/Accessibility/A...

Re: Streaming HTML out of order without JavaScript

#96

Earlier quoted context omitted.

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.

tabindex only affects tab order (of interactive elements), not the order that a screen reader navigates and reads out content (including non-interactive elements)

Re: Streaming HTML out of order without JavaScript

#97
post #71

Earlier quoted context omitted.

xslt is a native template system that has includes: xhtml/xslt still works today (though browsers are stuck on v1). It's a declarative template system with a pretty powerful pattern matching system (xpath). You can also extract fragments from external documents or store them into variables. e.g. will copy all urls from a list inside the 2nd div. Or instead of second div in the body, you could search for a div with an…

I just recently moved my personal homepage to XML + XSLT. Not a pro at it at all though. I did enjoy the process, I like the idea of building the website out of data + templates, but that's not unique to XSLT. Besides some papercuts / browser bugs like "refreshing the page desyncs the inspector", the main issue I find with it is I don't see how I can modify things dynamically? By the time JS runs, it's on the resulti…

Right, unless you run a javascript xslt processor, you can't do things after page load. There's at least one javascript implementation that lets you do data binding to do dynamic page updates, but I'm not familiar with it.

The main advantage for simple things is that you don't need an application server or compiler. It's all static files, and it's all built right into the browser so easy to get started with. For less simple things, it should be easier to cache since you can separate out user data and have the bulk of the information you send be the static template (which the user can cache).

I suppose maybe that last point is why people use javascript frameworks for static pages (so they can send a static, cached js file and then small payloads for user data), which seems like overkill to me.

It would be nice if browsers supported streaming xml. Of course streaming xml exists (e.g. XMPP). It's not really any different than json: the spec said you need to have a single root object, and then someone wrote a spec that says you don't need to do that.

Re: Streaming HTML out of order without JavaScript

#98
post #71

Earlier quoted context omitted.

I just recently moved my personal homepage to XML + XSLT. Not a pro at it at all though. I did enjoy the process, I like the idea of building the website out of data + templates, but that's not unique to XSLT. Besides some papercuts / browser bugs like "refreshing the page desyncs the inspector", the main issue I find with it is I don't see how I can modify things dynamically? By the time JS runs, it's on the resulti…

Right, unless you run a javascript xslt processor, you can't do things after page load. There's at least one javascript implementation that lets you do data binding to do dynamic page updates, but I'm not familiar with it. The main advantage for simple things is that you don't need an application server or compiler. It's all static files, and it's all built right into the browser so easy to get started with. For less…

Ok, thanks, then I'm not missing something obvious, heh.

You make a good point of caching the XSLT file itself though, I hadn't considered that. Simple server outputs XML data, browser renders into a page.

Re: Streaming HTML out of order without JavaScript

#99
post #33

Earlier quoted context omitted.

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.

My bad, I finally realized it's better to spend much more time as long as it belongs to other people.

If you go bankrupt before you even get to market, then you aren't wasting any CPU time of anyone else :P

Re: Streaming HTML out of order without JavaScript

#100
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

That's not what the op is asking for, iframes are in their own self-contained context.
Post reply on HN