Web Worker — Bun.Worker Wrapper #17
Labels
No labels
bug
docs
feature
housekeeping
html-spec
performance
react-compat
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
glow-all/true-headless-browser#17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Implement
Workerin the global scope so thatnew Worker(url)works.What to Build
src/workers/worker.ts— WorkerShim class wrappingBun.WorkerglobalThis.Workerin createIsolatedContextWorkerShim.postMessage()/onmessage/terminate()/onerrorKey Insight
Bun has native
Bun.Worker— we just wrap it:new Worker(url)→new Bun.Worker(url)postMessage(msg)delegatesonmessagesetter wraps Bun.Worker's message eventterminate()kills the workerTests (110%)
Web Worker — Bun.Worker Wrapper. ✅ Implementiert in src/workers/. Tests: worker.test.ts.