practicalli / practicalli/clojure-web-services
Service Reloaded REPL
@practicalli-johnny is already working on this.
Since Mar 18, 2025.
- Dominant language
- Markdown
- Stars
- 16
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
A guide covering the various libraries, tools and editor support for reloading code
NOTE: Ensure there is a description or link covering how to avoid needing to reload the code base ('unevaluating' vars, etc), i.e. keeping the repl state clean
Reloading the project code shouldnt be needed all the time, although it is very useful if there have been sigificant changes (especially a namespace refactor)
General concepts
https://github.com/stuartsierra/reloaded
Relevant Libraries
Which libraries are available and what are their benefits & constraints.
Guide to the workflow of each library and tips from experience reports
- Mount
- donut.system
- Integrant & Integrant REPL
- SS Component
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.