This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-12-21
Channels
- # adventofcode (8)
- # announcements (20)
- # babashka (43)
- # beginners (8)
- # biff (12)
- # calva (2)
- # cider (5)
- # clerk (6)
- # clj-commons (12)
- # clj-kondo (16)
- # clojure (20)
- # clojure-denver (1)
- # clojure-europe (14)
- # clojure-nl (1)
- # clojure-norway (105)
- # clojure-uk (2)
- # clojuredesign-podcast (5)
- # clojurescript (29)
- # datomic (2)
- # hyperfiddle (13)
- # jackdaw (1)
- # jobs (4)
- # jobs-discuss (4)
- # lsp (2)
- # malli (12)
- # pathom (2)
- # pedestal (1)
- # re-frame (22)
- # shadow-cljs (37)
- # squint (28)
- # xtdb (28)
- # yamlscript (4)
Hey there, I am AOT-compiling a project and would like to include cider-nrepl
for the purpose of starting an nrepl server via nrepl.server/start-server
using cider.nrepl/cider-nrepl-handler
as the handler. This fails then when attempting to connect to the running server built this way due to the delayed loading of the middleware dependencies. Can you recommend a way to eagerly load them? Or any other workaround which doesn't require me to manually require all orchard.*
namespaces etc.?
Problem being that the AOT compilation doesn't consider the middleware dependencies since they're only loaded at runtime, of course
OK I couldn't find a way to programmatically do this. Tried instantiating every middleware in cider.nrepl.middleware/cider-middleware
with a noop handler and passing a mock message into it but that became very hacky very quick. I've now resorted to copy & pasting all cider.nrepl.middleware.*
namespaces and requiring them explicitly on my end. This will of course fail as soon as new default middlewares are introduced or old ones are removed ...
Note this caveat though https://clojurians.slack.com/archives/C0617A8PQ/p1703023709316259?thread_ts=1703021398.963639&cid=C0617A8PQ In the thread you can find a couple ways in which we recommend to run (cider) nrepl in production
Thanks for the feedback! Alright, I'll go ahead with the minimal nrepl server then, should be good enough 🙂