Most active commenters
  • rpdillon(7)
  • johnfn(4)
  • (4)
  • zelphirkalt(3)
  • hu3(3)
  • barnabee(3)

←back to thread

578 points smusamashah | 58 comments | | HN request time: 1.024s | source | bottom
1. johnfn ◴[] No.42463936[source]
I think "single HTML file" sets up a certain expectation that a five-thousand-line long HTML file with ~3500 lines of embedded JS doesn't really live up to. I mean, hey, everything can be a single HTML file if you embed the bundle inline in your HTML!

Cool project, though - don't mean to take away anything from it.

replies(14): >>42464100 #>>42464173 #>>42464210 #>>42464396 #>>42464481 #>>42464520 #>>42464775 #>>42465102 #>>42466230 #>>42466423 #>>42466472 #>>42467609 #>>42472114 #>>42474653 #
2. lelandbatey ◴[] No.42464100[source]
If I can actually hit "ctrl-s" and save it offline, that's a huge and worthwhile feature that meaningfully changes how I can interact with the project; it's not purely a fluff description.
replies(1): >>42464876 #
3. rpdillon ◴[] No.42464173[source]
I totally understand your take, but as a guy that spends most of his time on side projects working on single HTML files, I have a different perspective.

I find the totally self-contained nature of them very appealing because it travels well through space and time, and it's incredibly accessible, both online and offline.

My current side project is actually using a WebDAV server to host a wide variety of different single HTML file apps that you can carry around on a USB drive or host on the web. The main trick to these apps is the same trick that TiddlyWiki uses, which is to construct a file in such a way that it can create an updated copy of itself and save it back to the server.

I'm attracted to this approach because it's a way to use relatively modern technologies in a way that is independent from giant corporations that want to hoover up all my data, while also being easy to hack and modify to suit my needs on a day-to-day basis.

replies(8): >>42464261 #>>42464741 #>>42465036 #>>42465064 #>>42466172 #>>42468502 #>>42468962 #>>42470850 #
4. PittleyDunkin ◴[] No.42464210[source]
What about "single HTML file" sets up an expectation about size? I'm genuinely confused. They seem like nearly unrelated concepts—this isn't a project about trying to fit a kanban board into a kilobyte or anything like that.
replies(2): >>42464473 #>>42464889 #
5. ustad ◴[] No.42464261[source]
Do have a link to all the single html file apps you have in mind?
replies(1): >>42465469 #
6. pryelluw ◴[] No.42464396[source]
Typical HN passive aggressiveness sandwich. Nitpicking criticism with a half meant closing praise.

Cool comment, though — don’t mean to take away anything from it.

And Merry Christmas!

replies(1): >>42465016 #
7. crazymao ◴[] No.42464473[source]
Why mention it when any project can technically be turned into a single html file? In my opinion there is an expectation of simplicity and as a result a small size with that statement.
replies(2): >>42464892 #>>42473280 #
8. darrenf ◴[] No.42464481[source]
It sets up precisely the expectation that everything is inline, surely? How else could it be fully implemented in a single file?
9. jmilloy ◴[] No.42464520[source]
"Single HTML file" sets up an expectation to me that it is (1) browser based and (2) client-side only. In other words, you can just open the file and start going without setting up a server, setting up a database, installing anything, or even having internet access. The last is not technically required but I think it is implied. It does not imply anything about the length of the file or the presence of client-side scripting.
10. getcrunk ◴[] No.42464741[source]
This rational appeals to me strongly, especially on a primal level

But also that’s a lot of code in general

11. qwertox ◴[] No.42464775[source]
> a five-thousand-line long HTML file with ~3500 lines of embedded JS

You made me look at the code and I was afraid of what I was going to find.

But man, that code is pretty and well organized, just like the resulting page.

12. zelphirkalt ◴[] No.42464876[source]
That will probably never work easily in any secure browser. I think at the very least you would have to go: ctrl+s, dialog opens hopefully at the right directory you want to store in, enter/return.
replies(2): >>42464901 #>>42467123 #
13. johnfn ◴[] No.42464889[source]
I think there are reasonable expectations around code quality that most projects adhere to, e.g.:

- Split JS out from HTML, split CSS out from HTML

- Keep files reasonably small

So if I read "Single HTML file" I'd expect around a couple hundred lines at most, possibly with some embedded CSS.

It's kind of like saying "I've solved your problem in one line of JS" but then your line of JS is 1000 characters long and is actually 50 statements separated by semicolons. Yes, technically you're not lying, but I was expecting when you said "one line of JS" that it would be roughly the size and shape of a typical line of JS found in the wild.

