Over the past couple of weeks some really cool new libraries have come out. Two of them are from the insanely prolific Jason Miller, the author of Preact. The third is from Henrik Joretag, who created the Ampersand framework.


We’ll kick it off with Workerize from Jason Miller. It allows you to export a JavaScript module into a Web Worker. The benefit is that this allows you to pass off computationally heavy code to a separate thread and not bog down the performance of your app.


Web Workers aren’t a part of JavaScript, but rather a HTML5 browser feature that can be accessed by JavaScript. And they aren't always a performance boost because they have a bit of overhead to them.

I found an interesting performance benchmark that you can play around with to see the sort of benefit you might expect. I'm not sure how "real world" that benchmark is, but for some solid Web Worker performance tips, this article is a good place to start.


Stockroom picks up on the theme of Web Workers. It's a companion to another one of Jason Miller’s libraries, Unistore, which is a tiny state management library he wrote to complement Preact. Unistore is similar to Redux, but even smaller (650 bytes).

Stockroom runs a Unistore store and its actions inside a Web Worker. He’s created a graphic that nicely demonstrates the advantages of Stockroom:


The UI of your app is in one thread and logic and network calls are in another. This division of labor may give you a significant bump in performance.


If you’ve used Redux before, you know it has a fair bit of boilerplate. This is probably the biggest gripe developers have with it. Redux-Bundler isn’t a bundler in the sense that webpack is. Instead, it allows you to group Redux functionality into “bundles” and then it composes them into a Redux store.

From the README:

In this way you group related reducers, selectors, action creators. Redux-bundler then takes bundles like this and combines them all into a store and pre-binds and attaches everything to the redux store itself.

It looks really slick and Henrik says it’s not a “toy” project, but already being used on some of his production apps.

And Finally...

If you’ve enjoyed this post, sign up for my weekly newsletter. I curate the best JavaScript writing from around the web and deliver it to readers every Thursday. The sign up form is right below this article.

Until next time, happy coding…