This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-04
Channels
- # babashka (17)
- # beginners (82)
- # calva (42)
- # clj-commons (9)
- # cljdoc (2)
- # cljsrn (3)
- # clojure (142)
- # clojure-europe (12)
- # clojure-nl (1)
- # clojure-sg (1)
- # clojure-uk (14)
- # clojurescript (22)
- # community-development (3)
- # cryogen (12)
- # cursive (15)
- # data-science (13)
- # datomic (11)
- # deps-new (8)
- # emacs (3)
- # fulcro (31)
- # gratitude (7)
- # holy-lambda (8)
- # honeysql (6)
- # introduce-yourself (1)
- # jackdaw (11)
- # jobs-discuss (7)
- # kaocha (1)
- # malli (8)
- # other-languages (9)
- # pathom (14)
- # pedestal (1)
- # polylith (3)
- # portal (12)
- # re-frame (3)
- # react (3)
- # reagent (4)
- # releases (3)
- # reveal (7)
- # ring (11)
- # shadow-cljs (17)
- # specter (3)
- # sql (1)
- # timbre (2)
- # tools-deps (122)
- # xtdb (18)
just getting started with ring; this lein plugin enabling hot reloading of handlers I'm messing around with is pretty neat.
@radicalmatt If you take a bit of care to write REPL-friendly code, you don't need any of that code reloading stuff.
https://clojure.org/guides/repl/enhancing_your_repl_workflow#writing-repl-friendly-programs for example
At work, we develop against a running REPL and don't use any plugins or middleware for reloading. We evaluate every change as we make it, we write "REPL-friendly" code using #'some-var
references (instead of plain some-var
) where we need the extra indirection, usually around Ring middleware stacks, and then we don't need to reload or restart anything: the web app is always running the latest code.
This is what I am referring to https://github.com/ring-clojure/ring/wiki/Setup-for-development#setup-using-the-lein-ring-plugin - is this not necessary if I were to pass a handler reference to jetty/run-jetty
?
Correct. And just start the server yourself from your REPL.
That ring plugin is just a bad idea in my opinion.
Take a look at this little example https://github.com/seancorfield/usermanager-example
It's REPL-friendly and avoids any plugins.
For anyone interested, I found some supplementary material on Component used in Sean's example: https://www.youtube.com/watch?v=13cmHf_kt-Q (The author discussing the design and rationale behind Component)