Good morning.
morning
Hi, it's me... I am back again.
howdy
@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
and re-frame is really a great addition to reagent
malcolmsparks: I’m glad. What are your reasons for bidi?
malcolmsparks: my main reason for silk is that the author hangs out in slack and is accessible. :simple_smile:
@pupeno: I wrote bidi
malcolmsparks: ah! :simple_smile:
There goes the silk advantage. 😕
Did you look at silk?
"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."
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
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
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
@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
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?
malcolmsparks: thanks for the answers, and what do you mean by doc fragments?
sorry, I meant # in the uris
fragment is the bit after the #
your URIs are fragment-less
I thought so.
is HTML5 push-state the magic there? and is it supported by lots of browsers now?
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.
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.
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
ah, that's a good point, you're right
Google have a #! convention for that specific case
@agile_geek: something for you: https://github.com/IonicaBizau/node-cobol/
😉
@thomas: Real programming! 😉
@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
@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 “”?
This seems to work:
(def routes ["" {"" :home-page
"/" :home-page
"/about" :about-page}])
you can use boolean true as a pattern
`(def routes ["" {"" :home-page "/" :home-page "/about" :about-page}])`
(def routes ["" {"" :home-page "/" :home-page true :default-page}])