3 ms·
I really only ever encountered this issue when working with ring routes, as in TFA. Love the macro at the end, may start to use it because why not. Now I want
by TacticalCoder 4y ago
I really only ever encountered this issue when working with ring routes, as in TFA. Love the macro at the end, may start to use it because why not.
Now I want to say this to Clojure beginners: launching Emacs with a very complicated, non optimized, init (3400 lines of custom elisp code I wrote over the years) takes 1.4s on my system. Now launching the app, with two REPLs (one for Clojure on the back-end, one for ClojureScript on the front-end I'm testing) and about 30 dependencies (including figwheel, which is kinda heavy) takes...
16 seconds.
So, from complete scratch, launching Emacs, opening a Clojure source code file, (which btw also triggers the launch of the Clojure LSP server) and then launching the webapp server, two REPLs and loading the main webapp page in a browser takes less than 18 seconds. Well, ok, it's not from complete scratch as source files that haven't been modified do not need to be recompiled, I'll grant that.
It's a 2019 AMD 3700X with 32 GB of RAM and a NVMe M.2 PCIe 3.0 x4 lanes SSD. Not a bad machine but not last gen either (I'm probably swapping it for a 7700X one of these days).
I'm pretty sure the startup time is going to go significantly down when I'll switch to the 7700X.
So even though it's great to not have to restart the app/REPLs it should not be a problem to restart the whole thing.
If your REPLs take two minutes to start, I'd argue there's an issue and it's time to fix that first. Move from lein to deps.edn (which launches one JVM less, which really helps as Clojure startup times on the JVM are slow), buy a faster dev machine. Buy a PCIe SSD. Use chrome/chromium instead of Firefox for testing your webapp (in my experience chrome is simply way faster for anything JavaScript and, oh boy, does ClojureScript generate lots of JS). Etc.
As a sidenote I'd say this specific "ring route not updated" is a variation of the age old issue of cache invalidation.
So basically: I love working at the REPL and keep my REPL(s) opened for a very long time, hot reloading everything (including ClojureScript on the client-side) without needing to restart everything but I don't lose sleep over the fact that I do sometimes relaunch everything for it takes not even 20 seconds.