This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # admin-announcements (1)
- # beginners (17)
- # boot (22)
- # cider (43)
- # cljs-dev (6)
- # cljsjs (2)
- # clojure (29)
- # clojure-austin (7)
- # clojure-estonia (1)
- # clojure-russia (62)
- # clojure-sg (1)
- # clojurebridge (2)
- # clojured (1)
- # clojurescript (89)
- # datomic (8)
- # hoplon (333)
- # jobs (3)
- # ldnclj (2)
- # leiningen (10)
- # luminus (1)
- # off-topic (9)
- # om (46)
- # proton (4)
- # re-frame (13)
- # reagent (29)
- # yada (11)
@hypirion: how is the inclusion order in
lein by lower version? say I have
tools.reader 1.0.0-alpha3 and
tools.reader 0.8.4 imported because transitive, who wins?
Oh I read the FAQ but one version of
tools.reader is imported by a plugin, does it win over
should pick the first, but it does not...
:dependencies [[org.clojure/tools.reader "1.0.0-alpha3"] [org.clojure/clojure "1.7.0"] [org.clojure/clojurescript "1.7.228"] [com.cognitect/transit-cljs "0.8.220"]]
@richiardiandrea: Oh, no worries. If you depend on a dependency directly, that version will almost always be picked. The algorithm used is known as nearest wins: It will generally pick the version closest to the root in the dependency tree. If there are multiple versions in the same distance from the root, the first one in the dependency vector is picked. For example, say we have the dependency vector
Which has the following dependency tree:
:dependencies [[A "0.1.0"] [E "1.0.0"]]
We will then pick F version 0.3.0 because it is closer to the root than 0.2.1. We pick B version 0.1.1 because dependency A comes before dependency E. Had we changed the order, i.e.
|-- A 0.1.0 | |-- B 0.1.1 | |-- C 1.0.0 | |-- F 0.2.1 | |-- E 1.0.0 |-- B 0.2.0 |-- F 0.3.0
Then would still pick F version 0.3.0, but would now pick B version 0.2.0.
:dependencies [[E "1.0.0"] [A "0.1.0"]]
(The only case where this isn't followed strictly is when there are version ranges somewhere, and when that happens noone really understands what you get back. Fortunately version ranges doesn't seem to be that popular in libraries used by Clojure developers.)
I guess that was a bit more than you asked for, but I found it helpful to understand how that piece of magic works so I guess more people would, too.
@hypirion thanks!! That explains a lot, BTW. I opened a PR: https://github.com/emezeske/lein-cljsbuild/issues/439