replies(2): >>42465429 #>>42473257 #
14. hu3 ◴[] No.42464892{3}[source]
Turning a large project into a single HTML file results in a mess.

Very different than a project that was made to be a single HTML file from the start.

15. hu3 ◴[] No.42464901{3}[source]
Are you serious?
replies(1): >>42465644 #
16. johnfn ◴[] No.42465016[source]
Lol, I was just disappointed because I was hoping to see a kanban board fully implemented in CSS/HTML. I do also dislike when nitpicky comments like this get upvoted.
17. johnfn ◴[] No.42465036[source]
I think I'd call that "local-first" or perhaps "offline-first". I can't think of a reason why a local-first app would need to be crammed into a single HTML file, hehe. I do agree it's very cool, though!
replies(2): >>42465479 #>>42467174 #
18. swah ◴[] No.42465064[source]
tiddlywiki brings back memories ... never had been so optimistic about computers!
19. hnlmorg ◴[] No.42465102[source]
Any project can be a single HTML file, but most projects prefer not to.

Most projects prefer to have a separate database, server side rendering and often even multiple layers of compilers too.

A lot of projects even require hundreds of megabytes of language runtime in addition to the browser stack.

So a single HTML file is still unusual even if it’s something nearly any web app could technically do if they wished.

And for this reason alone, I think it’s unreasonable to have expectations of a JavaScript-less, CSS-less code-golfed HTML file. This isn’t sold as a product of the demo scene (that’s another expectation entirely). This is sold as a practical self-hosting alternative for people who need a kanban quickly and painlessly. Your comment even proves that it works exactly as that kind of solution. So having inlined JS is a feature I’d expect from this rather than complain about.

20. barnabee ◴[] No.42465429{3}[source]
IMO those expectations are not reasonable at all given the description of the software; they sound more like anti-goals.

When I see “single HTML file” it conjures up the same expectations as when PocketBase[0] describes itself as an “Open Source backend in 1 file”.

That is that I can copy that file (and nothing else) somewhere and open/run it, and the application will function correctly. No internet connection, no external "assets" needed, and definitely no server.

This mode of distribution, along with offline and local-first software, avoiding susbscriptions and third party / cloud dependencies, etc. all appeal to me very much.

So far I'm impressed, I appreciate the nice, dense and uncluttered UI out of the box and it seems to cover enough functionality to be useful. I'll definitely look out for a chance to give it a spin on something real.

[0] which I also think is great

replies(1): >>42466918 #
21. rpdillon ◴[] No.42465469{3}[source]
I'm authoring two, One that's a keyboard based mnemonic launcher for accessing various websites. It's basically a way to have your bookmarks outside of the browser and quickly accessible. The other is a tabbed markdown document that can render static copies of itself.

The two projects out in the wild that natively work with this approach are TiddlyWiki and FeatherWiki.

I see room for a lightweight version of a calendar, a world clock, and even a lightweight spreadsheet that could be useful. I also have an idea for something I call a link trap where you can rapidly just drop links in and then search and sort over them to quickly retrieve something you saw before that was interesting. Sort of like my bookmarks-outside-the-browser except more of a history-outside-the-browser.

replies(2): >>42468645 #>>42468660 #
22. rpdillon ◴[] No.42465479{3}[source]
I tried to allude to this in my response above, but the fundamental reason that they're all crammed into a single file is to make sharing really easy. This is what I meant when I said it travels well through space.
replies(1): >>42469268 #
23. lagrange77 ◴[] No.42465644{4}[source]
What's wrong with that statement? Can you access the filesystem without a dialog?
replies(3): >>42465837 #>>42465880 #>>42465976 #
24. ◴[] No.42465837{5}[source]
25. hu3 ◴[] No.42465880{5}[source]
It's pure useless pedantry. Imagine the abysmal signal to noise ratio if discussions went like that more often.
replies(1): >>42466079 #
26. rpdillon ◴[] No.42465976{5}[source]
The point is that you can save the file and then use it offline. The exact set of clicks to make that happen are completely irrelevant to the core point.
replies(1): >>42467735 #
27. bowsamic ◴[] No.42466079{6}[source]
It’s not pedantry at all, he’s highlighting a major usability issue
28. hedgehog ◴[] No.42466172[source]
Out of curiosity why WebDAV vs loading the HTML straight from disk wherever they are and having a service that's only needed to for saving changes?

