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

(hyperclay.com)

142 points | by pil0u 2 hours ago ago

34 comments

  • bflesch an hour ago ago

    I appreciate the storytelling and the nice graphics, but after reading 10 screen lengths of this story I still don't understand what technology they are using to achieve this.

    Is it a lot of words to talk about localstorage? How exactly are the changes persisted to the HTML file? Is it using FileSystemAPI to overwrite the previous HTML file? How can they implement it seamless for the user without them having to choose the proper file in the "Save As.." dialog?

    • athrowaway3z 11 minutes ago ago

      I'm also a bit lost after scrolling through it. It seems if we take this one step further and add a bit of syntax to HTML to be executed on the server you'll have invented PHP / WordPress right?

      AFAICT this is another cycle of; a decent system becoming overcomplicated because someone wanted to make it multi-tenant, and the re-discovery that 90% of the "improvements/advancements" are essentially bloat in the context & freedom you find/create.

    • maelito an hour ago ago

      There's a DB on the server. It's just storing HTML with all its views instead of storing JSON, an extract of the information that is allowed to change...

    • aszen an hour ago ago

      From what I understood the html file itself is updated so it's updating forms, attributes and other tags to include the new changes

      • aszen an hour ago ago

        Then that file is posted to the backend for persistence

  • pavlov 2 hours ago ago

    This is coming close to WWW's original vision because the very first web browser was also an editor. Tim Berners-Lee's application on the NeXT was basically a wrapper for the operating system's built-in rich text editing class named TextView. (It later became NSTextView on Apple's Mac OS X and still powers the TextEdit app on Mac.)

    We lost editing for two reasons:

    1) The HTTP PUT method didn't exist yet, so edited HTML files could only be saved locally.

    2) Mosaic built a cross-platform web browser that defined what the WWW was for 99% of users, and they didn't include editing because that would have been too complex to build from scratch in their multi-platform code base.

    • jauntywundrkind an hour ago ago

      Making a more read/annotate/write web is near and dear to my heart. There's a lot I find admirable - noble about pages like Hyperclay!

      But also, it's a distinctly different answer for each page to build its own toolkit for the user (Hyperclay) vs TBL's read-write web. The user-agent ought, imo, afford standard tools that are going to work across web pages, that extend the user agency whatever site they are visiting.

    • weinzierl an hour ago ago

      To add to that the W3C maintained the Amaya "browser", or web editor how they liked to call it, for like a decade and a half, as their vision for the web.

      I think it was not just an appealing idea but Amaya itself was a solid implementation for a "testbed" (again, their words).

      I can see why it died but I still think it is a bit of a shame it did.

    • dismalaf an hour ago ago

      > web browser was also an editor

      Ummmm all the browsers I know of are also editors... Are there any that aren't?

      Edit - does no one use dev tools anymore? No HTML? No vanilla JS and CSS? Everyone just using TS, React and gluing things together? Like, you literally have an entire IDE in your browser (assuming you use anything derived from Chrome, Firefox or Safari) that can code a web page live...

      • tommica 18 minutes ago ago

        DevTools was not part of the original browsers. Firebug brought the concept to existence in the first place.

        As a sidenote, does manipulating forms count as editing?

      • sethaurus 26 minutes ago ago

        You're describing built-in developer tools for editing local files during development. The comment you're replying to is describing the vision of a browser which can edit remote files as part of the normal user workflow, not as a developer-only activity.

  • BoppreH 3 minutes ago ago

    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, that adds the `checked` attribute to its element, thenpersisting `document.body.outerHTML`. There's automatic versioning and read/write permissioning.

    It's a pretty cool project! I'll definitely try for my own personal tools.

    Do note that, from my understanding it's most useful when there's one developer, who is also the only content editor. Otherwise you'll have editors overwriting each other's changes, and if there are multiple copies there's no easy for the developer to push a change to all copies.

  • Sammi 5 minutes ago ago

    To take this concept one step further towards perfection, you would want to lose the backend completely and persist directly to a git repo using https://isomorphic-git.org/

  • Tepix an hour ago ago

    Looks like it's on Github at https://github.com/panphora/hyperclay-local

  • maelito an hour ago ago

    Am I the only one that does not understand what the author wants to explain ?

    Do we need a story with illustration to understand how a new framework works ? What's the plain markdown 2 to 3 paragraph that explains the concept ?

    Edit : here it is. https://docs.hyperclay.com/docs/docs-tldr-paste-in-llm/#how-...

    > Whenever the page changes—or the user explicitly saves the page—we grab all the HTML, make a few modifications, and then POST it to the backend’s “save” endpoint.

    Wait, so instead of storing JSON we store HTML with all its verbosity and all its tags that have nothing to do with the user edit (e.g. a small profile description change) ? What about if the webmaster then wants to change the HTML title of the profile description block ? The user's version just diverged from the webmaster's ?

    • general1726 an hour ago ago

      Or you will rename one page, instantly breaking URL pointing on that page on all already saved pages.

  • dr_kiszonka 40 minutes ago ago

    Slightly tangential: a lot of my vibe coding experiments are standalone SPAs because I can't be bothered to set up a secure server (and I am too cheap to pay for it). I love that I can open my "mobile-first" apps directly from my phone's Downloads folder.

    I have a feeling that a lot of these little tools people make with low-code vibe AI apps do not require more than a single HTML page with JS imports.

    (I also suspect that there is a ton of duplication in what people create, but, of course, I have no data to back it up.)

  • heikkilevanto an hour ago ago

    Interesting idea. Well put it on the list of things I should try some day.

    After a quick look at the site, I like the idea. But I wonder where it's limitations start to get in the way.

    How about security, if I can modify the page, who else can? And who controls that?

    How much code and logic does it handle before getting difficult to maintain? And how much data?

    If I make an useful app with it, say to track beers, can I share the app with other people without so they can track their own beers, without sharing my personal data?

  • clemensnk an hour ago ago

    This is really neat! It echoes many of the ideas we've been exploring with the Webstrates project (https://webstrates.net). We've been using the DOM as persistence layer for building malleable collaborative software for smaller groups, whereas hyperclay focuses on using the same mechanisms for traditional webpages. Recently, I have been experimenting with a local-first approach to Webstrates (https://github.com/Webstrates/MyWebstrates). Might be interesting to explore if a Webworker-based approach like in MyWebstrates could be used for offline editing in hyperclay.

  • swiftcoder 2 hours ago ago

    Very nice concept!

    I've been thinking for a while that the web really suffers from not having a built-in concept of (ideally fairly anonymous) identity. I shouldn't need to maintain a whole authentication system and a database full of PII just to let you see the same data across your laptop and your phone...

    • bapak an hour ago ago

      You mean HTTP auth?

      • oreilles an hour ago ago

        HTTP auth is not an authentication system, it only describes how credentials should be passed from the client to the server and how the server should respond to them.

  • thunderbong 31 minutes ago ago

    Very interesting.

    Pricing page returns a 404 as of now, though.

    https://www.hyperclay.com/pricing

  • brumar 2 hours ago ago

    Very good. I was wondering why nobody did something like that before. At least this was my conclusion from my google searches few months ago. From a design perspective, I don't like storing state in the DOM itself, I would have find much more flexible to have the state in a json as a single source of truth and use reactive patterns such as state change => ui change and not hiting the DOM directly. That sounds like big framework things, but it saved me from acute headaches in a personal similar framework I did for self-contained apps. It was not HTML but I thought I would apply the same logic if I had to do it for html apps too.

    • modeless an hour ago ago

      I guess your searches missed Tiddlywiki. I think there have been a couple of other takes on the concept too.

    • clemensnk an hour ago ago

      Also our Webstrates (https://webstrates.net) system stores state in the DOM itself. But it's more a system for research prototyping than publishing web pages.

  • phantomathkg 2 hours ago ago

    At first I thought it is tiddlywiki but it is not.

  • jomoho 30 minutes ago ago

    This reminds me of a self contained svg editor running in the browser , that I wrote a few years ago.

  • dazhbog an hour ago ago

    Here's a video of the creator explaining more

    https://www.youtube.com/watch?v=OUiTBFDxwaM

  • keepamovin 43 minutes ago ago

    Great name, cool idea and this guy communicates well. Inspiring to see!

  • mettamage an hour ago ago

    The title reminds me of TiddlyWiki.

  • rfarley04 2 hours ago ago

    Somebody's been reading The Oatmeal recently

    (but seriously, very cool)

    • jaza 9 minutes ago ago

      It's been too long! Off to The Oatmeal I go...

  • visarga an hour ago ago

    If you use Claude to generate apps in the artifact they are very similar - self contained and easy to create and share.