This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-08
Channels
- # announcements (2)
- # aws (1)
- # beginners (134)
- # calva (26)
- # cider (48)
- # cljdoc (41)
- # cljs-dev (12)
- # clojure (178)
- # clojure-brasil (1)
- # clojure-europe (16)
- # clojure-italy (30)
- # clojure-nl (13)
- # clojure-spec (118)
- # clojure-uk (81)
- # clojurescript (209)
- # community-development (77)
- # cursive (7)
- # datomic (23)
- # duct (6)
- # emacs (15)
- # events (2)
- # figwheel (13)
- # figwheel-main (18)
- # fulcro (4)
- # jackdaw (4)
- # jobs (6)
- # jobs-discuss (6)
- # kaocha (2)
- # lein-figwheel (3)
- # off-topic (4)
- # other-languages (22)
- # pathom (2)
- # pedestal (9)
- # perun (10)
- # portkey (1)
- # re-frame (41)
- # reagent (6)
- # reitit (4)
- # remote-jobs (1)
- # ring-swagger (6)
- # rum (5)
- # shadow-cljs (300)
- # sql (3)
- # test-check (6)
- # testing (7)
- # vim (1)
- # yada (9)
We have a fairly large set of routes, and many of them follow the usual (?) REST practice of naming the resource in the plural: /foos
, /bars
, etc. Adding a new Foo means POSTing to /foos
, and retrieving Foo with id 42 means GETting /foos/42
. Now, another usual practice in web apps is to have forms for creating and editing Foos at /foos/new
and /foos/42/edit
.
With Reitit the /foos/new
route causes a conflict with the /foos/:id
route. The conflict resolution can be disabled with {:conflicts nil}
, creating a :quarantine-router
(where conflicting routes exists in a :linear-router
). I don’t know the performance characteristics in my particular case, but it must be slower, though maybe negligible.
How do you folks deal with this? Do you just bite the bullet and come of with some other scheme of organizing your URLs?
the :quarantine-router
is almost as fast as everything else. It takes only the routes in conflicts and quarantine those into linear router (which is also backed by a Trie). All non-conflicting routes are as fast as before. If the conflicting paths have wildcards, the perf penalty is negligible. If the conflicting routes are static, then there is a small degrade, but just for the conflicting ones.