Edit: I sketched out a basic version in JS + Python, it's fairly ok to use. The nice parts about this approach is the HTML files are viewable without any extra services, and the service that enables saving doesn't itself need configuration or to keep state.

replies(1): >>42468071 #
29. nkrisc ◴[] No.42466230[source]
> I mean, hey, everything can be a single HTML file if you embed the bundle inline in your HTML!

Yes, they could be. And then they would have the same super power is this file: you can put it on a flash drive and run it anywhere with no setup or installation.

replies(1): >>42467716 #
30. wolpoli ◴[] No.42466423[source]
Single HTML file conjures up memories of certain Windows software of the 90s where it's a single .exe, installer-free program. It could be copied onto a floppy and run on my school's computer.

We are definitely coming at this from a different angle.

31. gjvc ◴[] No.42466472[source]
talk about judging a book by its cover...
32. blazingbanana ◴[] No.42466918{4}[source]
> along with offline and local-first software, avoiding susbscriptions and third party / cloud dependencies

Sorry if it's a bit direct and unrelated. I've actually got a question if you wouldn't mind.

I've been in the process of creating a local-first, non-subscription based Linux/Windows application that acts as a completely local search engine for your own documents and files. It's completely offline, utlises open source LLMs and you just use it like a search, so for example "what's my home insurance policy number", "how much did I pay for the humidifier", that kinda stuff. Things where you don't know exactly where the file is, but you know what you're looking for. You can browse through the results and go direct to the document if you want, or wait for the LLM response (which can be disabled if you just want plain search) to sift through the sources and give you a verifiable answer (checks sources for matching words, links to the source directly for you to reference etc).

My question would be. If you wanted something like this, how much would you pay? I'm going with the complete ownership type model, you pay, you get the exe and that's that. You like the new features in next major release, you pay an upgrade fee or something like that, but it's a "one and done" type affair.

$10, $30, $60, $100? I want it to be accessible to many people that don't want to feed their data to big corps but I also want to be able to make a living off improving it and bringing these features to people.

I've not really worked out any of this monetary side of things, or if it's something people even want. It's something I've developed over time for myself which I think could potentially be useful to other people.

replies(1): >>42469922 #
33. Bjartr ◴[] No.42467123{3}[source]
The message you're replying to did not mean that "ctrl-s" is literally the only input, but implied the whole file saving workflow that begins with "ctrl-s". The fact that you're pointing out that the other interpretation is ridiculous is enough of a context clue to realize they're not likely to be saying that.
34. jackvalentine ◴[] No.42467174{3}[source]
Same reason excel business apps are one file - easy to move around and share without dependencies going missing!
35. romanobro56 ◴[] No.42467609[source]
I have a fully functional copy of Minecraft in a single html file
36. zelphirkalt ◴[] No.42467735{6}[source]
So when you save a document in any popular word processing program, and every time you save it, a dialog would pop up asking you where to save it ... You wouldn't find that annoying at all, do I understand that correctly?
replies(1): >>42468549 #
37. zamadatix ◴[] No.42468071{3}[source]
You can save without any services at all using the File System API https://developer.mozilla.org/en-US/docs/Web/API/File_System...

