Skip to content

POC: embedded JupyterLite notebook escape hatch (#650) - #771

Draft
dougc95 wants to merge 2 commits into
mainfrom
poc/650-jupyterlite
Draft

POC: embedded JupyterLite notebook escape hatch (#650)#771
dougc95 wants to merge 2 commits into
mainfrom
poc/650-jupyterlite

Conversation

@dougc95

@dougc95 dougc95 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Proof-of-concept for the opt-in escape hatch in the #650 evaluation: a full Python notebook compiled to WebAssembly, running entirely in the browser (no server-side interpreter). The runner-up, not the primary recommendation, because of its size and shape.

JupyterLite Lab with the pre-seeded sample notebook open

What it is

poc/jupyterlite/ — build wiring (build.sh / build.ps1) that produces a JupyterLite (Pyodide) site with a pre-seeded sample notebook that calls $sql-run from the browser and charts with pandas/matplotlib. The built site (70 MB default / 463 MB vendored) is gitignored and reproduced by the script, so the branch stays small.

Verified

build.sh runs jupyter lite build --contents content and produces a servable dist/ with the sample notebook indexed; the screenshot is that site's Lab UI with hfs-sql-on-fhir.ipynb open and the Python (Pyodide) kernel idle. (Baking in custom content needs jupyter-server — now in the install line.)

The no-CDN reality (measured, evaluation §10)

Build Off-origin at runtime Size
Default (build.sh as-is) Yes — Pyodide from cdn.jsdelivr.net 70 MB
Vendored (--pyodide <tarball>) No — 0 off-origin 463 MB

Only the vendored build passes the HFS no-CDN guard, at ~463 MB (≈3× the largest binary in the workspace) — which is why JupyterLite is the opt-in escape hatch, never in the default image. README covers the CSP / IndexedDB caveats for embedding.

Run

cd poc/jupyterlite && sh build.sh
python -m http.server 8080 --directory dist      # open http://localhost:8080/lab

Relates to #650.

dougc95 and others added 2 commits August 28, 2026 10:30
Wiring for the #650 opt-in escape hatch: build.sh/build.ps1 produce a
JupyterLite (Pyodide) site with a pre-seeded sample notebook that calls
$sql-run from the browser and charts with pandas/matplotlib — no server-side
Python. The built site (70 MB default / 463 MB vendored) is gitignored and
reproduced by the build script.

Verified: build.sh runs `jupyter lite build --contents content` and produces a
servable dist/ with the sample notebook indexed (needed jupyter-server, now in
the install line). README documents the no-CDN reality (default fetches Pyodide
from jsDelivr and fails the guard; the --pyodide vendored build is 0-off-origin
at 463 MB) and the CSP/IndexedDB caveats for embedding.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PTFfaGwHDggEbrFtfejJtE
The built site's Lab UI with the pre-seeded hfs-sql-on-fhir.ipynb open and the
Python (Pyodide) kernel idle — proving the build bakes in the sample notebook.
@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

dougc95 added a commit that referenced this pull request Aug 28, 2026
…vs proposal (#650)

Adds a "Proof of concept" subsection to §5 mapping each option to its built
demonstrator (PRs #768-#771) with what each verified, and relabels the
now-shown feasibility as [demonstrated] while keeping the product decision,
correct Stage 2, Stage 3, and the open questions as [proposal].
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