Having played around a little bit with nREPL and Cider mode for Emacs, I've found that sometimes I have to either re-start my http-kit server for it to pickup the changes (usually when changing middleware or routes), or things get messy and I just have to restart the whole REPL.
I'm having hard trouble finding out what actually causes this. It seems that sometimes I can change even things like route definitions (defined with the compojure defroutes
macro), and the running server will pick things up, and sometimes it doesn't work, and I have to stop the server and restart it.
Are there any specific patterns in Clojure that make reloading easier? Or things that make it impossible forcing a whole REPL reload? I've also found that sometimes I eval a something that just messes things up, such as an unqualified import, and that forces me to restart the whole REPL.
Are there any best practices that make code easily reloadable (such as via C-c C-k
in Cider) while a server is running, so that the changes are picked up automatically? I think I've seen something somewhere a long time ago, that it is possible to make even the dumbest web server reload things by adding a layer of indirection, but I can't really seem to find where that was.