Hacker News new | ask | show | jobs
by tonyarkles 1772 days ago
I’m asking this from a genuine place of curiosity, because last time I checked a few years ago the answer was “terrible”. Has the “save a file locally and load it again later” story for SPAs improved any?
2 comments

There is no universal local file system API, so "terrible" might be a reasonable description of this.

There is a Chrome-only local file system API.

Generally SPAs are limited to browser provided storage like IndexedDB.

I have implemented plenty of SPA (for years) that use the pattern of A) allow the user to download their current state as JSON/EDN and then B) allow the user to upload a new state from JSON/EDN file and continue from where they last downloaded their state.

This has been easy to implement for as long as I can remember, so not sure why'd you say it's terrible. What stopped you previous times?

Ok, so that’s kind of what I figured was the current state of things. Compared to being able to hit “Save” and have a local copy updated, that’s a pretty subpar workflow. I get why it’s like that (preventing a sandboxed website from being about to update files on the local filesystem) but...