Join my newsletter

Get updates on new posts and projects straight to your inbox.

A Server in Your Browser

Modern apps often require blocking processing for common features like searching, indexing, or image transformations. Often the solution is to push this processing to a web worker, but the interface for web workers is an awkward postMessage event emitter. Web-worker RPC with Comlink Comlink can alleviate the pains of this interface by making method calls across the main->worker boundary transparent. You can call otherwise remote procedures as if they were functions in the main thread — it works like magic — but it comes with a cost. You expect your wrapped function to behave just as it did in the main thread, but it does not. The mental model can make it hard to debug. Errors and stack traces are confusing. Object serialization and deserialization is opaque. ...

February 5, 2026 · 4 min · rbby