Remix.run Logo
lewisjoe 11 hours ago

This is great. Curious: this requires users to have a host app installed on their machine that can read .capsule file right? Won't that be a point of friction for distribution?

Isn't html/css a better distribution mechanism as most computers already have the tech to run them?

Dwedit 11 hours ago | parent | next [-]

You'd think so, but web browsers are downright lobotomizing the ability for local HTML files to run any meaningful javascript code. Want to run a JS file from the same directory? CORS ERROR!!!!

Hence 200MB applications that are complete copies of the Chromium browser to run under 1MB of actual web code.

derpyzza 9 hours ago | parent | next [-]

couldn't you just embed the js directly into the html file though? that would sidestep the CORS error. and since most of the people using a program like this are likely to be using AI to generate their ( likely throwaway ) applets anyway, readability and maintainability for the source doesn't matter as much as it would with human authors so having a separate js file doesn't bring that many advantages anyway.

fallinditch 8 hours ago | parent [-]

Sharing HTML files with embedded Javascript is problematic: iOS users can't open the files directly, and have to save the file and then 'open with ... '.

krapp 36 minutes ago | parent [-]

Sounds like iOS is problematic.

throw101010 10 hours ago | parent | prev | next [-]

Isn't that the price of a relatively well sandboxed experience by browsers?

I've experienced the same limits building small tools for myself and friends that I wanted to contain in a single HTML file without external dependencies... but I understand why the same project without these restrictions could easily become malware, and ones that could be easily propagated.

Dwedit 9 hours ago | parent [-]

I wish the browser would either allow local-only or internet-only, then only make up its mind after the first attempted request. Fetch an image from the internet? No script access for local files. Fetch a JS from elsewhere on the hard drive? No internet access. That could provide the sandbox while still being flexible.

slipperybeluga 10 hours ago | parent | prev [-]

[dead]

bashtian 11 hours ago | parent | prev | next [-]

The problem is that you can't save the user data in way that you can click a single file, similar to a Word or Excel file. I you think a about it, a Excel spreadsheet is also just UI + data in a single file.

paweladamczuk 10 hours ago | parent | next [-]

This is a frustration of mine as well, but I vaguely remember someone showing something on HN where the file could essentially save itself, I think they were using some file APIs for that... sadly I can't find the details anymore. But I keep running into the "HTML file opened locally can't update itself" issue repeatedly now that I build tools for myself with LLM agents.

fallinditch 8 hours ago | parent | next [-]

Are you thinking of Nash? a standalone editable note as HTML that was featured on HN some time ago. https://keepworking.github.io/nash/

yoz 10 hours ago | parent | prev [-]

The File System Access API can do this, and it works in local ("file:///") HTML files, but it's only currently supported in desktop Chromium browsers: https://caniuse.com/native-filesystem-api

However, every browser will let you download a new version of the HTML file and save it over the old one - yes, even from a local HTML file:

   const blob = new Blob(['<!DOCTYPE html>\n' +
      document.documentElement.outerHTML], 
      { type: 'text/html' });
   const a = document.createElement('a');
   a.href = URL.createObjectURL(blob);
   a.download = 'mypage.html';
   a.click();
... but you need the user to do this for every update. So we're back to manual "Save" buttons.
Jonovono 9 hours ago | parent [-]

This is the approach Bento took I believe (similar idea, but just for decks): https://github.com/nyblnet/bento.

Saw it on HN a few weeks back

alexis2b 10 hours ago | parent | prev [-]

Technically that was more MS Access :-)

lukasbm 10 hours ago | parent | prev | next [-]

I imagined the capsule website would be able to either convert or directly run/open them

ProfDreamer 10 hours ago | parent | prev [-]

That reminds me of TiddlyWiki[1], a wiki application in the form of a single self-contained HTML file.

1: https://en.wikipedia.org/wiki/TiddlyWiki