@tony.kay thanks for your help man. in regards to SSR from earlier... turns out I needed to include cljsjs/react-dom-server in my dependencies for render-to-str to work... tinkering with the serverside part now (cljc and all that)
you're welcome. let me know how it goes
in order for (dom/render-to-str) to work for me, i have to inculde [cljsjs.react.dom.server]
However, I want the (dom/render-to-str) to work on the serverside, but I don't know how to (or even if it's possible) to include a cljsjs dependency in a clj. The dom/render-to-str method ... hmm
I noticed that the todomvc example does not seem to propagate changes that occur as a result of other users affecting the in memory data. Can anyone point me in the right direction for change propagation that provides eventual consistency in multiple clients?
When I say "in memory data" I am referring to the datomic database which is an in-memory mini-database in the server.
I'm guessing every transaction should update some common key that everything includes in queries.
@fragamus you will have to wire that up yourself. check out the websockets cookbook recipe for a pointer. depending on your requirements it could be as simple as making the server broadcast all remote mutations (like in the recipe).
That's just the tip I was looking for! Thanks!
Well that websockets thingy does not have a datomic dependency.
But I like the sound of simply making the server broadcast all remote mutations.
I guess this is really a datomic question and not really on topic for this channel. I'll go poke around in Datomic.
Yes!!! I got it working!
Serverside rendering!!!! 😄
I'd like to thank the stars in the sky and the grains of sand on the beach...
congrats
@fragamus datomic has a way to listen to txes. It is relatively simple to make a little entity id subscription mechanism for your client, then push to clients that have an indicated interest in the changes that appear in the Datomic tx log
e.g. subscribe by entity ID. when you see the entity's id in the tx log, push the change to the client
@tony.kay do you think it would be faulty design if every tx was pushed to all users and only certain subsets were rendered?
(on the topic of post-mutation datomic broadcast)
It would be a luxurious way to live.
But luxury is often expensive.
@sova Depends on how much you like paying for bandwidth
your mobile user's certainly won't appreciate it
and of course frequency of updates....a few a minute system wide...fine. More than that? Bleh
Design is always flexible based on actual use-case. One-off app you're using with a couple of friends is a lot different than, say, facebook