ldnclj

Find us on #clojure-uk
2016-02-09T06:11:43.000377Z

Static analysis and generative testing interest me greatly.

pupeno 2016-02-09T08:19:21.000378Z

Good morning.

2016-02-09T08:24:13.000379Z

Morning

jarohen 2016-02-09T08:41:37.000380Z

morning folks :simple_smile:

agile_geek 2016-02-09T08:45:52.000381Z

Bore da

pupeno 2016-02-09T08:59:44.000382Z

Anybody has a good technique to dispatch on the current route and select different react components with om next? I’m using multimethods wrapping the factories that wrap the react components and it feels a bit too verbose:

pupeno 2016-02-09T08:59:49.000383Z

(defui AboutPage
  Object
  (render [this]
    (dom/div "This is the about page")))

(def about-page (om/factory AboutPage))

(defmethod layout/pages :about [_]
  (about-page))

jarohen 2016-02-09T09:01:39.000384Z

if you don't need open-dispatch, would case/clojure.core.match work?

agile_geek 2016-02-09T09:02:32.000385Z

I was thinking core.match too but to be honest not exactly sure how I would implement it without it being reasonably verbose.

pupeno 2016-02-09T09:03:41.000386Z

@jarohen: I consider that approach, but that would require having a central place to connect page names to react components instead of it being all together next to the page implementation. Now, routing is central, so, I kind of already have that.

pupeno 2016-02-09T09:04:01.000387Z

(def routes (silk/routes [[:home [[]]]
                          [:tools [["tools"]]]
                          [:tool [["tool" :slug]]]
                          [:about [["about"]]]
                          [:register [["register"]]]
                          [:log-in [["login"]]]
                          [:reset-password [["reset-password"]]]
                          [:change-password [["change-password"]]]
                          [:fail [["fail"]]]]))

agile_geek 2016-02-09T09:04:18.000388Z

I've just started looking at om next and it does strike me that there's a bit of 'boiler plate'. Mind, I am used to Spring MVC and JSF so I can't complain!

pupeno 2016-02-09T09:04:47.000389Z

@agile_geek: it feels more verbose than re-frame so far, but then, it does more.

jarohen 2016-02-09T09:05:31.000390Z

@pupeno: yes, although I usually find that I'm already require-ing all of the defmethods in a central place :simple_smile:

agile_geek 2016-02-09T09:05:53.000391Z

@pupeno: I think that was my take away with Om. I suspect trivial SPA's are easier/quicker in re-frame/Reagent but Om/Om Next is probably more scalable?

pupeno 2016-02-09T09:06:28.000392Z

Yes, I have a core.cljs that requires everything.

pupeno 2016-02-09T09:07:51.000393Z

@agile_geek: for me, personally, the jury is out on Om Next, but if it’s a positive outcome, I would say that you are correct that re-frame is easier/quicker than Om Next for small SPAs where small is 1 or less API calls to the server, so, very small.

jarohen 2016-02-09T09:08:04.000394Z

mm - it's for that reason I usually only use multimethods when someone else (i.e. a downstream library consumer) has to write a defmethod - e.g. same as clojure core's print-method

pupeno 2016-02-09T09:11:16.000395Z

I wonder if I could have *functions* as the name of the route… muahahaha

thomas 2016-02-09T09:21:43.000396Z

morning

pupeno 2016-02-09T09:29:12.000397Z

Argh… circular dependencies 😞

agile_geek 2016-02-09T09:31:23.000398Z

I think it's interesting that we don't have a fairly clear approach to cljs architecture (the Clojure story is a little more mature). I know Om Next is new but there's still a lot of discussion around Reagent and that's been around a while. It's these decisions and...dare I say it, patterns, that make the learning curve steep for experienced dev's coming from another, more mature, environment.

thomas 2016-02-09T09:31:48.000399Z

I think my impression is similar.. Om-next seems very complicated… but then I probably don’t understand the problem it tries to solve really.

pupeno 2016-02-09T09:32:16.000400Z

