Offscreen canvas rendering in a web worker -- zero main thread blocking.
This package provides custom HTML elements that set up a Shadow Objects environment in a dedicated web worker, giving you GPU-bound canvas rendering (including Three.js) without stalling your UI thread. Shadow Objects doesn't replace React, Vue, or Svelte -- it's the logic layer those frameworks render.
npm install @spearwolf/shae-offscreen-canvas<shae-offscreen-canvas-ctx src="my-logic.js">
<shae-offscreen-canvas>
<!-- Your entities here -->
<shae-ent token="my-scene"></shae-ent>
</shae-offscreen-canvas>
</shae-offscreen-canvas-ctx>The src attribute points to your shadow environment entry file -- the script that runs inside the worker and defines your shadow objects. The <shae-ent> elements are entities in the view layer; their tokens connect them to shadow objects running in the worker.
- Start Demo Server:
pnpm start(from root) orpnpm dev(inside this package) - Run Tests:
pnpm test