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.
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.
Until next time, happy coding…