Demonstrates Dynamic Worker Loaders — spin up sandboxed, disposable isolates at runtime from a host Worker.
npm install # from the repo root
npm start # from this directoryThe host Worker exposes a /api/run endpoint. The React frontend sends user-written code to it, and the server loads it into a one-off dynamic isolate:
const worker = env.LOADER.load({
compatibilityDate: "2026-01-28",
mainModule: "worker.js",
modules: {
"worker.js": code
},
globalOutbound: null
});
const result = await worker
.getEntrypoint()
.fetch(new Request("https://worker/"));LOADER.load()— creates a one-off dynamic isolateglobalOutbound: null— blocks all outbound network access from the dynamic Worker