Live data from Hacker News

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

hyperclay.com

181–190 of 240 posts

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

#181
post #11

Earlier quoted context omitted.

You mean HTTP auth?

No, specifically not. I don't want to store your username and passwords in a database (and then deal with account recovery, password rotation, etc) - I want identity . The browser should be able to vend me an (opaque, anonymous) token that identifies you as an individual. If your mobile and desktop browser vend the same token, then the website sees you as having the same identity on both platforms.

The privacy implications of this are a deep and toxic swamp into which every previous attempt has sunk. Right now, control over an email account is the best we've got.

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

#182
post #116

Earlier quoted context omitted.

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.

iirc browsers used to allow direct filesystem access.

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

#183
post #116

Earlier quoted context omitted.

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.

TiddlyWiki can replicate itself. All users can freely edit any TiddlyWiki and save their changes to their filesystem. There's a few options for exports.

It is a common gotcha that new users will lose some of their work while they learn persistence.

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

#184
post #170
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…

I'm still confused - if it requires a NodeJS server, then it wouldn't be a fully self-contained HTML file would it?

[dead]

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

#185
post #116

Earlier quoted context omitted.

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.

Tiddlywiki has two modes of running. In one, you simply save the file as HTML and all your content is saved inside the file.

The other mode is with a nodejs server (it's what I'm using). This allows me to access the wiki from all devices.

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

#186

This is a really cool idea. The use of custom attributes without `data-` before it makes me a little nervous. Is that a concern here? I saw `project` being used on elements and if that's officially used for something eventually can it muddy things up?

HTML5 is surprisingly lax about using arbitrary attributes and tags: any attribute or tag without a dash in it could potentially conflict with a future version of the spec, but it doesn't go out of its way to forbid them either. data-* attributes are special in that they appear in the .dataset property in the DOM, but anything with a dash should be future-proof against the HTML spec.

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

#187

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 st…

"Malleable" apps. Meaning the HTML file serving the webapp itself gets modified. Ok.

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

#188
post #185

Earlier quoted context omitted.

How would TiddlyWiki write to filesystem (save) without a server? I thought opening index.html in the browser was basically just a demo.

Tiddlywiki has two modes of running. In one, you simply save the file as HTML and all your content is saved inside the file. The other mode is with a nodejs server (it's what I'm using). This allows me to access the wiki from all devices.

I see, so you make edits, the Javascript edits the html, therefore File -> Save Page will download an html file with your changes in it that you can open again.

I forget that File -> Save is even a thing for websites.

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

#189
I am not sure how this proposal deals with the problem of templating. If you have a bunch of documents (say, blog articles) that should have a consistent layout, you are going to want to create a template for them. But then the document you see isn't the "true" document, and in order to save the content you're going to have to annotate it to "reverse" the templating.

If it does this, then it is very exciting indeed, but I could not see it.

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

#190

Been doing something similar with save files for my game. Line 1 is " const rawData =" and line 2 is all the state. Then the save button downloads document.documentElement.outerHTML with line 2 replaced by the current state. No server required. https://github.com/mcteamster/white/blob/main/src/lib/data.t...

I am trying something similar: I made game as a standalone HTML file with a feature that allows users to edit text and save as a new local version. Works on my phone (Android with Brave) but not on iOS with Safari.
Post reply on HN