Skip to content

Portable offline WASM export for the fit app and docs explorers - #31

Merged
marcocaggioni merged 1 commit into
masterfrom
offline-wasm-export
Sep 27, 2026
Merged

marcocaggioni merged 1 commit into
masterfrom
offline-wasm-export

Conversation

@marcocaggioni

Copy link
Copy Markdown
Member

Makes the browser fit app and all nine documentation explorers boot with no network access.

What changes

  • marimo export html-wasm --offline for app/fit_app.py (deploy-app.yml) and all nine explorers (docs/export_interactive.py): the Python runtime, Pyodide, and every dependency wheel — including rheofit and its SciPy/pandas/matplotlib/openpyxl stack for the fit app — now ship with the page. Nothing is fetched from a package index at runtime.
  • The nine explorers share one runtime: the identical assets/pyodide/packages/lockfile directories are moved to docs/_static/interactive/_shared/ and each explorer page references them relatively. One ~59 MB runtime instead of nine (~530 MB saved per docs build).
  • Build environments get what the offline export needs: headless Chromium via Playwright in deploy-app.yml and the docs CI build job, plus the Chromium system libraries and a playwright install chromium step in .readthedocs.yaml (marimo>=0.25 in docs/requirements.txt).

Verification

  • Fit app: served locally with every non-localhost request blocked — reaches the upload screen (title, Data upload, model picker, Compare section), zero external requests, zero page errors.
  • TC explorer in the shared layout: full working screen — live sliders, parameter readouts, and the log-log stress/viscosity plot with decomposition lines — with all external requests blocked, zero external requests, zero page errors.

Notes for review

  • The previous online export commands are one revert away in git history until this merges; nothing else in the app or docs changes.
  • Deploy size grows (~77 MB for the app, ~59 MB shared runtime for the docs) since wheels now ship with the pages.
  • Please merge from the GitHub UI when ready.

Export both the browser fit app and all nine documentation explorers
with `marimo export html-wasm --offline`: the Python runtime, Pyodide,
and every dependency wheel (including rheofit for the fit app) now
ship with the page, so both boot with no network access and never
touch a package index at runtime.

- deploy-app.yml: install headless Chromium via Playwright, export
  app/fit_app.py with --offline
- docs/export_interactive.py: export all explorers with --offline,
  then share the identical runtime (assets/pyodide/packages/lockfile)
  across all nine via docs/_static/interactive/_shared/ (one ~59 MB
  runtime instead of nine)
- docs/requirements.txt: marimo>=0.25, add playwright
- docs.yml CI build job: install Chromium for the offline export
- .readthedocs.yaml: apt packages for headless Chromium +
  `playwright install chromium` in pre_build

Verified: fit app reaches its upload screen and the TC explorer its
full working screen (sliders live, plot renders) with all external
requests blocked — zero external requests, zero page errors.
@marcocaggioni
marcocaggioni merged commit 97e74d2 into master Sep 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant