ldnclj

Find us on #clojure-uk
pupeno 2015-08-19T05:47:31.000523Z

Good morning.

jonpither 2015-08-19T07:39:55.000524Z

morning

thomas 2015-08-19T07:48:35.000525Z

Hi, it's me... I am back again.

jonpither 2015-08-19T07:49:02.000526Z

howdy

malcolmsparks 2015-08-19T08:34:01.000527Z

@pupeno: your blog has been really useful to me, thanks very much - I've used bidi rather than silk (I'm a bit biased towards bidi) but that was easy because pushy explains exactly how to use either - nice article

malcolmsparks 2015-08-19T08:34:32.000528Z

and re-frame is really a great addition to reagent

pupeno 2015-08-19T08:35:26.000529Z

malcolmsparks: I’m glad. What are your reasons for bidi?

pupeno 2015-08-19T08:35:49.000530Z

malcolmsparks: my main reason for silk is that the author hangs out in slack and is accessible. :simple_smile:

malcolmsparks 2015-08-19T08:46:23.000531Z

@pupeno: I wrote bidi

pupeno 2015-08-19T08:46:38.000532Z

malcolmsparks: ah! :simple_smile:

pupeno 2015-08-19T08:47:30.000533Z

There goes the silk advantage. 😕

pupeno 2015-08-19T08:47:50.000534Z

Did you look at silk?

malcolmsparks 2015-08-19T08:50:11.000536Z

"Bidi is a fantastic library and was my favorite Clojure routing library prior to Silk. The design of Silk was heavily influenced by that of Bidi."

malcolmsparks 2015-08-19T08:51:06.000537Z

bidi came before silk, and if you look at the 2 code-bases they are very similar - the main rationale for silk was that it was to support cljs, but now bidi supports cljs too there's not so much difference

malcolmsparks 2015-08-19T08:52:16.000538Z

there are some slight differences in how the routing works - in particular bidi avoids dispatching on query parameters, because I'm still a bit of a purist at heart and that feels just wrong to me

malcolmsparks 2015-08-19T08:53:20.000539Z

I also want bidi to stay true to its (strict) REST routes, so it encourages hypermedia APIs (that's the whole point actually) and doesn't want to subvert REST by redefining what it means to be a resource

malcolmsparks 2015-08-19T08:54:12.000540Z

@pupeno: quick question, what's the main advantage to avoiding doc fragments? it seems nice to me, because it means you can decouple the structure of your single page apps from the routing

malcolmsparks 2015-08-19T08:54:47.000541Z

so if I want to break up a huge SPA into sub-apps, or recombine multiple apps into a single monolith, I can do that without breaking URIs - that seems a good advantage to me - but are there others?

pupeno 2015-08-19T08:55:41.000542Z

malcolmsparks: thanks for the answers, and what do you mean by doc fragments?

malcolmsparks 2015-08-19T08:55:55.000543Z

sorry, I meant # in the uris

malcolmsparks 2015-08-19T08:56:02.000544Z

fragment is the bit after the #

malcolmsparks 2015-08-19T08:56:08.000545Z

your URIs are fragment-less

pupeno 2015-08-19T08:56:08.000546Z

I thought so.

malcolmsparks 2015-08-19T08:56:27.000547Z

is HTML5 push-state the magic there? and is it supported by lots of browsers now?

pupeno 2015-08-19T08:58:40.000548Z

I am also a purist and I don’t thing fragments should be used to specify which page to show, only to scroll. Also, they are not send in HTTP requests (as far as I know), so the server can’t pre-render the appropriate page.

pupeno 2015-08-19T08:59:17.000549Z

I’m sure Google is not doing it anymore, but it wouldn’t be wrong to assume that /#/user/1 and /#/user/2 are the same page, from an indexing point of view, when the content is different.

pupeno 2015-08-19T09:00:17.000550Z

And yes, HTML5 allows you to handle the URL change events so that you can avoid hitting the server. It’s quite well supported: http://caniuse.com/#feat=history

malcolmsparks 2015-08-19T09:04:05.000551Z

ah, that's a good point, you're right

malcolmsparks 2015-08-19T09:04:31.000552Z

Google have a #! convention for that specific case

malcolmsparks 2015-08-19T09:04:54.000553Z

https://support.google.com/webmasters/answer/174992?hl=en

thomas 2015-08-19T09:18:37.000555Z

@agile_geek: something for you: https://github.com/IonicaBizau/node-cobol/

thomas 2015-08-19T09:18:39.000557Z

😉

agile_geek 2015-08-19T09:19:15.000558Z

@thomas: Real programming! 😉

benedek 2015-08-19T10:39:13.000560Z

@jonpither: missed your previous comment (bad excuse but was on holidays), expez is working on a version of clean-ns on this branch: https://github.com/clojure-emacs/refactor-nrepl/commits/cljs-support meanwhile remove-requires should work on cljc/cljs files too

pupeno 2015-08-19T15:37:53.000563Z

@malcolmsparks: in bidi, how do I match the empty route? I can match “/“ and “/about” with (def routes ["/" {"" :home-page "about" :about-page}]), but how do I match “”?

pupeno 2015-08-19T15:48:33.000564Z

This seems to work:

pupeno 2015-08-19T15:48:34.000565Z

(def routes ["" {""       :home-page
                 "/"      :home-page
                 "/about" :about-page}])

malcolmsparks 2015-08-19T19:42:31.000567Z

you can use boolean true as a pattern

malcolmsparks 2015-08-19T19:42:48.000568Z

`(def routes ["" {"" :home-page "/" :home-page "/about" :about-page}])`

malcolmsparks 2015-08-19T19:43:02.000569Z

(def routes ["" {"" :home-page "/" :home-page true :default-page}])