Fork me on GitHub
#untangled
<
2017-01-06
>
sova-soars-the-sora00:01:05

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

tony.kay01:01:06

you're welcome. let me know how it goes

sova-soars-the-sora02:01:05

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

sova-soars-the-sora02:01:28

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

fragamus07:01:57

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?

fragamus07:01:24

When I say "in memory data" I am referring to the datomic database which is an in-memory mini-database in the server.

fragamus08:01:51

I'm guessing every transaction should update some common key that everything includes in queries.

ianchow08:01:20

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

fragamus11:01:49

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

fragamus13:01:06

Well that websockets thingy does not have a datomic dependency.

fragamus13:01:57

But I like the sound of simply making the server broadcast all remote mutations.

fragamus13:01:19

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-sora17:01:38

Yes!!! I got it working!

sova-soars-the-sora17:01:43

Serverside rendering!!!! 😄

sova-soars-the-sora17:01:42

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

tony.kay18:01:57

@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

tony.kay18:01:26

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-sora19:01:50

@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-sora19:01:19

(on the topic of post-mutation datomic broadcast)

fragamus19:01:55

It would be a luxurious way to live.

fragamus19:01:18

But luxury is often expensive.

tony.kay21:01:34

@sova Depends on how much you like paying for bandwidth

tony.kay21:01:45

your mobile user's certainly won't appreciate it

tony.kay21:01:22

and of course frequency of updates....a few a minute system wide...fine. More than that? Bleh

tony.kay21:01:09

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