Live data from Hacker News

Macaroni – a single HTML file messenger

github.com

71–80 of 93 posts

Re: Macaroni – a single HTML file messenger

#71
post #63

I wonder why this type of deployment is not more popular - pushing all resources inside a single HTML file, with a script tag, and inline resources as blobs.

I've been trying to advocate for Single File Web Apps. I even tried to create a wikipedia page ( https://en.wikipedia.org/wiki/Draft:Single_File_Web_Apps ), but it keeps getting rejected. I created a couple Single File Web Apps: https://fuzzygraph.com and https://hypervault.github.io/ .

1. Start an SFWA competition as a joke. Then watch the submissions come in. First year it will be a handful. Second year it will be heavy.

2. Publish sfwa articles on wikia. Blog the development process.

3. A show page for sfwa creations.

Maybe the ideas above should be in reverse order?

Re: Macaroni – a single HTML file messenger

#72
post #53

Earlier quoted context omitted.

It's very impractical. - you get a slower first load (cannot progressively fetch resources as they're needed) - can't reuse a stylesheet, script or image on a different page (each has to have their own copy) - can't cache commonly used files - can't make granular changes to specific parts of the code. user has to reload everything each time. - can't set a proper content security policy And many more! It's cool for a…

This is an example of a single html-file that I serve: https://basketball.4e4.in It weighs in at around 30 KB including a favicon, and it's quite functional.

Nice. Is the spacing like this on your end? Some overlap- https://i.ibb.co/3m9JKmC1/Clock-Alignment.jpg

Re: Macaroni – a single HTML file messenger

#73

"Sending a message to your mother should not require infrastructure comparable to a small bank." To that end, requiring the use of GitHub for your application to work is a dead end. "Macaroni Messenger is a distributed messaging system" No. "The backend does not exist." Unless by "backend" you mean the underlying infrastructure and server logic you've made the clients depend on for the exchange of messages to happen.

torrents need trackers but we still consider them peer to peer crypto needs nodes but we still consider them decentralized direct tcp/ip communication still requires routing but etc

> torrents need trackers but we still consider them peer to peer

false. there's DHT and we sometimes exchange magnet links with friends and trackers are optional. trackers just allow it easier and at scale.

> crypto needs nodes but we still consider them decentralized

It's only decentralized when somebody doesn't get to control enough nodes. Even if it was decentralized, it's apples to oranges. It's not serverless or peer to peer and this messenger is not distributed.

Re: Macaroni – a single HTML file messenger

#74
post #63

Earlier quoted context omitted.

I've been trying to advocate for Single File Web Apps. I even tried to create a wikipedia page ( https://en.wikipedia.org/wiki/Draft:Single_File_Web_Apps ), but it keeps getting rejected. I created a couple Single File Web Apps: https://fuzzygraph.com and https://hypervault.github.io/ .

1. Start an SFWA competition as a joke. Then watch the submissions come in. First year it will be a handful. Second year it will be heavy. 2. Publish sfwa articles on wikia. Blog the development process. 3. A show page for sfwa creations. Maybe the ideas above should be in reverse order?

I have an article on sfwa's here: https://gods.art/articles/single_file_web_apps.html. Still hasn't been enough to get past the wikipedia pedants.

Re: Macaroni – a single HTML file messenger

#75

Earlier quoted context omitted.

You just described the Macaroni plugin system — plugins are literally appended as tags before the closing tag.

Note that you don't actually need a closing tag.

The closing tag is mandatory because Macaroni Messenger plugins are inserted immediately before it. This is the convention defined by the plugin system.

Re: Macaroni – a single HTML file messenger

#76

"Sending a message to your mother should not require infrastructure comparable to a small bank." To that end, requiring the use of GitHub for your application to work is a dead end. "Macaroni Messenger is a distributed messaging system" No. "The backend does not exist." Unless by "backend" you mean the underlying infrastructure and server logic you've made the clients depend on for the exchange of messages to happen.

Saying that this doesn't use a backend is like saying serverless app doesn't run on a server

...and that's why I've always hated that name

Re: Macaroni – a single HTML file messenger

#77
post #65

Earlier quoted context omitted.

If you need a build script, your app is probably too big to be a single .html already. > You can still cache the HTML. But then any time you update any part of the app, the user has to re-download the whole thing. It is also a problem with many traditional frontend builds, but if you carefully split it into chunks, you can update parts of the app while most of it stays cached. See e.g. Linear’s approach to vendor dep…

https://fuzzygraph.com is a 1.4Mb Single HTML file that I have a build script for ( https://github.com/calebmadrigal/fuzzygraph ).

Alright, this is pretty cool. I don’t see any reason for it to be a single-file web app, though!

Going through your article on the topic [0], I think the only strong point that SFWAs have which SPAs don’t is: “you can download and run them completely offline”. This highlights the best use case for SFWAs – it is something that you might want to download and run offline. Hypervault [1] is a better example here, IMO.

SFWAs do have drawbacks, mainly the inability to cache things independently (it’s all-or-nothing), or to download things in parallel. So basically it boils down to two questions:

• Is my app something users would want to run offline?

• Will I update it frequently enough for the cache problem to matter?

And it’s up to you to find the balance here.

[0]: https://gods.art/articles/single_file_web_apps.html

[1]: https://gods.art/articles/single_file_web_apps.html#hypervau...

---

Actually I’ve just thought of something.

If it still makes sense to distribute your app as an SFWA, but you have to use a bundler, you can have the best of both worlds by making two builds: one as an SFWA, and one as a “traditional”, chunked static SPA. It should be fairly easy (just make two different configs, building from the same source).

Re: Macaroni – a single HTML file messenger

#78
post #65

Earlier quoted context omitted.

https://fuzzygraph.com is a 1.4Mb Single HTML file that I have a build script for ( https://github.com/calebmadrigal/fuzzygraph ).

Alright, this is pretty cool. I don’t see any reason for it to be a single-file web app, though! Going through your article on the topic [0], I think the only strong point that SFWAs have which SPAs don’t is: “you can download and run them completely offline”. This highlights the best use case for SFWAs – it is something that you might want to download and run offline. Hypervault [1] is a better example here, IMO. SF…

The biggest thing for me is how durable it is as an SFWA (avoiding software rot)

Re: Macaroni – a single HTML file messenger

#80

This is not a bad idea ... for public team communication. This pretty much solves the "Discord is not documentation" and the dataloss in forum problems. If the communication was stored in the same place as the repostory, you are guaranteed to have saved and searchable messages. As a side-effect, AI can read all the past discussions for better "1000% vibecoding"

You might find this branch interesting:

https://github.com/vanyapr/makaroshki/tree/macaroni

Turns out the messenger wasn’t enough, so now it also stores its own lore.

Post reply on HN