Closed danielmarreirosdeoliveira closed 2 years ago
Got it working. Stupid mistake. It should have been clear in any case that the reloading of the ring based clojure backend code could have nothing to do whatsoever with figwheel-main which takes care of the clojurescript code.
Hi there, first of all, thanks for writing figwheel. It is really a joy to develop with its help. I encountered something with regard to the ring configuration, which I could not work out properly. This is in the context of a fullstack starter-app, as can bee seen in this branch: https://github.com/danielmarreirosdeoliveira/fullstack-clj/tree/configuration-issue (start via
lein fig:build
). In a standalone ring application with thelein-ring
plug-in I am able to change code, save, and on the next Rest-Query I see that the code changes are active. Now in this fullstack-clj demo I can do the same. I change something insrc/clj
and changes take effect immediately. However, I think I achieved this probably by accident. What I mean is that inproject.clj
I have:source-paths ["src" "src/cljs" "src/clj" "src/cljc" "test/clj" "test/cljs"]
and indev.cljs.edn
I have:watch-dirs ["test" "src"]
. But what I really want is:source-paths ["src/cljs" "src/clj" "src/cljc" "test/clj" "test/cljs"]
and:watch-dirs ["src/cljc","src/cljs","test/cljs"]
, because then source paths point to roots of classpath trees. With this config the backend code reload stops working. Going from that config I can then adjust watch-dirs to["test","src"]
and (correctly) get the warning that "src" is not in the classpath. But the code reloading works again. To test the api, I usually querylocalhost:9500/api/abc
and change the number of!
insrc/clj/fullstack/api_main.clj#L11
. I can not say, what is going on here, but the goal would be to have no warnings, a clean configuration, as well as backend hot code reload.