How would you position Silk in relation to Bidi?
Thanks for any insights.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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+u...@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+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.
If you define routes with :path and :query, will the route match/unmatch with undefined query keys? If so, how are they handled? If not, I'd suggest making query matching optional, where nils are substituted.
It's a little unclear how your matching functions relate to route. It looks like Silk always breaks at / in path and matches, is that correct?
There are some really good things in secretary. What do you think about them?
Splat, regex, format matchers.
protocol based render function for multiple arity "unmatching." this is really great.
--
Note that posts from new members are moderated - please be patient with your first post.
---
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
user=> (silk/match (silk/composite ["user-" (silk/integer :id) "-fred" (silk/option :this "that") "s"]) "user-42-fredjs")
{:id 42, :this "j"}
user=> (silk/match (silk/composite ["user-" (silk/integer :id) "-fred" (silk/option :this "that") "s"]) "user-42-freds")
nilI would have thought the last one would have produced:
user=> (silk/match (silk/composite ["user-" (silk/integer :id) "-fred" (silk/option :this "that") "s"]) "user-42-freds")
{:id 42, :this "that"}
(defn domkm.silk/encode-query "Takes a query map.
Returns a string of query pairs encoded and joined."
[query]
(->> query
(apply into sorted-map) ; ensure consistent ordering to improve cache-ability of URLs...
(map (fn [[k v]] (str (encode k) "=" (encode v))))
(str/join "&")))
I’ve been using silk in conduction with compojure. Most middleware aren’t compojure specific, but I’ve just found it easier to stick with base level compojure routes and then pass uris to silk for pattern matching. This is mostly because there is such a wealth of documentation and examples to draw from with compojure. For example, session management, login flows with friends, etc have already been solved and there is plenty of code to strip. Silk wouldn’t complicated them (in some cases it might simplify), but when the wheel rolls, push it.
I’ve been approaching silk solely as a library for pattern matching within the specific domain of urls, which it does very cleanly. More importantly, it’s currently the only one that does it in both clojure and clojurescript, which makes it possible to have the same routing code used on client and server, which is necessary if you want to do server rendering, or more complicated websocket updates.
I’ve been using silk in conduction with compojure. Most middleware aren’t compojure specific, but I’ve just found it easier to stick with base level compojure routes and then pass uris to silk for pattern matching. This is mostly because there is such a wealth of documentation and examples to draw from with compojure. For example, session management, login flows with friends, etc have already been solved and there is plenty of code to strip. Silk wouldn’t complicated them (in some cases it might simplify), but when the wheel rolls, push it.
I’ve been approaching silk solely as a library for pattern matching within the specific domain of urls, which it does very cleanly. More importantly, it’s currently the only one that does it in both clojure and clojurescript, which makes it possible to have the same routing code used on client and server, which is necessary if you want to do server rendering, or more complicated websocket updates.
--
Groups "Clojure" group.
To post to this group, send email to clo...@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+u...@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 a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/D95anPmhNhU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.
So, in summary, I think it would be useful to have a single 'default' routing library in Clojure that supported isomorphism and was built on protocols, as a minimum. Now that Clojure is attracting so many new users, it would be great to discuss the outstanding differences between all the routing libraries and try to drive some consensus as to what a combined library would include.