Get help from the marimo community

Updated last week

Save WASM edits to disk

When I am developing a notebook that is destined to become a WASM notebook, it would be great to be able to edit it directly in the WASM environment and save the changes to disk, instead of developing in the Python environment, having to make sure it works in both.
M
v
a
14 comments
Your browser doesn’t really allow for this (otherwise would be a big security issue). You would need to save manually and download the file.
I am thinking it would be possible when launching it through the marimo CLI. marimo edit --wasm or something like that. I assume some of the API's are in place, since it is possible on Marimo Cloud?
I.e. exposing this locally
Attachment
CleanShot-2025-03-07-18-21-56.png
That is – not after sharing/deploying the notebook, but while developing it locally. Currently I do it in Marimo Cloud, download it manually, and then export it to WASM. I am using packages that only work in Pyodide (e.g. https://github.com/whitphx/transformers.js.py)
Would you run a server locally? Or how would you serve those APIs?
This was impossible to develop locally at the moment, since Transformers.js.py only runs in a Pyodide environment.
Best case I would run marimo edit --wasm notebook.py, it would launch a server serving up the file so I could open it in the browser, and then save any changes I make to the local file.
Browsers like chrome do allow editing local files now via file system api
https://developer.mozilla.org/en-US/docs/Web/API/File_System_API

Many web editors like vscode.dev use it, in fact whole folders can be opened
yea, you do have to give access which we could ask for each time. i would be cautious to always ask / allow access since you don't want to open an arbitrary wasm notebook that now has access to your computer
Why not, a wasm notebook will still be sandboxed, it can't run any code/modify other files, the only thing it enables is reading/writing files locally.
Can you grant access to one file or it gives access to the whole FS?
It is per file / directory. Also one can serialize file handles and store them in local storage for recently viewed files or projects
It is a chrome+edge only feature right now
Add a reply
Sign up and join the conversation on Discord