Live data from Hacker News

Web apps in a single, portable, self-updating, vanilla HTML file

hyperclay.com

171–180 of 240 posts

Re: Web apps in a single, portable, self-updating, vanilla HTML file

#171
post #5

This is coming close to WWW's original vision because the very first web browser was also an editor. Tim Berners-Lee's application on the NeXT was basically a wrapper for the operating system's built-in rich text editing class named TextView. (It later became NSTextView on Apple's Mac OS X and still powers the TextEdit app on Mac.) We lost editing for two reasons: 1) The HTTP PUT method didn't exist yet, so edited HT…

Saving files locally was the same as saving files on the web in the original TBL context.

Imagine having a nice UNIX workstation on your desk at a university. This would resolve to machine.department.university.ac.uk rather than be hidden behind a router. If you wanted then you could run an x window on it or transfer files to and from it.

With standard issue Netscape of the era you could save an HTML file locally and it be fully accessible anywhere on the web.

The university would have the skills to setup the network for this, which was a difficult skill at the time.

In reality you would not save everything locally. The main department server would have a network share for you that would be mounted with NFS. So your files would be 'saved locally' over the NFS share to resolve to department.university.ac.uk/user.

You could also login to any workstation in the department for it to mount your NFS shares, with PCs of the era usually capable of running x windows and NFS in the university setting.

Servers physically existed in the server room rather than in the cloud.

I much preferred this model as, on SGI workstations, you had it all working out of the box. All you needed was some help with the networking.

Also important is that the web was originally all about structuring information rather than hacking it to make it pretty. It was up to the client to sort out the presentation, not the server.

In time we lost the ability to structure information in part because the 'section' element did not make it into HTML. Everyone wanted the WYSIWYG model that worked with word processors, where it was all about how it looked rather than how it worked.

We proceeded to make HTML that started as a soup of nested tables before the responsive design people came along and made that a soup of nested div elements.

Eventually we got article, section and other elements to structure information, but, by then it was too late.

It is easy to design something that is incredibly complicated and only understood by a few. It is far harder to design something that is simple and can be understood by the many.

We definitely lost the way with this. Nowadays people only care about platforms such as social media, nobody is writing HTML the TBL way, with everything kept simple. HTML has become the specialist skill where you need lots of pigeon holes skills. Nobody on these teams of specialists have read the HTML spec and no human readable HTML gets written, even though this is fully doable.

It seems that you are one of the few that understands the original context of HTML.

Re: Web apps in a single, portable, self-updating, vanilla HTML file

#172
I am trying to figure this out. The writer despairingly says a backend is needed to store changes in state. The writer calls this backend DB and API. The writer then substitutes DB and API with "server" like it is a solution

So now we have a webapp. The webapp connects to a backend. The webapp stores changes in the backend. The webapp loads changes in the backend.

The original problem still persists?! State can be stored in browser with localstorage. Or in device with file access. That is about it. Across devices, you need online storage and access key.

I feel like this was a writeup on the problem with vanilla HTML app development.

Also, can we all agree that calling a webpage an app is an afront to all webpages? We should have two categories: webpages and webapps. A web page can contain a webapp. A web app is anything where the content changes and where it connects to a backend to store or load data. So interactive html stuff is not a webapp, but JS literally changing the data makes it a webapp, even a simple HTML page with a JS clock makes that portion of the page a webapp.

Re: Web apps in a single, portable, self-updating, vanilla HTML file

#173
post #116
post #35

For people who are confused: Hyperclay is a NodeJS server and frontend JS library that allows HTML pages to update their DOM and then replace their own .html source with the updated version. Imagine clicking a checkbox, which adds the `checked` attribute to its element, then using Hyperclay to globally persist this version of `document.body.outerHTML`, so that it's there next time someone visits the page. There's aut…

Thanks. Author mentioned TiddlyWiki as inspiration. But the whole point of TiddlyWiki was that it doesn't need a server right? So I'm trying to understand the difference, the payoff. I understand that local web APIs are ass and you very quickly run into the need for a server. But I'm wondering about the utility of combining the two approaches. It seems like a contradiction in terms. Here's a server to help you with y…

Turns out, the original TiddlyWiki used a java jar to handle the file persistence. (I remember it being so magically automatic, but recently investigated how it was done)

Re: Web apps in a single, portable, self-updating, vanilla HTML file

#174
post #31

Earlier quoted context omitted.

> web browser was also an editor Ummmm all the browsers I know of are also editors... Are there any that aren't? Edit - does no one use dev tools anymore? No HTML? No vanilla JS and CSS? Everyone just using TS, React and gluing things together? Like, you literally have an entire IDE in your browser (assuming you use anything derived from Chrome, Firefox or Safari) that can code a web page live...

DevTools was not part of the original browsers. Firebug brought the concept to existence in the first place. As a sidenote, does manipulating forms count as editing?

Netscape had editing tools. Firefox has editing tools. Chrome has editing tools. I think Safari does too?

Like, Netscape Composer came OUT of Navigator...

Re: Web apps in a single, portable, self-updating, vanilla HTML file

#175

Earlier quoted context omitted.

> web browser was also an editor Ummmm all the browsers I know of are also editors... Are there any that aren't? Edit - does no one use dev tools anymore? No HTML? No vanilla JS and CSS? Everyone just using TS, React and gluing things together? Like, you literally have an entire IDE in your browser (assuming you use anything derived from Chrome, Firefox or Safari) that can code a web page live...

You're describing built-in developer tools for editing local files during development. The comment you're replying to is describing the vision of a browser which can edit remote files as part of the normal user workflow, not as a developer-only activity.

NeXT machines were hardly mass market user machines... They were almost exclusively developer machines.

Also Chrome does have stuff like SSH extensions.

That being said, some of the computing paradigms of the 80's and early 90's were very cool and I wish they caught on... Lisp machines, Smalltalk, early web ideas were interesting...

Re: Web apps in a single, portable, self-updating, vanilla HTML file

#176
post #116
post #35

For people who are confused: Hyperclay is a NodeJS server and frontend JS library that allows HTML pages to update their DOM and then replace their own .html source with the updated version. Imagine clicking a checkbox, which adds the `checked` attribute to its element, then using Hyperclay to globally persist this version of `document.body.outerHTML`, so that it's there next time someone visits the page. There's aut…

Thanks. Author mentioned TiddlyWiki as inspiration. But the whole point of TiddlyWiki was that it doesn't need a server right? So I'm trying to understand the difference, the payoff. I understand that local web APIs are ass and you very quickly run into the need for a server. But I'm wondering about the utility of combining the two approaches. It seems like a contradiction in terms. Here's a server to help you with y…

How would TiddlyWiki write to filesystem (save) without a server?

I thought opening index.html in the browser was basically just a demo.

Re: Web apps in a single, portable, self-updating, vanilla HTML file

#177
post #137

Earlier quoted context omitted.

A significant hindrance for generator-type apps is that only pages loaded via HTTPS have access to the clipboard API, so ”copy to clipboard” does not work via file:///. You can have a zero-build zero-dependency offline-only app which users could theoretically just save as a page, but copy buttons will not work, so you have to detect the API not being available and replace buttons with popover textareas. Clunky. As fo…

Chromium based browsers treat localhost as a secure context, so HTTPS isn't required to access APIs like the clipboard, web serial, etc.

Not just localhost, but *.localhost too. It's not just Chromium, it's a standard that Firefox supports too (Safari as usual is kind of spotty): https://www.w3.org/TR/secure-contexts/#is-origin-trustworthy

Re: Web apps in a single, portable, self-updating, vanilla HTML file

#178
post #116
post #35

For people who are confused: Hyperclay is a NodeJS server and frontend JS library that allows HTML pages to update their DOM and then replace their own .html source with the updated version. Imagine clicking a checkbox, which adds the `checked` attribute to its element, then using Hyperclay to globally persist this version of `document.body.outerHTML`, so that it's there next time someone visits the page. There's aut…

Thanks. Author mentioned TiddlyWiki as inspiration. But the whole point of TiddlyWiki was that it doesn't need a server right? So I'm trying to understand the difference, the payoff. I understand that local web APIs are ass and you very quickly run into the need for a server. But I'm wondering about the utility of combining the two approaches. It seems like a contradiction in terms. Here's a server to help you with y…

Thanks. Author mentioned TiddlyWiki as inspiration. But the whole point of TiddlyWiki was that it doesn't need a server right?

I did a deep dive on TiddlyWiki recently. No, it doesn't need a server; an entire site can be self-contained in one HTML file.

If you want to run it as a multiuser, web accessible wiki, it runs on top of NodeJS.

Re: Web apps in a single, portable, self-updating, vanilla HTML file

#180
post #35

For people who are confused: Hyperclay is a NodeJS server and frontend JS library that allows HTML pages to update their DOM and then replace their own .html source with the updated version. Imagine clicking a checkbox, which adds the `checked` attribute to its element, then using Hyperclay to globally persist this version of `document.body.outerHTML`, so that it's there next time someone visits the page. There's aut…

If I need a server to run this then surely I can use sqlite and save different versions of the page without overwriting the html page every time.
Post reply on HN