The downside is even though you know the current directory due to window.location the API is written in the way it assumes you either want a default location like "desktop" or need the user to navigate to the directory before you can do operations on it (for security reasons) even from a local context. The user needs to select the directory once per fresh page load (if you've dynamically reloaded the current content then multiple saves need only prompt once so long as you save the handle).

38. est ◴[] No.42468502[source]
shameless plug: I also made a single HTML metronome in js

https://github.com/est/metronome

39. rpdillon ◴[] No.42468549{7}[source]
Your line of questioning is based on an incorrect set of assumptions.

The number of clicks is an implementation detail. It depends on whether or not you're using the web file API, some browser download capability, a browser plug-in, a mobile app, desktop app, a webdav server, or something else.

For people trying it for the first time, they often have the experience you're describing. But for most anybody that actually picks this up and uses it on a day-to-day basis, they use something else that saves transparently and automatically.

All of this is orthogonal to whether or not it's in a single HTML file. I fear you took lelandbatey's original ctrl-s reference a bit more literally than intended, though if you want to be pedantic, I can confirm I use applications in this style all day as part of my daily workflow and I do press ctrl-s and it saves with no further interaction in fully patched versions of Chrome, Firefox, and Safari with no plugins whatsoever.

replies(1): >>42470186 #
40. ◴[] No.42468645{4}[source]
41. mikae1 ◴[] No.42468660{4}[source]
Is https://rpdillon.net/redbean-tiddlywiki-saver.html still what you're using?
replies(1): >>42471377 #
42. sdeframond ◴[] No.42468962[source]
> The main trick to these apps [...] is to construct a file in such a way that it can create an updated copy of itself and save it back to the server.

Any additional info/pointers on this ?

replies(2): >>42469318 #>>42471443 #
43. tvmalsv ◴[] No.42469268{4}[source]
I definitely get the appeal. It’s analogous to the single file executable. One file to move around, no install process needed, just grab and run. It was the main reason I used to reach for Delphi back in the day for Windows utilities.
44. ◴[] No.42469318{3}[source]
45. barnabee ◴[] No.42469922{5}[source]
Good question.

I try to avoid proprietary software when I can, so if I wanted something like this I’d definitely look for open source options first. I’ll endure a reasonable amount of setup pain as long as the solution is what I’m after to go the open source route over a proprietary app.

For example, your idea seems to sit somewhere between Alfred (which I’ve bought every upgrade/ultimate pack/whatever for) or Raycast, and an LLM augmented search of a NAS / “personal cloud” server. So assuming I wanted it, if there was no neat and self contained open source solution, I’d probably try to cobble something together with Alfred, Ollama, Open WebUI, etc. (all of which I already run) plus some scripts/code first, too.

That said, for a good, feature-full local/self hosted solution that does exactly what I want in the absence of an open source option (or if it’s just much better in significant ways), I’m generally willing pay between $20–$100 per major release (for ex. I pay around that for e.g.: Alfred, the Affinity apps). For this I suppose $30–50 if it was pretty slick and filled an important niche. (I have paid more a handful of times in my life, usually for very specific use cases or if it helps me professionally, but not very recently.)

However, if a nice (or very promising and exciting to me), well maintained open source (GPL/MIT/Apache/BSD type license) solution does [most of] what I want and it’s something I really use (and a smaller project[0]) then I donate $10–30 per month (ex.: Helix, WezTerm). I sometimes do smaller or one-off donations, etc. for stuff I use less but appreciate.

That is, I intentionally pay more for open source I care about, and would humbly suggest considering that option for your project. Though I recognise that sustaining yourself financially that way is more than likely considerably harder, even with my small personal attempt at creating incentives for the world I want to see :)

NB: I do not buy subscription software unless it comes with a genuinely value added service (storing a few MiB on the devs cloud service doesn’t count) or access to data, for instance detailed snow/weather forecasts, market data, an advanced AI model (though my admittedly relatively minimal LLM use is currently >95% local and free/“open source” models).

[0] I don’t give money to the Linux kernel devs, etc. as I don’t think it’s likely to has as much positive impact

replies(1): >>42472454 #
46. zelphirkalt ◴[] No.42470186{8}[source]
Would you be so kind to share how you manage to get them to save without further interaction? That would really add usability. Maybe I did take the ctrl+s too literally, but being pedantic was not my intention. Merely hinting at this usability issue. So a solution would be very welcome.

