Hi, when I use integrant.repl
to (reset)
my system it reloads a lot of namespaces from my dependencies: :reloading (re-frame.db re-frame.loggers re-frame.registrar re-frame.trace re-frame.interceptor re-frame.cofx re-frame.utils re-frame.subs re-frame.std-interceptors.........
Is this expected behavior?
Yes, integrant.repl
uses clojure.tools.namespace.repl
to do this
https://github.com/clojure/tools.namespace/blob/8d632bfcd8ce4f872f9a9cdafb5245c9b10574a0/src/main/clojure/clojure/tools/namespace/repl.clj#L128-L145
It gets called here: https://github.com/weavejester/integrant-repl/blob/89a9552fd3623976b83318a5f8f903f1ebeda2f7/src/integrant/repl.clj#L84
Sorry @kevin.van.rooijen, I don't think I was clear enough: I know that it's supposed to reload namespaces that have changed since I last ran (reset)
. But that shouldn't include my static dependencies (such as re-frame.db
etc), right?
I'm assuming something in my config is strange...
Not sure if that's an integrant issue or a clojure.tools issue
But I don't think it would be expected
I think you're right, I probably would have the same issue using tools.namespace by itself or when using component
Since the clojure.tools doc clearly says "files which have changed"
Just found the "cljc + ClojureScript source maps" in https://lambdaisland.com/blog/2018-02-09-reloading-woes
Might be what I'm experiencing.
And using set-refresh-dirs
seems to solve the problem!
Ah that's a good catch
The duct lein template apparently does this for you https://github.com/duct-framework/duct/blob/c2a7691931dafbf403ec826928d54f4bfc56987d/lein-template/resources/leiningen/new/duct/base/dev.clj#L26
Of course if you're only using integrant, then that wouldn't help