Hi Jesse,
didn't know where else to reach you, so leaving a message here. Just wanted to mention that I've also been interested in mixing React and Phoenix+Websockets. I wrote a simple app for real-time meetings (first image here) http://imgur.com/a/rAXVz, where I just send operations directly to the websocket, and state is just a map that gets pushed back to all clients. It worked well for a few chats with 80+ participants.
Currently I'm thinking about making this more efficient. I've been working on a json patch library to only send the diff over the wire (not quite done yet: https://github.com/houshuang/diffmatch/blob/master/lib/diffmatch.ex), and also thought about using macros to make writing "reducers" over state very terse (inspired by reading about Redux). This currently works from a macro level: https://github.com/houshuang/diffmatch/blob/master/lib/ops.ex - basically I need the gen_server that keeps state, and calls this on the state whenever a new op is received from the client, pushes out a diff of the updated state etc. THe idea is that I will just store the ops in a persistent database, and at anytime be able to reconstruct state by reducing over the ops (or even go back in time - those providing time machine capability based on server-stored state, kind of like Etherpad).
Hi Jesse, didn't know where else to reach you, so leaving a message here. Just wanted to mention that I've also been interested in mixing React and Phoenix+Websockets. I wrote a simple app for real-time meetings (first image here) http://imgur.com/a/rAXVz, where I just send operations directly to the websocket, and state is just a map that gets pushed back to all clients. It worked well for a few chats with 80+ participants.
Currently I'm thinking about making this more efficient. I've been working on a json patch library to only send the diff over the wire (not quite done yet: https://github.com/houshuang/diffmatch/blob/master/lib/diffmatch.ex), and also thought about using macros to make writing "reducers" over state very terse (inspired by reading about Redux). This currently works from a macro level: https://github.com/houshuang/diffmatch/blob/master/lib/ops.ex - basically I need the gen_server that keeps state, and calls this on the state whenever a new op is received from the client, pushes out a diff of the updated state etc. THe idea is that I will just store the ops in a persistent database, and at anytime be able to reconstruct state by reducing over the ops (or even go back in time - those providing time machine capability based on server-stored state, kind of like Etherpad).