> A related question is why would you want to reload the entire file/namespace every time you make a change?
Wait... What change does it make to evaluate a single function or to evaluate that single function plus re-evaluate all the other function in the same Clojure source file? It's not slow. It doesn't break anything?
Regarding figwheel, which I find very convenient (it reloads not just the modifications in .cljs files but also in HTML and CSS files AFAICT), where is the problem and would you reproduce what figwheel does without figwheel?
Most of my Clojure and ClojureScript source file have zero state, zero variable. And from what I can tell many Clojure projects are like that. So what change does it make if I define (or redefine) a function from a REPL or from the source file and have figwheel re-evaluate the whole source file?
Heck... I got "confused" at some point: if I modify a .clj file I need to eval what I modified (or the whole file), to have my REPL "synched" with the file. While with figwheel I don't need to eval but save the file for figwheel to update the front-end's JavaScript in realtime.
So what I did is this: I modified my shortcuts that does "eval buffer" to do "save + eval buffer" and modified my shortcut that does "save" to also do "save + eval buffer".
That way everything works in the same manner and I don't need to remember which one does what.
If I modify a .cljc source file (common to both Clojure and ClojureScript) and either eval the file or save the file, both REPLs see the new definitions and figwheel also hot reloads. I really like that.
And, yet, I still have my two REPLs at all times and I can directly eval stuff at the REPLs if I want to.
> My guess is that lots of those people never worked with a REPL where you eval single forms from the editor, so this auto-reload on each save seemed much better.
OK but for ClojureScript running on the front-end, how would I then go, without figwheel's hot reload, to make a modification and have the (transpiled) JavaScript be updated immediately?
> And it creates its own problems, like the one the OP solves in the article.
But the problem of ring routes not being updated have nothing to do with auto-reload? I may be wrong but wouldn't the problem be exactly the same if I were to re-eval the router var from the REPL (I'll try it and see later on)?
Anyway I'd say that, when worse comes to worse and you screwed your application's state / components lifestyle, a full restart one every blue moon ain't a biggie.