untangled 2017-01-06

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).

😎 1

That's just the tip I was looking for! Thanks!

👍🏿 1

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.

sova-soars-the-sora 2017-01-06T17:49:38.001859Z

Yes!!! I got it working!

sova-soars-the-sora 2017-01-06T17:49:43.001860Z

Serverside rendering!!!! 😄

sova-soars-the-sora 2017-01-06T17:50:42.001861Z

I'd like to thank the stars in the sky and the grains of sand on the beach...

@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

sova-soars-the-sora 2017-01-06T19:08:50.001865Z

@tony.kay do you think it would be faulty design if every tx was pushed to all users and only certain subsets were rendered?

sova-soars-the-sora 2017-01-06T19:09:19.001866Z

(on the topic of post-mutation datomic broadcast)

It would be a luxurious way to live.

But luxury is often expensive.

😆 1

@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

sova-soars-the-sora 2017-01-06T00:36:05.001839Z

@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

sova-soars-the-sora 2017-01-06T02:33:05.001841Z

in order for (dom/render-to-str) to work for me, i have to inculde [cljsjs.react.dom.server]

sova-soars-the-sora 2017-01-06T02:34:28.001842Z

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.