3 ms·
I’m curious how much use something like this would ever get; the Origin Private File System is basically just a file system implemented atop a database: it does
by chrismorgan 5y ago
I’m curious how much use something like this would ever get; the Origin Private File System is basically just a file system implemented atop a database: it doesn’t provide any new fundamental functionality, but can be shimmed perfectly atop IndexedDB (though performance characteristics will probably differ). When people hear “file system access”, they’re going to expect that this means you can access arbitrary files and folders on the file system, whether unbounded or within a certain scope, but the Origin Private File System is not that. There need be no correlation between the file system this API exposes and your file system. (In theory there perhaps could be, but it’s not the preferred way and there’s no obvious reason to do it that way, and the question of valid file names would be rather messy, even if the spec kinda makes a weird half-compromise for backslash in file names; and I think the stuff about atomic operations could make it difficult to do sanely, too.) It doesn’t put things in a private folder so that you could open its contents in other locally-installed apps.
So this is basically the harmless but also fairly useless part of File System Access. The only real reasons I can think of straight away for it potentially being useful are (a) if it performs better than IndexedDB, and (b) for simpler API compatibility with something using the dangerous parts of File System Access, which Chromium has implemented but which Firefox and Safari are both utterly rejecting.
I’m also a bit concerned about browsers shipping this stuff given how much flux there still is in the draft spec, which is still thoroughly in its incubation phase and hasn’t been adopted by a working group.
In the end, I can’t understand why they’d implement this part of the spec. It will get some people’s hopes up, only to dash them, since they’re not implementing the useful but dangerous part which is what people actually want.
- hutzlibu 5y ago"since they’re not implementing the useful but dangerous part which is what people actually want." I want it like this. There are lots of use cases for a file system to store user data locally in a safe way. Even though it all can be also done with indexedDB, too - it makes this task incredibly more complicated. I did basically this, implement a file system on top of indexedDB - but with great pain. and I did, because there was no other option - but only with great unnecessary pain.
- chrismorgan 5y agoI haven’t tried, but I think a minimal polyfill of exactly this atop IndexedDB might take 300–400 hundred lines of code (and I’d be interested in the difference in performance characteristics, especially on large “files”, and with different types of edit strategies). A mildly simplified but close enough to feature-complete form of it could probably be done in under 200 lines, though I doubt 100 is attainable honestly (IndexedDB is comparatively verbose). It’s not that this is nothing, but I think it is and will be being fairly heavily oversold by some people.
- hutzlibu 5y agoWell, by now you can probably find some ready avaiable solutions, that would save you time. But having it native, would get you also native debugging tools, where you just could see the data in a common file explorer. What I have instead now, are tons of abstract dbs and object stores, when all I want to see are folders, pictures and text. Which is why I made a node server, which after sync, gets me actual files I can easily debug and store and edit. But this does not work locally anymore then and the structure is unnecessarily complicated.
- jonnycomputer 5y agoIf a browser syncs a private file system access across devices, I could see this being quite useful; e.g. you could have a Google Docs -like browser based document application that doesn't depend on a Google hosting and snooping on it. I don't know about whether it adds anything above indexedDB.
- chrismorgan 5y agoOrigin Private File Systems should be in exactly the same boat as IndexedDB, Local Storage and cookies here.
- jonnycomputer 5y agoAre you saying that a Firefox user with an account which is synced across multiple devices does not sync the IndexedDB, Local Storage etc. That's news to me (though I have not looked into it particularly).
- chrismorgan 5y agoI don’t know what any browsers’ synchronisation systems do with any or all of these, but for syncability and sessiony purposes, these are all equivalent.
- jefftk 5y agoThat's correct: I'm not aware of any browser that syncs those. If one started doing that it would at least initially trip a lot of bot detection systems when a cookie for one device suddenly showed up on a different device.
- jonnycomputer 5y agoCould be challenging for application logic as well, if their state depends on these resources.
- extra88 5y agoFirefox Sync doesn’t copy of those. https://support.mozilla.org/en-US/kb/how-do-i-choose-what-information-sync-firefox https://support.mozilla.org/en-US/kb/how-do-i-choose-what-in...