@agile_geek: I agree that it’s not there and it should be there but I think many devs believe it shouldn’t.

pupeno 2016-02-09T09:32:50.000401Z

@thomas: building SPAs.

thomas 2016-02-09T09:33:05.000402Z

which is something I have never done.

agile_geek 2016-02-09T09:33:08.000403Z

@pupeno: I want to explore your idea of getting the 'great and the good' in this area together to discuss what we do about this.

thomas 2016-02-09T09:33:08.000404Z

:simple_smile:

agile_geek 2016-02-09T09:35:32.000405Z

If we have this much variability and discussion about how to build a SPA what is the story like on cross cutting concerns, like security for example. I love the variation of opinion in the community but I don't think it helps someone who just wants to ship software

pupeno 2016-02-09T09:35:58.000406Z

@agile_geek: agreed.

pupeno 2016-02-09T09:37:01.000407Z

One of my vague plans is to find a pattern that I’m happy with, it was re-frame but then I notice some problems that Om Next promises to solve and once I find the pattern, add it to luminus, so doing lein new luminus projectx +spa will get you started.

xlevus 2016-02-09T09:39:09.000408Z

I like re-frame for its simplicity. But the lack of multiple event handlers (which may be intentional on their behalf, and could probably be solved with a bit of scaffold yourself) is slightly annoying.

xlevus 2016-02-09T09:39:29.000409Z

Om's cursors are weird.

agile_geek 2016-02-09T09:39:58.000410Z

@pupeno: I'd like to talk about how we get something like that established. Do we stick our heads above the parapet and write a series of blogs on 'patterns'? I'm sure we will get plenty of rotten tomatoes thrown our way!

pupeno 2016-02-09T09:40:12.000411Z

@xlevus: re-frame’s developer is very approachable and open to improvements. We implemented together a hook function in re-frame to integrate with my own Prerenderer library.

pupeno 2016-02-09T09:40:23.000412Z

@xlevus: Om Next doesn’t have cursors.

xlevus 2016-02-09T09:40:33.000413Z

yeah, haven't looked at om-next.

agile_geek 2016-02-09T09:41:16.000414Z

Yeah, I quite like that Om Next has ditched cursors as I struggled with the concept. It seems to be a simpler query/pattern matching approach now?

pupeno 2016-02-09T09:41:34.000415Z

@agile_geek: I don’t think you can move forward in this direction without writing code. You can explore the ideas with blog posts to invite criticism and improve them, but you can also improve code over time. And I can take the rotten tomatoes 😉

agile_geek 2016-02-09T09:42:25.000416Z

@pupeno: I agree. I would not suggest we talk about it in the abstract. Need, probably several iterations, of code to prove it.

mccraigmccraig 2016-02-09T10:33:21.000417Z

@xlevus: what dyu mean with "the lack of multiple event handlers" in re-frame ?

xlevus 2016-02-09T10:33:37.000418Z

You can only have one handler bound to one event afaik.

mccraigmccraig 2016-02-09T10:34:06.000419Z

oh, i see - you are thinking pub/sub...

xlevus 2016-02-09T10:34:15.000420Z

yeah

mccraigmccraig 2016-02-09T10:35:13.000421Z

you would need some way of specifying a priority list for handlers of an event then... i can see why they stuck with a single handler

xlevus 2016-02-09T10:38:49.000422Z

yeah

2016-02-09T10:48:52.000423Z

You can bind multiple subscribers to a subscription can't you? Would you not have one event from source to app state, and multiple on way back up?

xlevus 2016-02-09T10:49:13.000424Z

yes

2016-02-09T10:49:16.000425Z

Maybe I'm being naïve, only created a fairly noddy app with it.

xlevus 2016-02-09T10:50:10.000426Z

That's probably the right way to do it

progzilla 2016-02-09T20:11:29.000427Z

@agile_geek: just want to ask. are we going to ever something like for ClojureBridge for the male gender? Sometimes its not so easy for some beginners to learn from the dojos..just saying..