r/javascript • u/sa2bin • 1h ago
Isoloop: event-loop isolation for JavaScript apps (0.1, open source)
isoloop.devIsoloop is a toolkit that helps you separate your app's UI from the work behind it, and you install only what you need. Each part, UI or headless, runs on its own worker or in a shared pool. How you split your app is your call.
Why it exists
In most apps, the UI and everything behind it (state, sync, search, data processing) share one main thread, one heap and one event loop. One slow or broken part makes the whole app janky or blank. A plain worker isolates CPU time, but leaves you to wire up how parts share data, and what happens when one fails.
Isoloop helps you separate them and run them together. Each part can get its own loop, a supervisor restarts it when it fails, and parts can share state through the bus. The UI stays responsive, a block or a crash stays in its part, and the work can run where it fits best.
β Kernel: starts, stops and connects the parts
β Workers: each part on its own thread, or sharing one in a pool
β Supervisor: detects what hangs or crashes and restarts it
β Message bus, optional: typed topics, per-part permissions, replay, history that can survive a reload
β Adapters: React, Preact, or plain DOM and headless with no framework
β Vite plugin: builds and wires up the workers
Still experimental: a balancer that moves parts between workers by measured load, devtools, and tools that let AI agents call the actions your app exposes.
It isn't free. The workers, the bus and the kernel cost extra CPU, memory and start-up time. In return, one bad component or one bad record doesn't have to take the whole app with it.
On the roadmap, not shipped yet: moving the work further from the UI, into a WASM component or a native process, with the bus as the model the UI and the work share.
Open source, MIT. Feedback is very welcome.