I get the following exception trying to use this: https://github.com/practicalli/clojure-deps-edn/blob/de7c8f78b18835fe4fdf845e5167cb12c078dbcc/deps.edn#L323
2. Unhandled clojure.lang.Compiler$CompilerException
Error compiling clojure/tools/deps/alpha/util/maven.clj at (146:7)
#:clojure.error{:phase :compile-syntax-check,
:line 146,
:column 7,
:source "clojure/tools/deps/alpha/util/maven.clj"}
[...]
1. Caused by java.lang.ClassNotFoundException
clojure.tools.deps.alpha.util.S3TransporterFactory
There is now a release version, try using this as an alias instead
:hot-load-deps
{:extra-deps {org.clojure/tools.deps.alpha {:mvn/version "0.8.695"}}}
I’ve pushed a commit to the GitHub repository with the updated alias. Let me know if this helps. If not, can you show which library you are trying to not load. Thank you.
thanks! it may be my Java version (11) then. I got the exception when trying to require clojure.tools.deps.alpha.repl
, even before I got to try to load a library. unfortunately tools.deps.alpha v0.8.695 doesn't even contain that namespace, and the master branch doesn't contain any occurrence of the add-lib
symbol, so that's probably not in any release yet
Nope, it was me... I missed some extra config to make it wor
I've just pushed an update to the practicalli/clojure-deps-edn GitHub repository with the fix. This works when I tested it in the REPL. I used rebel readline, but should work in any REPL
I've published a quick guide to the very unofficial hot loading http://practicalli.github.io/clojure/alternative-tools/clojure-tools/hot-load-dependencies.html . I would be interested to hear how you get on and what libraries you are hot-loading, especially what works and what doesn't work. thanks.
works perfectly now, thank you very much!
(tested in the plain clj REPL)
also tested in cider+nREPL
Be aware that this is totally unsupported approach and it may break unexpectedly in the very near future. I will be documenting some other approaches to manage the REPL experience in a more typical way.
for one thing, when loading this alias clojure.tools.namespace.repl/refresh
(as invoked by e.g. integrant.repl/reset
stops working:
:cause "Unable to resolve symbol: skip-wiki in this context"
:via
[{:type clojure.lang.Compiler$CompilerException
:message "Syntax error compiling at (clojure/tools/deps/alpha/script/generate_manifest2.clj:9:1)."
:data #:clojure.error{:phase :compile-syntax-check, :line 9, :column 1, :source "clojure/tools/deps/alpha/script/generate_manifest2.clj"}
:at [clojure.lang.Compiler analyze "Compiler.java" 6808]}
{:type java.lang.RuntimeException
:message "Unable to resolve symbol: skip-wiki in this context"
:at [clojure.lang.Util runtimeException "Util.java" 221]}]
I'll try using clojure.tools.namespace.repl/disable-reload!
in some namespaces
this worked (tailored to my own needs, since I was having problems with figwheel-main too; for the sake of dep hotloading I guess just filtering out .gitlibs/*
would work)
(apply clojure.tools.namespace.repl/set-refresh-dirs
(for [root (clojure.java.classpath/classpath-directories)
:when (and (or (str/starts-with? root "dev/")
(str/starts-with? root "src/"))
(not (str/includes? root "/cljs/"))
(not (str/ends-with? root "/cljs")))
f (file-seq root)
:when (.isDirectory f)]
f))
I would not use add-lib if using a component system like integrant, as integrant (or mount) would be used to manage reloading of the repl. Integrant will be around for a while and supported, add-lib is not.
I don't understand. they serve different purposes. integrant can't hotload dependencies.
anyway, the real collision was with clojure.tools.namespace.repl/refresh
, which as I said was causing problems elsewhere because it was trying to (re)load too many files. restricting the refresh directories to my own source code was a good idea anyway
I will take a look after today’s broadcast. It may be the version of Java used, Java 8 should work, Java 11 hopefully works. Other versions of Java may not. This library is not finalised yet, hence the alpha in the name.
The plan for next week is to look at continuous integration of Clojure apps on Circle CI, especially how to do Clojure deps.edn projects. Using Leiningen apps to CircleCI seems pretty straight forward https://circleci.com/docs/2.0/language-clojure/ I'll document how to do deps.edn projects during the week and cover it next broadcast. There are some example Circle CI configurations for clojure cli projects in this current issue, along with ideas of content to create https://github.com/practicalli/clojure-practicalli-content/issues/183