This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-28
Channels
- # aleph (50)
- # announcements (3)
- # aws (35)
- # beginners (74)
- # boot (25)
- # calva (39)
- # cider (18)
- # clara (2)
- # cljdoc (18)
- # cljs-dev (24)
- # cljsrn (11)
- # clojure (166)
- # clojure-europe (13)
- # clojure-italy (5)
- # clojure-nl (6)
- # clojure-spec (35)
- # clojure-uk (263)
- # clojurescript (22)
- # clojutre (1)
- # code-reviews (34)
- # cursive (58)
- # data-science (2)
- # datascript (4)
- # datomic (4)
- # duct (6)
- # emacs (7)
- # figwheel-main (9)
- # fulcro (2)
- # graphql (3)
- # hoplon (22)
- # hyperfiddle (2)
- # juxt (5)
- # kaocha (6)
- # leiningen (33)
- # luminus (15)
- # off-topic (1)
- # pedestal (5)
- # reagent (18)
- # reitit (12)
- # shadow-cljs (171)
- # vim (5)
can one add coercion via custom expanders? Iām trying to keep my routes code-free (i.e. data only), so I can store them in EDN files.
interesting @levitanong. You could do that, or if you have just one coercion per app, you can set it in a router:
(ring/router
my-routes-from-edn
{:data {:coercion spec-coercion}})
The new Trie is merged into master. Was fun optimizing the internals - now 20x faster than the original (Pedestal) version.
I went ahead and made the custom expander and I'm happy to report that it works. However your method is much more pleasing to me, so I'll go with that. :) thanks!
@haiyuan.vinurs https://github.com/metosin/reitit/commit/5713afac34ec5ea0972b731a69b0d3cdcefc9b46
so, we stuffed routes into a PersistenHashMap
, which for sure, lost the order. The new code forces the routes into a PersistentArrayMap
, which has the order. It might be lost again in json-serialization, but might also just work.
@ikitommi testing 0.3.0.
(r/match-by-name (r/router [["" :google]]) :google)
;; #reitit.core.PartialMatch{:template "", :data {:name :google}, :result nil, :path-params nil, :required #{:}}
Seems like an odd match@levitanong really odd match indeed :)