Configurable base URLs for retrieving WASM/wheel assets in html-wasm exports (to support self-contained/offline use)
Description
I have a bunch of blog posts I authored as Jupyter notebooks interleaving code and prose. I'd like to make them more like "explorable explanations" (another Bret Victor fan here), but there's a lot of Pyodide plumbing required to get live-updating visualizations and embedded dynamic values in the prose output. It seems like most of that plumbing has been done already as part of Marimo... but I really want to self-host all the necessary files, and there's hard-coded (as far as I can tell?) references to specific remote hosts where Marimo or Pyodide retrieve essential components of the runtime.
Another issue report indicated there's no way to make it work offline (marimo-team/marimo#575), which would also be something that could be fixed with a hook to override these URLs.
It would be useful to at least add support for overriding these CDN URLs somewhere, because then it would be technically possible to self-host the assets for a WASM notebook (but still up to the user to figure out how). It would also be useful for the use case of just archiving a static notebook such that it can be opened in the future no matter what changes with newer upstream packages.
Are you willing to submit a PR? (You must receive approval from the team before submitting a PR.)
- Yes
Alternatives
It would be technically possible to vendor the assets and regex match and rewrite the URLs, but brittle.
(I've also tried building my functionality separately on top of Pyodide instead of Marimo, but ended up needing to make custom widgets, dependency tracking, etc. that Marimo already has.)
Additional context
No response
Source: marimo-team/marimo