mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-09 09:59:52 -06:00
Mechanical rename right after the fork so upstream merges map cleanly. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
16 lines
631 B
JavaScript
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; });
|
|
}
|
|
};
|