You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ns-tracker is a Clojure library for keeping track of changes to source
files and their associated namespaces. This is usually used to
automatically reload modified namespaces in a running Clojure
application.
It is derived from code in Stuart Sierra's Lazytest tool, and the
credit for writing the vast majority of the code used in this library
should therefore go to him.
Installation
Add the following dependency to your deps.edn file:
ns-tracker/ns-tracker {:mvn/version "1.0.0"}
Or this to your Leiningen dependencies:
[ns-tracker "1.0.0"]
Usage
Use the ns-tracker.core/ns-tracker function to create a new tracker
function for one or more source directories:
This can be placed in a background thread, or triggered by some user
request.
Declaring Dependencies to Static Resources
Some Clojure libraries, such as
HugSQL, define functions in
a namespace based on the content of a static resource file. ns-tracker
is able to reload such a namespace when the resource file is modified
with the help of a bit metadata.
You will need to declare the resources under the
:ns-tracker/resource-deps key in the namespace's metadata: