untangled

NEW CHANNEL: #fulcro
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)

tony.kay 2017-01-06T01:05:06.001840Z

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

fragamus 2017-01-06T07:52:57.001847Z

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?

fragamus 2017-01-06T07:57:24.001848Z

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

fragamus 2017-01-06T08:27:51.001849Z

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

ianchow 2017-01-06T08:35:20.001850Z

@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
fragamus 2017-01-06T11:01:49.001855Z

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

1
fragamus 2017-01-06T13:40:06.001856Z

Well that websockets thingy does not have a datomic dependency.

fragamus 2017-01-06T13:40:57.001857Z

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

fragamus 2017-01-06T13:47:19.001858Z

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

exit2 2017-01-06T18:12:12.001862Z

congrats

tony.kay 2017-01-06T18:13:57.001863Z

@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.kay 2017-01-06T18:14:26.001864Z

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)

fragamus 2017-01-06T19:18:55.001867Z

It would be a luxurious way to live.

fragamus 2017-01-06T19:19:18.001868Z

But luxury is often expensive.

😆 1
tony.kay 2017-01-06T21:38:34.001873Z

@sova Depends on how much you like paying for bandwidth

tony.kay 2017-01-06T21:38:45.001874Z

your mobile user's certainly won't appreciate it

tony.kay 2017-01-06T21:39:22.001875Z

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

tony.kay 2017-01-06T21:40:09.001876Z

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