News for hackers. Stuff that matters.
Re:Entire website in a single HTML file by dredmorbius on Thursday December 23, 2021 @11:23PM (#29670168)
SPAs display in a single HTML URL, but are themselves (typically) comprised of multiple elements, including many CSS, JS, and data elements which are fetched dynamically.

The example URL is a complete website within a single HTML document with no external dependencies and no further round-trip requests. It is a single-page site (SPS) or perhaps a multi-page file (MPF).

https://john-doe.neocities.org/

You can open that URL, disable networking, and browse the entire site to your heart's content in any browser supporting CSS.

If you open the file in a terminal browser (lynx, w3m, elinks[2], etc.), you'll see the full site presented at once, as a single page, without needing to specifically navigate between them (you can scroll the full site). Though the intra-site navigation itself still works --- it just doesn't reveal or hide sections.

Re:Entire website in a single HTML file by gigel82 on Friday December 24, 2021 @02:18AM (#29671188)
I've built React SPAs with inlined JS, CSS and SVGs in 2017, which is why I'm still entirely clueless what's special about this.

BTW, the discussed page is not at all a single-page site; it makes separate network requests for CSS and PNG files.

Re:Entire website in a single HTML file by dredmorbius on Friday December 24, 2021 @04:05AM (#29671816)
The point of this demonstration is that single-file provisioning is specifically the point. And specifically, using only HTML and CSS.

The concept of an "SPA" refers to the appearance rather than provisioning of the app, and inherently relies on Javascript (or an equivalent scripting capability) to interactively rewrite the display. It's possible to single-file an SPA. The characteristic isn't central to the SPA concept, and in practice implementation is typically anything but.

SPAs are not accessible without Javascript, and don't render at all from a terminnal / console-mode browser. (Ask me how I know this...)

This is not an app. It's a website, or at least, multiple web pages, provisioned from a single HTML file.

Yes, this instance has several external references. I've noted CSS in an earlier comment, you mention image assets. The concept could be further optimised for portability by incorporating those inline.

Note that optimisations are also trade-offs. Inlined assets would mean duplication for a larger site. Which of those trade-offs are preferable or unwanted really depends on the specific goals.

But as a demonstration of an idea, this really is pretty elegant.

Re:Entire website in a single HTML file by kome on Friday December 24, 2021 @04:36AM (#29672052)
yeah, but you missed the point.