(And I am not the one downvoting you, in fact I couldn't even.)

As an aside: I do find these applications very interesting and am considering to make use of Nullboard myself, but also am weighing it against simply using org mode in Emacs and am looking for any advantage it might offer. Of course the ctrl+s issue plays a role there as well.

replies(1): >>42473302 #
47. dogtierstatus ◴[] No.42470850[source]
> construct a file in such a way that it can create an updated copy of itself and save it back to the server

Is there some way to accomplish this through GitHub? Like the single html file running on GitHub.io pages can commit the changes to its repo?

replies(1): >>42473957 #
48. rpdillon ◴[] No.42471377{5}[source]
I've been working on projects like this for some time and that particular project happened to make the Hacker News front page but was not the client files that I'm referring to here, but rather a server. It was a side project to play with a redbean, since I'm a fan of jart's work.

My primary saver is a Python script that I wrote called Notedeck, but I also sometimes use a Rust webdav server called dufs.

I haven't released either of my projects I'm working on that are the client files, otherwise I would have just linked them.

49. rpdillon ◴[] No.42471443{3}[source]
Yes, I have done a lot of analysis on the structure of tiddlywiki and featherwiki to figure out the right way to do this in a more repeatable way. And that's the basis that I'm using for the projects I'm working on. I'm planning to write a blog post on this soon because I've learned a lot. So stay tuned.

For the benefit of the Hacker News audience that are curious, let me take a stab here.

The general strategy is to include JavaScript in the HTML document that knows how to look at various nodes in the DOM and create a new version of the document that uses an updated set of data.

Some sections of the data can be pulled verbatim. So, for example, if you have one giant script at the bottom of the doc, you can give it an ID of perhaps S, and then use that ID to retrieve the outer HTML of that script tag and insert it into the clone.

Other areas of the DOM need to be templated. So for example, I insert a script that is of type JSON, and that contains all of the data for the application. This can be pulled and stringified when creating the clone.

For a minority of attributes like the title and document settings like whether or not you're in light or dark mode, you want to avoid a flash of unstyled content and so you actually templatize those elements so they are written into the cloned copy with the updated data directly inline.

There's no real magic to it, but it can be a little bit tedious. One really interesting gotcha is that the script tag is parsed with higher precedence than quote tags. And so I have to break up all script tags that appear in any string that I'm manipulating so that the parser does not close out the script I'm writing.

I have a very minimal app that uses this technique called Dextral. I'll be happy to host it on my site and link it here.

50. edmundsauto ◴[] No.42472114[source]
I disagree - there is value in single file versus multiple file, even if the LoC are exactly the same.

It’s one reason Mac Apps get bundled as a single “file” from the user perspective. You don’t have to “install”, you just copy one file with everything. It’s a simpler dev experience.

Sure there are tradeoffs, but that’s great! We should accept that tradeoffs mean people can chose what works best for their specific context, rather than “best practices” which are silly.

51. blazingbanana ◴[] No.42472454{6}[source]
Thank you so much for taking the time to write such a detailed reply, it's given me a list of things to think about and it's honestly really appreciated. Completely understand the open source side of things and avoiding proprietary tech, I'm exactly the same and only standing on the shoulders of other open source software. I'm utilising SQLite and FAISS, so just files on disk that technically _any_ frontend or whatever could display, it's your data to do what you want with.

Not heard of Alfred as I'm not in the Apple ecosystem, but yes, you've hit the nail on the head between the combination of both after doing a bit of digging.

I'll seriously think about making it open source (time to brush up on the different licenses again). I want to keep it accessible so even my grandma could use it. I'm not expecting her to go cloning a git repo and checking dependencies etc, so I'm packaging it into a standalone executable. Maybe making the source open is something for me to consider and people can just pay if they don't want to go through any setup hassle (do I put some soft donation paywall up with a $0 minimum or something - just thinking out loud).

In terms of pricing, you've landed where I was thinking, maybe more towards the $30 end. I mean I think it's pretty slick and fills a niche, but I'm conscious I may be ever so slightly biased. A lot of stuff to mull over. Thanks again, really useful.

replies(1): >>42474559 #
52. pseudosavant ◴[] No.42473257{3}[source]
You see "single HTML file" and think "split JS out, split CSS out"? Did you not see that it was single file?? The title of this wasn't "hundred file React app".
53. pseudosavant ◴[] No.42473280{3}[source]
The simplicity isn't in editing it, which most users never will do. It is in that you can drop a single file anywhere and not worry about its dependencies.
54. Ray20 ◴[] No.42473302{9}[source]
I think via something like this:

https://developer.chrome.com/docs/capabilities/web-apis/file...

55. wizzwizz4 ◴[] No.42473957{3}[source]
You should be able to use the Smart HTTP protocol with HTTP Basic Auth (https://git-scm.com/docs/http-protocol) to push a locally-created commit. Forgejo supports CORS here, but I don't know whether GitHub does.
replies(1): >>42475274 #
56. barnabee ◴[] No.42474559{7}[source]
Thanks for taking the time to think about these things upfront rather than just cynically chasing money like 99% of paid/monetised apps out there.

It will greatly increase the attractiveness of your software to me if you stick to the philosophy you’ve outlined there.

One approach that I’ve seen and have absolutely no issues with (in fact I think it’s a pretty smart way of doing things) is where a fully open source project provides code and releases on GitHub and in package managers like Homebrew, but also publishes releases as paid software on app stores.

This allows users to pay for the peace of mind of a “verified” app store install that Just Works. It also provides an easy way for the more technical among us to donate. I’ve switched to paid releases like this myself for a least a couple of fully open source projects just to give a little back.

57. ◴[] No.42474653[source]
58. mdaniel ◴[] No.42475274{4}[source]
Both GitHub and GitLab have killed http basic auth https://docs.github.com/en/rest/authentication/authenticatin... https://docs.gitlab.com/ee/topics/git/troubleshooting_git.ht...

That's not to say one couldn't still do what you're describing via other headers, I'm just saying "<input name=username><input name=password>" won't get it done