I'd like to announce a new URI routing library called bidi.

If you're planning to write HTTP/web applications in Clojure in 2014, 
chances are you'll be including hyperlinks (URIs) in your 
pages/views/templates. After all, this is what the web is all about. But 
the code that includes/generates your URIs can get tightly coupled with the 
code that dispatches on them (Compojure routes, etc.), this can lead to 
broken links if you're not careful.

Having used Pedestal services in many of my systems, I'd made heavy use of 
the (url-for) function. But I found it difficult to extract the Pedestal 
routing code from the rest of the Pedestal back-end concepts. When I wanted 
to be able to use http-kit for another project, this prevented me from 
using Pedestal and I really missed the ability to form URIs - I wanted was 
the (url-for) function back!

Like Pedestal, bidi starts with a data description of your routes - acting 
as the basis for both the generation of URIs and the dispatch to your 
handlers. However, bidi only offers URI routing and formation - nothing 
else - so it can be used for 'traditional' Ring web apps, http-kit, 
Liberator and so on. With a little work it should work well with 
ClojureScript too, since it is based on protocols rather than macros.

You can find more about bidi, with code examples, here: 
https://github.com/juxt/bidi

While I've been thinking about writing bidi for a long time (hoping someone 
else more capable than me would write it!), the actual code is very new and 
so all the usual disclaimers apply. However, I'd be very grateful for 
feedback on this new library - what you like and dislike about it, initial 
impressions, complaints, alternatives you know about and any questions etc..

And finally I'd like to wish everyone on this list a Happy New Year and the 
very best for your Clojure hacking activies in 2014.


Malcolm

JUXT - https://juxt.pro


-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to