Comments (5)
Hi Dave,
Thanks for the report. I think :scope "provided"
may be the more accurate way to specify the Clojure dependency, but I am curious as to what other circumstances caused this to be a problem.
Since Component version 0.3.0, the minimum required Clojure version is 1.7.0, to support conditional read. If you try to use Component 0.3.0 or later in a project on Clojure 1.6.0 or earlier, it will fail to load.
If your project has a declared or transitive dependency on any version of Clojure after 1.7.0, then most tools will silently upgrade to that later Clojure version. I can't come up with a scenario in which the declared dependency on Clojure 1.7.0 would transitively load the "wrong" version, but transitive dependencies have all sorts of edge cases, so I could have easily missed one.
Thanks,
–S
from component.
I don't recall exactly how I ran across this a couple weeks ago, but IIRC, my build tool (Boot) did load the later Clojure version, which is good, but it also emitted a warning about how it would not load Clojure 1.7.0 because it had already loaded Clojure 1.9.0 or whatever version it was that my project specified.
from component.
OK, I can reproduce equivalent behavior in Leiningen, although it doesn't print a warning when overriding with a later Clojure version.
I still think :scope "provided"
is probably the "correct" thing to do, but it does have a downside:
If a project depends on a version of Clojure earlier than 1.7, and it uses Component 0.3.0 or later, lein deps :tree
will print a warning, and lein with :pedantic? :abort
will abort.
If I change the dependency in Component to [org.clojure/clojure "1.7.0" :scope "provided"]
then there is no warning, even with :pedantic?
, but attempting to load the Component library will fail with a mysterious error:
Could not locate com/stuartsierra/component__init.class or com/stuartsierra/component.clj on classpath
So adding :scope "provided"
removes the warning from Boot about overriding with a later version of Clojure, but potentially removes a warning about overriding with an incompatible, earlier version of Clojure.
Assuming that most Clojure users are already using 1.8 or later, I think it's an acceptable trade-off to add :scope "provided"
, so I will make the change.
from component.
That's an interesting find! It feels like maybe a bug in Boot (and I guess Leiningen?), or maybe pomegranate, the library that it's using to resolve dependencies.
Thanks for looking into this!
from component.
This is the script I'm using to test, if anyone is curious https://gist.github.com/stuartsierra/7df465cdd4b0632b1e7a0627b7dff931
from component.
Related Issues (20)
- Cljs source files requiring component break refresh for clj code HOT 9
- Question: Whether it should be okay to pass system record directly to a special component HOT 1
- still dependent on IoC container? HOT 1
- Startup with asynchronous components? HOT 8
- Add an option to log components/keys as they are started HOT 1
- start/stop don't call a component's start/stop when there is no dependencies in the system map... HOT 1
- init.el helper fns HOT 1
- How to inject db transaction per http request? HOT 1
- Reloading with component *without* introducing global state HOT 1
- Feature request: add system key metadata to components HOT 1
- :extend-via-metadata in 0.4.0 breaks on ClojureScript < 1.10.516 HOT 2
- Non-associative components? HOT 2
- Cleaning up component dependencies by default HOT 2
- Make it possible to start a subsystem? HOT 4
- Provide an example explaining the ?essence? of the components idea
- Keys of already started components for `::component/component-function-threw-exception` HOT 2
- ec alpha
- Multiple dependencies of same "type" HOT 1
- Using ECS lib for getting rid of deftypes/defrecords/defprotocols HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from component.