This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-14
Channels
- # beginners (74)
- # boot (23)
- # braid-chat (7)
- # cider (5)
- # clara (3)
- # cljsjs (17)
- # cljsrn (1)
- # clojure (105)
- # clojure-austin (9)
- # clojure-new-zealand (34)
- # clojure-poland (2)
- # clojure-russia (177)
- # clojure-uk (41)
- # clojure-ukraine (2)
- # clojurescript (130)
- # component (1)
- # core-async (2)
- # core-matrix (6)
- # cursive (7)
- # data-science (103)
- # datomic (24)
- # emacs (15)
- # funcool (4)
- # hoplon (21)
- # immutant (151)
- # ldnclj (76)
- # melbourne (1)
- # off-topic (8)
- # om (152)
- # om-next (1)
- # onyx (26)
- # parinfer (38)
- # re-frame (13)
- # reagent (14)
- # spacemacs (1)
- # vim (92)
- # yada (1)
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 clojure.data/diff of the db, before vs after, showing the changes
caused by the event."
[handler]
(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 "clojure.data/diff for: " v)
(.log js/console "only before: " (first diff))
(.log js/console "only after : " (second diff))
(.groupEnd js/console)
new-db)))
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: https://github.com/Day8/re-frame/blob/master/CHANGES.md#070--2016-03-14
> 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).
Nice! 👍
I have a question regarding https://github.com/Day8/re-frame-template . 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..
@fasiha: Left you some info: https://github.com/Day8/re-frame-template/issues/24
@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.