Install
The runtime from npm, and Vite and the ownership checker as dev dependencies.
Install the runtime, and add Vite and the ownership checker as dev dependencies:
npm install @arv/threads
npm install --save-dev vite @arv/threads-check # Vite, and the ownership checker
What It Needs
@arv/threads needs:
- Vite 8, or Vite+, which is built
on it. With Vite+, alias
viteto Vite+'s core, as this repository's pnpm-workspace.yaml does. - Node 22.13 or later. Vite+ needs 22.18.
- A browser with
SharedArrayBuffer.
The runtime that the page and its workers run (@arv/threads,
@arv/threads/heap and @arv/threads/browser) is TypeScript, and Vite compiles
it as it bundles the page. What Node runs (the Vite plugin, and
@arv/threads-check) is JavaScript.
Next, set up the Vite plugin, the page and the checker.