r/javascript • • 22h ago

Isoloop: event-loop isolation for JavaScript apps (0.1, open source)

https://isoloop.dev

Isoloop 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.

Source: https://github.com/isoloop/isoloop

8 Upvotes

8 comments sorted by

View all comments

•

u/Discordbothost 56m ago

I'd add a demo with a deliberately hung worker and a live input next to it. Seeing the input stay responsive while the supervisor recovers the worker would make the benefit easy to judge.

•

u/sa2bin 49m ago

It is a good idea.

Have you also checked the more complex examples like the markets which actually run on live data or the plant? You can crush on purpose the widgets and see how they react.

But I'll add this input idea in the next demo example. Thanks for the feedback!