Isoloop 0.1: open-source library runs JavaScript app parts on separate workers
Isoloop 0.1 is an open-source TypeScript library for JavaScript apps that separates the UI from the work behind it. Each part, UI or headless, runs in its own Web Worker[1] or in a shared pool, and a supervisor restarts it when it fails. A block or crash stays in its part while the rest of the app keeps running on its own event loop[2]. Parts from different owners can be combined, for example micro-frontends from several teams[3]. It works with React, Preact or plain DOM.
Parts do not call each other. They publish records to topics and subscribe to them through a message bus that keeps each topic's records for its set retention, and a persistent topic is also written to disk so it survives a reload. The supervisor watches each worker's heartbeat. A crashed isolate is restarted up to 3 times by default, and then fails on the next crash unless it ran for 60 s before that crash.
The library has limits. Synchronous layout reads such as getBoundingClientRect, and synchronous focus and scroll, are not available, because an isolate gets a promise back from the host. Each worker also times its callbacks, which adds 0.2 to 3.6 µs per empty callback depending on the engine. On the site's plant-dashboard benchmark, the native builds without these features use less CPU and memory.
Repository Isoloop github.com
Open-source TypeScript library that runs parts of a JavaScript app on separate Web Workers, with a supervisor that restarts failed parts.
Read the original isoloop.devDiscussion
Sources
-
Isoloop
Isoloop: event-loop isolation for JavaScript apps (0.1, open source)


