The live preview uses the Sandpack bundler, which must run on a separate origin from modulora.dev because it executes untrusted author code (the origin boundary is the security line — same reason previews are cross-origin).
Task
- Vendor a pinned commit of
codesandbox/sandpack-bundler (Apache-2.0) in infra; build dist/ in CI (~5s).
- Deploy as an assets-only Cloudflare Worker at
sandpack.modulora.dev (ships a _headers file).
- Point
VITE_SANDPACK_BUNDLER_URL at it for prod builds. Dev already runs a local build on :4587.
- Version-pin
bundlerURL + sandpack-react together so upgrades are deliberate.
Why self-hosted
The codesandbox.io-hosted bundler's handshake is blocked on some networks (telemetry timeouts) and is a third-party runtime dependency. Self-hosting removes csbops.io telemetry from authors' browsers and keeps previews working if codesandbox.io is down.
Area: Cloud
The live preview uses the Sandpack bundler, which must run on a separate origin from modulora.dev because it executes untrusted author code (the origin boundary is the security line — same reason previews are cross-origin).
Task
codesandbox/sandpack-bundler(Apache-2.0) in infra; builddist/in CI (~5s).sandpack.modulora.dev(ships a_headersfile).VITE_SANDPACK_BUNDLER_URLat it for prod builds. Dev already runs a local build on :4587.bundlerURL+sandpack-reacttogether so upgrades are deliberate.Why self-hosted
The codesandbox.io-hosted bundler's handshake is blocked on some networks (telemetry timeouts) and is a third-party runtime dependency. Self-hosting removes
csbops.iotelemetry from authors' browsers and keeps previews working if codesandbox.io is down.Area: Cloud