Question

Using Ring / Jetty with Clojure, when I make any changes to my code, I have to reload my entire JVM.

Is there anyway of keeping Jetty asynchronous with changes in my code, so I can simply refresh the browser window and get changes immediately?

Specifically, I'm using Hiccup for HTML Parsing, and it's mainly changes in layout I'm making.

It would be a huge timesaver if layout changes were automatically compiled and available in browser on refresh.

Does anyone have any information on that? Are there any solutions?

Was it helpful?

Solution

You might want to check out lein-ring specifically :auto-reload? and :auto-refresh? options.

OTHER TIPS

As an alternative to the auto-reload features in ring, if you're using a repl-enabled development system, like emacs + nrepl or counterclockwise (if you don't, you should try one to see the difference it makes), you can just re-evaluate specific definitions or files directly from the editor into the running system. IMO it's a far superior workflow than save + (auto-)reload. I use emacs/nrepl.el and I've never had any use for auto-reloading.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top