-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Normalize and make Content frontends and backends extensible #315
Comments
FYI: I have been also looking into the storage options, and what I am using right now is using BrowserFS inside a ServiceWorker so we can manage files using varies backends (e.g. indexeddb), and the service worker can work as a in-browser file server. This allows all unified file access via HTTP, and for pyodide kernel, we can do XMLHTTPRequest in synchronous mode and create file-like object that works with large files. Here is an demo shows how it work in a custom deployment of jupyterlite (available at https://jupyter.imjoy.io ): Here is the notebook if you want to try it out: https://github.com/imjoy-team/jupyter.imjoy.io/blob/master/docs/files/elfinder-demo.ipynb |
Thanks for sharing this @oeway it looks cool! |
I've updated the issue description with a link to the emscripten filesystem built for the (maybe) sleeping starboard: of note, there is a link to the (even more dormant) BrowserFS example at the top, which has even better typing info, which is probably the most important to get started. I'm thinking this is probably the route we should consider for emscripten-based (or maybe all?) kernels, and should be a major design consideration both here and on #463, as the experience would be basically seamless: Of course, it's tempting for an initial implementation to just load up If the provider of this Contents API, in turn, was managed by a ServiceWorker, all the better, and indeed, having a single, offline-ready ServiceWorker that was servicing multiple open tabs is probably what is needed anyway, and would validate all of the hard paths we've chosen. |
Recently stumbled on the upcoming emscripten wasmfs, which sounds lovely, but maybe not something we can wait to trickle down into pyodide 😿. |
I think this was discussed somewhere else already, but maybe it could be interesting to move the existing This would have the benefit of moving the local storage logic to the frontend. And the plugin could then be reused in other lab apps if needed as a regular extension. We would first need to make sure the It could also be interesting to split the Also related: |
Problem
We currently offer a union of files, backed by two storage backends, in the following order:
localForage
...with one storage frontend:
While this makes it possible to deliver the Lab file management UI, such as it is, it is not very ergonomic for:
Proposed Solution
FS
frontend for the overall contentsAdditional context)
FS
: Discuss desired features/syntax for persistence convenience js/py API pyodide/pyodide#1715 (comment)The text was updated successfully, but these errors were encountered: