practicalli / practicalli/clojure-web-services

Service Reloaded REPL

Open
#113 0 comments 0 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.