This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-03
Channels
- # announcements (3)
- # babashka (29)
- # beginners (95)
- # calva (109)
- # cider (16)
- # clj-kondo (6)
- # clj-together (1)
- # cljdoc (2)
- # cljsrn (2)
- # clojure (85)
- # clojure-europe (26)
- # clojure-india (1)
- # clojure-seattle (1)
- # clojure-uk (6)
- # clojurescript (14)
- # conjure (4)
- # cursive (8)
- # datomic (6)
- # emacs (21)
- # events (1)
- # figwheel-main (5)
- # fulcro (11)
- # graalvm (32)
- # graphql (1)
- # holy-lambda (7)
- # humbleui (7)
- # jobs (3)
- # membrane (8)
- # nextjournal (31)
- # off-topic (29)
- # pathom (14)
- # polylith (9)
- # portal (16)
- # practicalli (4)
- # reitit (17)
- # releases (1)
- # remote-jobs (2)
- # ring (4)
- # sci (20)
- # shadow-cljs (24)
- # sql (1)
- # vim (12)
- # xtdb (3)
I wonder if anyone here uses reitit with juxt clip (am I the only one!?! 🙂 ) who can illumate me on how to do a dev workflow so, if I change a (function) route, and eval, I don't have t restart the system again?
I can have a looksee, but from what I've been playing around, I have to reload the system so far
no, but I can tell you what I did
Order of dependencies for components:
server -> ring-handler -> ring-router -> routes -> handlers map
routes:
[[path-a handler-a] ...
Then in development you can pass all the handlers as vars instead of function values, or build the handlers wrapped in (fn [x] (handler x))
making sure they are referenced by name and not by value at dev time
also see
https://github.com/metosin/reitit/blob/master/doc/advanced/dev_workflow.md#an-easy-fix
Yup, thank you. Reading that, so far, can't get it to work. Will keep plugging away at it.
One way to do it is with vars, another is requiring resolve, or (fn [x] (f x)), which doesn't do anything, but is compiled in a way where f isn't passed by value
Something like (defmacro $ [f] (fn [~'x] (~f ~'x)))
then when you refer to your handler which you pass to the routes do it with ($ handler)
So I have a wild card route where I am passing in a string "one/two/three" "/posts/{*path}" with that as the route, what I am finding is rfe/href is encoding the slash in the url, which often you might want but in this case makes the links look ugly is there a way to disable this ? the links do work but posts/one%2Ftwo%2Fthere does not look as nice as posts/one/two/three.
figured out in the end that you can just concat on the end of the function call.