Fork me on GitHub

For those that use the offical re-frame debug middleware ... we're switching to use a version which looks like this:

(defn my-debug
  "Middleware which logs debug information to js/console for each event.
  Includes a of the db, before vs after, showing the changes
  caused by the event."
  (fn debug-handler
    [db v]
    (.log js/console (str "%cre-frame event: " v) "font-size: 125%; background: #888; color: white")
    (let [new-db  (handler db v)
          diff    (data/diff db new-db)]
      (.groupCollapsed  js/console " for: " v)
      (.log js/console "only before: " (first diff))
      (.log js/console "only after : " (second diff))
      (.groupEnd js/console)
Features: 1. via styling, really highlights new events in console, which makes it easier to grok what is happening. 2. No longer hides all console output for an event handler in a console "group". Which used to be confusing sometimes. Hey where did my debug print go?? Oh, its hidden down in that closed group. 3. Outputs cljs values to console (rather than strings), allowing cljs-devtools to be better used.


Remember the "official middleware" are just examples. You can write your own. Then add them to your own handlers.


A new re-frame version will be in clojars in about 7 hours from now (just as soon as someone wakes up).: Nothing very sensational in it. Just a small, incremental advance. Specifics:


> debug middleware now produces slightly different output (to console). So no code will need to change, just your expectations of what you see in console. Previously all console output from an event handler was put into the one console group, which could lead to exceptions being hidden (down in a closed group).


I have a question regarding . Am I understanding this right, that the template is meant for JUST a frontend? As "cljsbuild once min" will just build the js and the application will have nothing to connect to without figwheel?


Also related, any tips on deploying an app made with this template to heroku?


+heroku is a desire profile, but alas..


@not-much-io: I don’t have a lot of experience with re-frame-template but I have a re-frame app that uses reagent-template (which does include a backend).


re-frame-template is aimed just at producing an SPA using re-frame, re-com and garden - but no backend server. Hmm. My information might be out of date. Looking again, I notice that there's a +compojure option which might, these days, include some server code.


Frankly, the reason I chose reagent-template over re-frame-template wasn’t the presence of backend, but rather the presence of the +sass option. 😉


because I was just too lazy to try to wire up Sass support, but it was easy to wire in re-frame support atop reagent-template.