Live data from Hacker News

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

hyperclay.com

131–140 of 240 posts

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

#131

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…

> As for running a local server, VS Code devcontainers are the solution. Open your workspace, it runs the devcontainer, and you have a server up without extra hassle it's not easy to install VS Code, let alone use it. VS Codium (and VS Code) are Electron apps, and it is difficult to sandbox them, as Electron (and Chromium as well) use suid helper - a priviledged binary that launches as root, and I won't allow suid bi…

Maybe you can associate html files with or use open with to pass them into a script that calls python -m http.server and creates and opens a url to the file via the python server in the browser.

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

#132
Initiatives like this that makes creating web pages more direct are great!

I've done something similar using IPFS for persistence [1]. The format is different - it's a tutorial starting out with the dev tools that guides you to build an editor + site.

I wish that IPFS was more usable and mature as a general web technology! I've considered trying this with Git as the backend, but I haven't done much research into what the tradeoffs or complications would be?

[1] - https://www.thebacklog.net/projects/agregore-web-apps/

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

#133

Earlier quoted context omitted.

> As for running a local server, VS Code devcontainers are the solution. Open your workspace, it runs the devcontainer, and you have a server up without extra hassle it's not easy to install VS Code, let alone use it. VS Codium (and VS Code) are Electron apps, and it is difficult to sandbox them, as Electron (and Chromium as well) use suid helper - a priviledged binary that launches as root, and I won't allow suid bi…

> but you need to open a terminal and navigate to a directory first, that takes lot of time It does?

It does, given that I don't always remember the path to the app. Also, on my Linux system the terminal doesn't remember windows and tabs and I have to open them all manually after reboot (I could ask ChatGPT to write a script for that but it would be easier if I hadn't to).

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

#135
I spent a weekend making a self-host twitter alternative.

source: https://github.com/est/gitweets/

demo: https://f.est.im/ (renders via github API)

Basically it renders its self git repo commit history as a feed timeline.

Never lose your data on microblogging service providers again! Clone the repo anywhere anytime, make tweets by "git commit --allow-empty".

Everything is placed inside a single-html.

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

#136

Earlier quoted context omitted.

There is an open source, local app version by the same author (me) here: https://hyperclay.com/hyperclay-local

fwiw, for this kind of tech - personal level projects - there is not a snowball's first summer outing in hell's chance I'm going to pay for someone else to host my thing remotely. I would like to just self host, and if it was good I would buy a license for it so I can self host - but I think you have a customer in mind that doesn't exist. Your ideal customer a) is extremely technically proficient, such that they are…

I think you're underestimating the market here. It's not just extremely technically proficient people, it's the glitch people, the "custom myspace theme" people, possibly even the jsfiddle people.

The `/save` endpoint looks almost trivial. Knocking up a mimic wouldn't take much. The client libs will be interesting, but from the looks of things they're not quite there yet.

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

#137

I would like web standards have better support for pages stored in a local file (opened using file:// protocol). Sometimes I write simple HTML/Vue based mini-apps for myself and every time something doesn't work and I need workarounds, for example: - local HTML file cannot import local JS modules, so I have to use legacy writing style - local HTML file cannot open other local files (for example, audio files) I unders…

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.

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

#139

I would like web standards have better support for pages stored in a local file (opened using file:// protocol). Sometimes I write simple HTML/Vue based mini-apps for myself and every time something doesn't work and I need workarounds, for example: - local HTML file cannot import local JS modules, so I have to use legacy writing style - local HTML file cannot open other local files (for example, audio files) I unders…

The local html file can read local resources via src=file_path attributes on html tags (img, audio, video, script etc).

But the src-included files must be in the same directory as the root html file (or a descendant directory)

I used this in my macOS app Pocket Log to output a local html audio log (https://enzom.dev).

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

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

To be completely honest, I don't see how this is more useful than adding a sync layer to localStorage. I did make a service that does that at htmlsync.io and am genuinely curious how this solution is better.
Post reply on HN