Files
lightcraft/apps/web/worker.js
T
Andrew FrahnandClaude Opus 5.5 fb097d61be Rename crates to neutral dac-* codename and binaries to app/app-cli
Mechanical rename right after the fork so upstream merges map cleanly.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-10 09:43:50 +11:00

16 lines
631 B
JavaScript

// LightCraft render worker: a second instance of the app's wasm module that renders jobs posted
// by the page (see apps/web/src/workers.rs). The first message carries the compiled
// WebAssembly.Module and the storage backend kind; the module then takes over `onmessage`.
import init, { worker_main } from "./dac_web.js";
self.onmessage = async (e) => {
self.onmessage = null;
try {
await init({ module_or_path: e.data.module });
worker_main(e.data.store);
} catch (err) {
// surfaces as the Worker's `error` event on the page, which falls back to inline rendering
setTimeout(() => { throw err; });
}
};