Experimental vite-plugin-use-worker turns any async function into a Web Worker with one directive
cnakazawa · x · 2026-09-05
Andrew Ingram released an experimental Vite plugin, vite-plugin-use-worker (explicitly not production-ready), that lets you put a "use worker" directive inside an async function — Vite then moves the implementation into a Web Worker automatically, so you call it with ordinary arguments and await, with no worker entry files, message handlers, or request-ID protocol.
- Demo uses Shiki to highlight code inside the worker while the main thread stays responsive
- Supports JS/TS/JSX/TSX, requires Vite 8, browser only
- Aims to cut the boilerplate even comlink-style libraries still require
- Very early (one commit, 1 star), author is soliciting feedback
More from coding & agent
- Devs call to abolish context compaction: agent engineering debate heats up — sull · 2026-09-05
- GPT-6 Astra arrives in GitHub Copilot, built for long-horizon autonomous coding — OpenAIDevs · 2026-09-05
- Hierarchical RAG plus persistent scratchpad beats FIFO windows for long-horizon agents — IgorCarron · 2026-09-05
- Astra-built site lays out GPT-6's pitch: research, modeling, coding, cross-app agents — reach_vb · 2026-09-05
- Dev Uses 5.6-luna-low Model to Simulate Dumb Users Before Shipping — generativist · 2026-09-05
- Everyone Asks Astra For Games, This Dev Asked It To Deflake Tests — cramforce · 2026-09-05