Client-side rendering, server-side state (StateChannel)

OK so I did some comparisons with Storex and deployed it here, you can compare the same app / UI:

StateChannel + React:
https://react-phoenix-server-state.fly.dev/

Storex + React:
https://react-phoenix-server-state.fly.dev/storex_test

The code I translated to Storex is here:

https://github.com/hubertlepicki/shopper_umbrella/blob/main/apps/shopper_web/assets/js/main_storex.jsx

and

https://github.com/hubertlepicki/shopper_umbrella/blob/main/apps/shopper_web/lib/shopper_web/app_store.ex

When it comes to usage, performance and such, they’re both very comparable. StateChannel uses less text over the wire, as you can see below, but not sure how significant is that.


In general, I wish I knew about Storex before I started this thing, but also it’s great to see the code converged to very similar solution for the problem, independently, twice.

3 Likes