Fork me on GitHub

is on Busman’s Holiday at Mastodon C


agile_geek: clojure all day ?


@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


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


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


@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.


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.


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


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


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?


@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 ?


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. Doors open 6pm for brainstorming and pizza, real action kicks off at 7pm.


that sounds interesting!


@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?


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


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


but the code is much the same for the routing


@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


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


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


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


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


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


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


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


surely we're talking cljc these days though 😉


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


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?