Fork me on GitHub

is there a support group for cljs veterans new to re-frame / reagent? 🙂 i feel like i’m on the first day of the job again, butting my head against React basics…


of course, now that i’ve said that, i figured it out


always happens to me 😉


Got a problem getting the new event code tracing feature of re-frame-10x working. Got the dependancy [ "0.5.0"] in the dev profile in project.clj but compile fails when I add the :require to my namespace. Tried 2 variations that appear in the install instructions, [ :refer-macros [fn-traced]] and [ :refer [fn-traced defn-traced]] Both give the same message via figwheel:

Could not Analyze app/dev/js/out_front/day8/re_frame/tracing.cljc 
clojure.lang.Compiler$CompilerException: java.lang.Exception: namespace 'debux.common.macro-specs' not found, compiling:(debux/dbgn.clj:1:1)
Have I missed something obvious here?


@soulflyer if you lein deps :tree do you see debux somewhere in the output?


ok, so in your position, i’d track down the correct dependency by reading 10x source and manually include it in your project. if that fixes it, then you have the basis for a bug report for the 10x project 🙂


hmm, rgrep isn't finding any mention of debux in the 10x source anywhere except in various .md files.


guess you’ll need to add it yourself then


i’m literally on day one with re-frame - i plan to visit where you are tomorrow, so, thank you 🙂


I think the 10x team forked debux and made some big changes. Adding the original back in might not have the desired effect...


does re-frame provide a more formal method for loading data when a component is displayed, beyond simply using a form-3 component with a :component-did-mount fn?


so, i’m talking specifically about the place where i call the dispatch that does the http call to populate the data for the view that’s just been displayed. e.g. i click a list item, go to the detail page. now i need all the detail data. when do i trigger that detail load? currently i have this, which works:


(defn load-event-for-editing [event-slug]
  (rf/dispatch [:bridge.event.ui/event-for-editing [:event/slug event-slug]]))

(defn edit-event [event-slug]
   {:display-name        "edit-event"
    :component-did-mount (fn [_]
                           (load-event-for-editing event-slug))
    (fn [_]
      (if-some [{:event/keys [title slug status start-date end-date
                (get @(rf/subscribe [:bridge.event.ui/events]) event-slug)] …


Hi! This problem is the main reason for creating . Just stumbled upon this message now while browsing 🙂


yep, i know about kee-frame. i’m this close to adopting it in bridge 🙂


That would obviously make me very happy


i’m wondering if there’s a more formal place to declare that ‘load this after mount’ event that i’m currently using react interop for


because i’d like to avoid using form-3 components if possible


@robert-stuttaford In a re-frame app, the data is usually loaded before the view is mounted so that view components can be as simple as possible. Usually you would have events that loads the data you want into the db and cause the related view to be mounted by setting the related states in the db.


@robert-stuttaford that "load on mount" approach is *not* axiomatic re-frame


@mikethompson so how should i model this? this view could be directly triggered by a route, or by a dispatch due to clicking a link, so i don’t want to fire off the load at all of these call-sites. is there perhaps sample code around this sort of thing that i can read to osmose some patterns into my brain? 🙂 fwiw, i’m doing this as part of an intentional learning-in-the-open project. you can see all my code here:


Sorry, I started writing and then stopped because I thought "I have to write an FAQ on this"


Wouldn't it be better to use defonce only for the live-intervals atom? Atom would then be accessible from the whole namespace, but on the other hand - you can modify the handler which can be properly hot reloaded?


that’s totally the right thing to do. i’ll read it when it’s ready 😉


in your own time, please — no rush from me!


The above is quite a reasonable explanation


you get what i’m after, though, right?


i’ll chew on it, thanks


ok - so basically, i should always use the event dispatch mechanism, and chain together as many of those as i need. i guess the key thing i’m looking for is to be able to know when i need to trigger that load side-effect in the re-frame paradigm. i guess i have to let go of the coupling between the address bar and the intended state, and break it all down into events, and then let both the routing and normal nav gestures compose with those events. right now it’s all a little too conveniently tied to the routing


i do think a quick code sample covering the essential bits will go a long way to getting ones mind around the re-frame way here


@soulflyer Are you using the right version of re-frame-10x for the version of React you are using?


There is a version of re-frame-10x for React16 and another for React15. Choose wisely. Your error message doesn't seem related. But it is my first suspicion.


tried it with both 0.3.0-1-react16 and 0.3.0 and still get the same error.


Weird things can happen when you get it wrong.


Note the use of the :http-xhrio effect from


@robert-stuttaford I've done the FAQ entry (it is not much more than what I have already pointed out):


@robert-stuttaford @soulflyer sorry about the re-frame-10x problems. @danielcompton is away for another day and he's best to figure out these two issues. I'm just not close enough to the code.


@mikethompson No worries, I can wait