Fork me on GitHub
#yada
<
2015-08-04
>
maleghast08:08:43

Anyone in..?

maleghast08:08:02

I’m just wondering why I get a “No such template: yada” when I run lein new modular yada-demo yada

malcolmsparks08:08:21

Oh, because it's what I call a 'forward-looking feature'

malcolmsparks08:08:04

but I'm going on holiday tomorrow so I'll have time to fix up the yada template - it's not far away

maleghast08:08:00

@malcolmsparks: Oh thanks Malcolm simple_smile In the meantime I’ll start a Yada proj the old-fashioned way, without modular, and see if I can get it working

maleghast08:08:13

I’ve been reading the docs and they’ve gotten me all excited!

maleghast08:08:04

I suppose I could use one of the other modular templates and then add yada and bidi in myself too, right?

malcolmsparks09:08:10

yes exactly, it's quite easy to add the dependencies afterwards

ordnungswidrig09:08:34

hey, malcolm, regarding printing bidi route seq...

ordnungswidrig09:08:42

(->> (routes) bidi.bidi/route-seq (map :path) (map prn))
will print all your routes but it looks like this:

ordnungswidrig09:08:40

Optional is like (alts „whatever„ „“)

malcolmsparks09:08:13

hmm - you have all the components of each route there, it's up to you to stitch them together - do you think bidi should provide functions for that? the danger of doing that automatically is you lose information that could be needed by someone

ordnungswidrig09:08:30

I don’t know, I’ve written a defmulti which does some formatting:

ordnungswidrig09:08:35

(|/|/ui) /api(/?) /api/users(/?) /api/users/:id(/?)

ordnungswidrig09:08:16

it’s a little crude and a pseudo regex style for alts with „|“ and opts with „?“ but it gives me a quick visual overview

malcolmsparks11:08:50

the problem is there could be custom records in there, and you can't tell how to flatten them

malcolmsparks11:08:12

I think that's the problem with everything as data, but it stills beats everything as one composed function 😉

ordnungswidrig11:08:47

that’s right. I have this custom record here (Optional) but it’s easy a it gets to add the defmethod for it

ordnungswidrig11:08:43

I just looked into the yada master codbase, and I find yada starts getting into the same trap as liberator: it complects a lot of stuff, the entity ( resource) "model" and the resource „implementation" in core.clj. The resource function is huge, monolithic and does multiple things: * derive a resource entity model from the resource parameter. (Does is exist, what can I do to the entity represented by the resource) * derive the http resource model from it (available methods, content-types, negotiation)

ordnungswidrig11:08:37

I think there’s an opportunity to separate these steps where the latter would receive a data structure which, as I figure, would resemble a liberator resource definition somehow.