4 ms·
I'm in love, I didn't know I wanted this, and now here it is. With an explanation from the author that touched on things I was feeling but couldn't quite but in
by cuttysnark 2y ago
I'm in love, I didn't know I wanted this, and now here it is. With an explanation from the author that touched on things I was feeling but couldn't quite but into words. To ice the cake, saved the file to disk and ran it with WiFi off, just to see. Sure enough, it's all in there, self-contained with no fetched dependencies.
One caveat being that in the file:// protocol URL params don't work e.g. ?app=c53f8e9f-4b7a-4315-bb8a-f6557f6be30b
This is fixed by running a local webserver, which isn't a huge deal. I'd be happy to learn of an easier way.
Thanks for sharing this.
- meiraleal 2y agoYeah slingcode is very cool! It is like a platform/IDE for apps similar to tiddlywiki. unfortunately it is not maintained anymore so I posted it here with the hope of finding some similar project from the community :) Or use it as a motivation to release a similar project
- chr15m 2y agoPRs welcome!
- recursive 2y agoI'm also a single file .html app distribution technology enthusiast. Query string parameters totally work from file:// I built an online sandbox that lets you create them. To prove it, you can navigate here [1], then click the "Download self-contained .html" item on the hamburger menu. [1] https://mutraction.dev/link/z8z https://mutraction.dev/link/z8z
- replete 2y agoI also like single-file offline web applications, I'm hoping they become more popular with the FileSystem/FileWriter APIs now available in Chromiums (waiting on Safari/Firefox still however). I made a really simple offline HTML app for generating EFF dice passphrases: https://github.com/replete/effindice https://github.com/replete/effindice Only thing missing really is a CLI interface. I wonder if there's a way to make HTML files executable on the command line, pass through arguments as qs params. The amount of times I make a little nodeJS app to do something with a set of files, the webserver bit seems so overkill sometimes..
- cxr 2y agoYou could literally run the Golang compiler in your browser if you wanted to (emphasis on in your browser—not deferring to a server to do the heavy lifting) without any of that stuff. A lot of the stuff that people think they need Chrome's proposed filesystem APIs for are not actually things they need. Every mainstream browser accepts directories for both type=file inputs and for drag-and-drop, and that's been the case for years. So that's a non-issue. That aside, the next thing people pretend they need it for is so their app foo.html won't fail when it tries to read and write to or from ~/.foo and /etc/foo and anywhere else the author chooses, whenever they want. But apps can and should be rewritten not to expect that kind of ambient capability. The fact that in-browsernapps can't do that stuff is a good thing. There's usually nothing stopping the author from refactoring their program to either output a single binary file or .txt or whatever the main thing is that the program is supposed to output, or if the purpose is to write out multiple assets, then output a composite file format like ZIP or tar. I mean owing to its history and the context when it was created, the ZIP format already supports archives spanning multiple volumes/files. And that gets you automatic support for file versioning for free! It's the exact same version control strategy that Git uses and proved is viable: full-content snapshots—the difference being if you're doing ZIP, the opportunity to also use DEFLATE is natural and right there. > Only thing missing really is a CLI interface. If you want people to be able to use it from the command-line, write your app as a polyglot file foo.htm so that anyone can double click to open in their browser if they want to or run it as `nodejs foo.htm` since NodeJS doesn't care about file names but browsers do (for any files loaded from disk). If you want to "pass through arguments as [query string] params", then you're opening it in the browser and not really providing a command-line interface so there's very little difference between having them type the arguments out in their shell before pressing Enter or typing them into the app when it's open in the browser. Again this is one of those things where nothing's stopping anyone from doing it right now today. They're just not doing it. As the Book Overflow guys said in a recent episode (the review of Wolfram's book on ChatGPT)—all the pieces are there. Or to borrow a turn of phrase from Raskin that gets down to the truth of the mess we're in[1], "none of this is necessary; it is merely customary"[2]. 1. <https://www.youtube.com/watch?v=lKXe3HUG2l4 https://www.youtube.com/watch?v=lKXe3HUG2l4> 2. <https://queue.acm.org/detail.cfm?id=864034 https://queue.acm.org/detail.cfm?id=864034>