This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-12
Channels
- # adventofcode (1)
- # announcements (6)
- # babashka (28)
- # beginners (75)
- # calva (8)
- # clj-commons (4)
- # clojure (39)
- # clojure-austin (5)
- # clojure-europe (7)
- # clojurescript (14)
- # clr (3)
- # datalevin (2)
- # fulcro (7)
- # funcool (1)
- # graphql (4)
- # helix (3)
- # hyperfiddle (5)
- # joyride (15)
- # malli (1)
- # missionary (16)
- # practicalli (1)
- # releases (1)
- # reveal (2)
- # tools-deps (14)
- # vim (9)
Hello. What is the current way to require the function add-lib
or add-libs
these days?
https://insideclojure.org/2018/05/04/add-lib/
This is how I hotload for libraries, using a rich comment block. It could also be done in the deps.edn file but I prefer the rich comment https://practical.li/clojure/clojure-cli/projects/hotload-in-project/
Or if using a terminal UI repl prompt - https://practical.li/clojure/clojure-cli/repl/libraries/#hotload-libraries
Thank you very much.
Kind of an aside, but I notice that the page of tools.deps.alpha say it is obsolete and tools.deps should be used[1], but I didn't find add-libs
in tools.deps
(maybe I didn't search enough).
Do you know if the function add-libs
is part of tools.deps
namespace somewhere, maybe a sub namespace I'm not finding?
[1] https://github.com/clojure/tools.deps.alpha
As I understand it, tools.deps
should be used for everything, except add-libs
which has not yet been finalised (although it hasnt changed much in the last year). So just for add-libs
, use tools.deps.alpha
until Alex is kind enough to find time to finalise the add-libs feature and include it in tools.deps or there preferred way to package it.
Now I understand. Thank you very much!
You have a broken link in the article https://practical.li/clojure/clojure-cli/projects/hotload-in-project/ The first link is pointing to https://practical.li/clojure/clojure-cli/projects/hotload-in-project/hotload-libraries.md
Thanks, I just noticed that too... the book is being refactored and I'm working on improviing that bit today and expanding on hotloading and other tools for a REPL reloaded page... the left hand navigation should all work though...
Based on recent comments here from Alex, add-libs should probably be out of alpha pretty soon, I think.
indeed, there will be an official way to do this soon (but it will not be in tools.deps at all)
What happens when I include many aliases and each one has main-opts? Which of those libraries' main methods will be called and with what main-opts?
clj -M:alias-1:alias-2:...:alias-n
In a chain of aliases, only the last :main-opts
definition is used, so in the example only :main-opts
from :alias-n
I found the doc reference of this information:
https://clojure.org/reference/deps_and_cli#_execution
(Regarding :main-opts
) "If multiple maps with these keys are activated, only the last one will be used"