Fork me on GitHub
#re-frame
<
2016-08-01
>
mikethompson08:08:01

@rodeorockstar: I've been dwelling on how I can catch that bug (programming error), but no inspiration so far.

danielcompton08:08:50

debug middleware which checks if the keys on a key match the root keys?

danielcompton08:08:15

Schema checking more generally would catch it too

mikethompson08:08:53

Death to middleware. Long live interceptors. But you are right about schema checking. That finds problems instantly. Although ... the trick is still be to explain the problem. Forgetting to put -fx on the registration fn is a bit subtle.

si1410:08:48

@mikethompson: thanks a ton for a thorough answer! Re 2: I mean "join" in a general sense, as in "store "objects" in a map by id and use IDs if a particular order and/or relations are needed". So in that case I store IDs in the order in which I received packages from the server and have a map of all packages in one place so I can "change" them in only one place if needed. Is it an anti-pattern? I've saw you use TreeMap in todomvc example to preserve ordering. Do you think this is the better way? How do you usually handle links (like if package can be "inside" some other entity)? Re 3: So your re-frame db structure reflects the form of the data you receive from the server? Do you requery data and recreate large part of the state if you have the same "object" in several places? Makes sense; maybe I overengineer things. Again, thanks a lot for your insight and the project itself. Definitely one of the best experiences I had with opensource projects :)

mattsfrey16:08:58

Interesting points about middleware, I am actually just now setting up unit tests for re-frame actions and saw the recommendation to use middleware for schema checking the app-db after state altering dispatches i.e. https://github.com/Day8/re-frame/wiki/Testing#event-handlers---part-2

mattsfrey16:08:06

is this no longer considered good practice?

mikethompson20:08:50

@mattsfrey keep going on that path described. In the next version, instead of middleware there will be interceptors. But I'm able to do that in a backwards compatible way. So instead of an after middleware, there will be an after interceptor .

johanatan20:08:38

Hi, does anyone know how to use js/React.addons.CSSTransitionGroup with re-frame?

johanatan20:08:20

well, actually my only hurdle is the dependency itself since re-frame includes re-agent which includes react

johanatan20:08:25

and I need the react-addons instead

johanatan20:08:13

would i just put the :exclusions clause on the re-frame dependency instead?

johanatan20:08:27

I just tried with :exclusions on reagent and no luck

mikethompson20:08:32

lein deps tree will help

johanatan20:08:34

will add to re-frame as well

mikethompson20:08:45

or boot show -d (so I'm told)

johanatan20:08:13

lein deps :tree you mean? 😉

mikethompson20:08:11

Yeah, that one 🙂

johanatan20:08:30

That got me the CSSTransitionGroup but it broke other stuff

mikethompson20:08:48

Hmm. Sorry, I haven't had to do this, so I'm not much help

johanatan20:08:14

Oh, no worries. I'm just trying to straighten out the other dependencies. Seems everything wants different versions of each other.

johanatan20:08:21

[just have to find the right combination]

johanatan21:08:14

I found a combination that seems to work. 🙂

mikethompson21:08:35

@johanatan: publish here for posterity

johanatan22:08:51

Ahh, ok. Just a sec

johanatan22:08:05

(defproject your-project "0.1.0-SNAPSHOT"
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [org.clojure/clojurescript "1.8.51"]
                 [reagent "0.6.0-rc" :exclusions [cljsjs/react]]
                 [cljsjs/react-with-addons "15.3.0-0"]
                 [re-frame "0.7.0" :exclusions [cljsjs/react]]
                 [re-com "0.8.3"]
                 [cljsjs/fixed-data-table "0.6.0-1" :exclusions [cljsjs/react]]]
...)
I included fixed-data-table because it needed the exclusions too.

johanatan22:08:42

So, is anyone using SASS or LESS for their re-frame CSS? I'm trying to keep my CSS stylesheet to a bare minimum but unfortunately it's grown to the point where it could use a factoring.