Clojurians
#re-frame
<
2018-01-30
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

vincent.cantin00:01:49

Thank you. I will learn from your code.

danielcompton12:01:29

New version of re-frame-trace with a bunch of new stuff: https://github.com/Day8/re-frame-trace/releases/tag/0.1.17

mikethompson12:01:02

Many thanks to @danielcompton. ^^^ We're starting to get closer to the vision with re-frame-trace. Now is the time to try it, if you haven't already. Please send feedback.

andrzejsliwa13:01:04

:jvm-opts ["-XX:+IgnoreUnrecognizedVMOptions" "--add-modules java.xml.bind"] 
This should work on 7,8,9 without modification

philippmarkovics13:01:45

hi, i just updated my deps for re-frame-trace 0.1.17 and getting this error now:

philippmarkovics13:01:48

Failed to compile "clj/server/resources/public/js/nextjournal.js" in 15.423 seconds.
----  Could not Analyze  clj/server/resources/public/js/compiled/out/editor/mranderson047/garden/v1v3v3/garden/color.cljc  ----

  java.lang.ClassNotFoundException: garden.types.CSSAtRule, compiling:(mranderson047/garden/v1v3v3/garden/util.cljc:1:1)

----  Analysis Error : Please see clj/server/resources/public/js/compiled/out/editor/mranderson047/garden/v1v3v3/garden/color.cljc  ----

philippmarkovics13:01:00

anybody else having similar issues?

manuel13:01:24

same issue here

mikethompson13:01:29

@philippmarkovics @manuel daniel will have gone to bed. 2am in New Zealand. So probably no progress on this till tomorrow.

philippmarkovics13:01:57

no worries :slightly_smiling_face:

manuel13:01:13

no problem, of course

mikethompson13:01:15

In his release notes he does note: > The version of Garden that re-frame-trace uses is now bundled as a source dependency so you should no longer get conflicts if you use Garden 2.

mikethompson13:01:27

So, something has happened with Gargen

mikethompson13:01:53

Can you provide details for the version of Garden you are using (if any) in your app

manuel13:01:49

no explicit use of Garden on my side

mikethompson13:01:44

Which version of the clojurescript compiler are you using?

mikethompson13:01:34

Also, did you also upgrade to re-frame 0.10.4?

danielcompton20:01:03

@manuel @philippmarkovics I've fixed this in https://github.com/Day8/re-frame-trace/releases/tag/0.1.18, sorry about that

zalky21:01:05

Hi all, I have a general question about concurrency and db changes due to events. I'm thinking of something like a general submit event:

(f/reg-event-fx :submit
  (fn [db _]
    (let [selection (get db :some/selection)]
      {:request {:remote [:remote/event selection]
                 :cb [:event/success]}})))
Here, a :submit event was triggered, and it reads the selection from app state (presumably selection happened in a separate event). Is it possible for a race condition to occur where some other events mutates the value of the db, possibly changing the :some/selection, before this event is processed?

zalky21:01:03

I know changes to ratoms are synced across requestAnimationFrames, so that two events that are processed at the same time are likely to see the same value of db, regardless of which one gets processed first, but I don't have enough insight into the internals re-frame to really know the implications in practice.

mikethompson21:01:23

@zalky Events are processed serially, one at a time. Everyting about an event, including the event handler itself and any associated effects handlers will be finished before the next event is proccessed.

zalky21:01:17

@mikethompson: ok, so given two events processed serially, if the first makes any mutations on app state, the second is guaranteed to see it? I think I may have confused reactions being synched across animation frames, with ratoms.

mikethompson22:01:08

@zalky The answer to your question is "yes".

mikethompson22:01:21

I add this info graphic recently ... it doesn't directly answer your question ... but it may help

zalky22:01:56

@mikethompson, thanks, that's super interesting. The graph gives the impression that there is one window during the react cycle where events can be queue for dispatch, after which, they must wait until after the next animation? Or are there multiple blue/green sequences before the purple view one?

zalky22:01:38

Awesome, that is a great doc string.

shaun-mahood23:01:15

I'm getting a new error that I'm not sure where to start dealing with The error message is No protocol method IAssociative.-assoc defined for type cljs.core/LazySeq:. I'm trying to grab a vector from my app-db and assoc a new value at an index position. Here's a snippet from my reg-event-db function

(assoc db 
:works (assoc [1 2 3] 2 "hooray")
:nope (assoc (get-in db [:app :services]) 1 "boo"))
Any ideas?

madstap23:01:13

Looks like what you think is a vector is actually a lazy seq

madstap23:01:50

It's an easy mistake to make, using a sequence function on a vector and thinking you've still got a vector

madstap23:01:05

As a workaround/to make sure that's the mistake you can try something like (assoc (vec (get-in db [,,,])) 1 "foo")

shaun-mahood23:01:40

@madstap: Fantastic, thanks! I was going down other rabbit holes and didn't consider that at all