Skip to content

WebContainer, file system APIs & sqlite #19

seidtgeist started this conversation in General
WebContainer, file system APIs & sqlite #19
May 21, 2021 · 2 comments · 5 replies

It seems like a bunch of stuff was released for Google I/O ;) Something that caught my attention:

WebContainer OSS repo (docs only): https://github.com/stackblitz/webcontainer-core
HN thread: https://news.ycombinator.com/item?id=27223012
Blog post: https://blog.stackblitz.com/posts/introducing-webcontainers/
Comment mentioning sqlite: https://news.ycombinator.com/item?id=27224683

I’m curious about WebContainers appearing out of the blue, what exact file system API is being used (File System Access API?) and whether threads are involved in their sqlite adaption. As always, I’m hoping a proper FS API and WASM threads become available cross-browser.

Replies

2 comments
·
5 replies

It is the FS Access API since www.StackBlitz.com/local throws TypeError: window.showDirectoryPicker is not a function

0 replies

I got excited enough to look at the File System Access API when support recently showed up in Safari, but unfortunately it doesn't look good for storing live databases. Besides the fact that Firefox is opposing it, the Chromium implementation appears to be crippling performance in the name of security. According to this bug, writing to a file copies the file, applies the write to the copy, scans the copy for malware, and renames the copy over the original. If you're updating a small area of a large file, e.g. like a database transaction, and your local filesystem doesn't do some sort of block deduplication, then that could be excruciatingly slow. So far the Google response seems to be, "works as intended".

5 replies
@rhashimoto

rhashimoto Mar 1, 2022
Maintainer

Chrome 99 is shipping the Origin Private File System which might have much better I/O performance. As implied by the name, it is designed to be accessed only by origin pages, so it can't (or at least shouldn't) be used to share files with native applications. This is already in Safari, and is getting a better initial reception from Firefox.

@seidtgeist

@rhashimoto Here’s another dusty old idea: Have a sync node on LAN, e.g. an iOS/Anroid app and use that for persistent storage. I’ve given up my belief in persistent storage long ago.

@rhashimoto

Long ago? You just started this thread with hope in May! 😀

As always, I’m hoping a proper FS API and WASM threads become available cross-browser.

Or do you mean shared persistent storage?

@seidtgeist

Persistent storage is the Dark Souls of Browser APIs 😅
The native-app-as-sync-node idea is from a October 2016 @berlinjs talk I held 🥲

Or do you mean shared persistent storage?

Single-tenant persistent storage.

@rhashimoto

rhashimoto Mar 9, 2022
Maintainer

Chrome 99 is shipping the Origin Private File System

This was misreported because they postponed the target release from 99 to 102 but forgot to update their feature calendar. So it's only released by Safari right now, still at the origin trial stage in Chrome. Chrome 102 is scheduled to release in late May. Perhaps there will also be progress in Firefox by then. 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants