Fork me on GitHub
#ldnclj
<
2015-08-18
>
agile_geek08:08:15

is on Busman’s Holiday at Mastodon C

mccraigmccraig08:08:59

agile_geek: clojure all day ?

mccraigmccraig08:08:38

@agile_geek: i've got a nice monad here i can sell you. only one previous owner, a little old lady, very careful, she never bound it more than once a day

agile_geek08:08:47

@mccraigmccraig: ahh, but if I eventually come to understand it will I lose the ability to explain it to anyone else?

mccraigmccraig08:08:22

@agile_geek: that is part of the deal you have to strike. now i've said too much

mccraigmccraig09:08:20

@pupeno: i gave up on the nice-urls thing a while back... it was seductive, but ended up making it difficult to distinguish between requests for static content (served by a reverse-proxy) from in-page routes

Pablo Fernandez09:08:42

I’m serving static content with compojure itself.

mccraigmccraig09:08:49

i think if you enforce some rigid route hygiene, such that in-page routes are always easy to distinguish from other routes with a simple path regex, you should be ok... i hadn't thought about the problem up-front though, so it would have been a pain to change

Pablo Fernandez09:08:09

When compojure receives a request, first test if it’s for the api in /api, if not, it checks for static content, if there’s no static content, it serves the app itself.

mccraigmccraig09:08:41

the problem with that approach is that you never get 404s... you get a load of html instead

Pablo Fernandez09:08:27

That is true, because routing happens in the client.

Pablo Fernandez09:08:23

My plan is to run clojurescript on the server and pre-render the page so you get a finished page for the URL you requested plus the SPA. I’ll be able to generate 404s there. I was told reagent’s website does this.

Pablo Fernandez09:08:35

I know some people are attempting that with ember+node

mccraigmccraig10:08:46

server-side render of an SPA with state is pretty darn cool

malcolmsparks10:08:17

I have a blog article in the works how to do this in bidi with bidi/router.cljs from @jarohen - there's just no other docs right now

Pablo Fernandez10:08:07

malcolmsparks: do you mean client routing or sever-side rendering SPAs?

mccraigmccraig11:08:26

@malcolmsparks: hows the next version of yada coming along ? i just hit what looks like a bug (if an :authorized fn returns a Deferred it's treated as true rather than a deferred value) and am wondering if i should upgrade ?

agile_geek12:08:12

Anyone who fancies building an event management system in Clojure (and teaching me some cljs in the process) don’t forget the new Project based Clojure Dojo tonight. https://docs.google.com/forms/d/1SgT6dQksU3eDDJp37cX2dzcDRODEPF1-wDWEJJA2uL0/viewform Doors open 6pm for brainstorming and pizza, real action kicks off at 7pm.

wyan12:08:09

that sounds interesting!

malcolmsparks12:08:49

@pupeno: I mean client-side routing, just the basics, but I'm interested in the latter (just don't know yet how to do it)

Pablo Fernandez12:08:22

malcolmsparks: are you using re-frame too?

malcolmsparks12:08:56

@mccraigmccraig: which version of yada are you using? I'm regularly releasing on the 1.0 beta branch now so you should check README.md for the latest - security needs a revamp though, so possibly that bug still exists, I'll raise a github issue

malcolmsparks12:08:12

@pupeno: for the blog article, I've used reagent actually - haven't yet played with re-frame

malcolmsparks12:08:29

but the code is much the same for the routing

malcolmsparks12:08:33

@mccraigmccraig: the next release of yada is going well, it had another big revamp recently because etags (and that required a huge overhaul of content negotiation, which took most of the programming time I had on my recent holiday). But I don't think there are other unimplemented parts of the HTTP spec. now that are going to cause such a impact

malcolmsparks12:08:56

it should be just filling in the gaps mostly from now on

mccraigmccraig12:08:29

@malcolmsparks: cool, thanks - i'll upgrade to the beta branch then and see how it goes

malcolmsparks12:08:02

definitely try 1.0, I've fixed SSE and there's enough docs/examples now that should get you through - I'll on 1.0-SNAPSHOT until Clojure Exchange, when I hope to remove -SNAPSHOT simple_smile

malcolmsparks12:08:27

(but clojars releases are tagged, so depend on those, to prevent surprises)

mccraigmccraig12:08:47

oh, there's no 1.0-beta branch on github... just tags

malcolmsparks12:08:34

I mean [yada "1.0.0-20150816.005601-4"]

jonpither12:08:38

Anyone got CIDER + clj-refactor working to clean up cljs ns forms?

malcolmsparks12:08:17

surely we're talking cljc these days though 😉

jonpither12:08:42

clojurescript has extra funkage. i.e. require-macros

jonpither12:08:12

So the clj-refactor bindings, when run in cljs files, kills my emacs

Pablo Fernandez16:08:52

Who is going to the Project Clojure Dojo today?