practicalli / clojure-web-services

Develop production grade server-side web services and APIs using Clojure and REPL driven development
https://practical.li/clojure-web-services
Creative Commons Attribution Share Alike 4.0 International
11 stars 14 forks source link

Service Reloaded REPL #113

Open practicalli-johnny opened 1 year ago

practicalli-johnny commented 1 year ago

General

https://github.com/stuartsierra/reloaded

Reloading in Cider

https://docs.cider.mx/cider/usage/misc_features.html#reloading-code

Reload in Conjure

There's already hooks into tools.namespace.reload which does exactly this but automatically, I use it a lot. Mappings https://github.com/Olical/conjure/blob/839fe23a7746f03aa9ef1ebf087501cd6126cf0f/doc/conjure-client-clojure-nrepl.txt#L424-L432 Config https://github.com/Olical/conjure/blob/839fe23a7746f03aa9ef1ebf087501cd6126cf0f/doc/conjure-client-clojure-nrepl.txt#L264-L280

Olical config to reload my code and then restart my system through mount:

(tset vim.g :conjure#relative_file_root (vim.fn.getcwd))
(tset vim.g :conjure#client#clojure#nrepl#refresh#dirs ["src"])
(tset vim.g :conjure#client#clojure#nrepl#refresh#before "mount.core/stop")
(tset vim.g :conjure#client#clojure#nrepl#refresh#after "mount.core/start")

discord message to help explain Olical workflow https://discord.com/channels/732957595249410108/732963293328834620/1044937386016112691

Reloading specific directory trees

set-refresh-dirs to specify directories to view when using tools.namespace.refresh/refresh - useful for excluding clojure files in dev or develop that are not part of the main service or still in development (even if they are on the class path)

https://ask.clojure.org/index.php/10277/preventing-clojure-namespace-refresh-loading-namespaces