Fork me on GitHub
#polylith
<
2021-09-23
>
seancorfield00:09:13

I'm not sure if this is a bug in poly but it caught me out and left me scratching my head for quite a while. In our workspace deps.edn file we have :deps {org.clojure/clojure {:mvn/version "1.11.0-alpha2"}} in addition to :dev and :test aliases and I had been assuming that poly would use that for running tests from the development project -- but it doesn't. I guess it uses the "default" version of Clojure for however it builds the class loader for :dev. I hadn't noticed this until I used update-vals in some code and the :setup-fn started to fail for development but not for other projects (because those have :deps {org.clojure/clojure {:mvn/version "1.11.0-alpha2"}} in the project deps.edn files).

seancorfield00:09:26

If it's "not a bug", it probably deserves a note in the docs somewhere that is explicit that :deps is ignored when running development tests.

tengstrand03:09:58

Thanks for reporting this. Yes, that’s how it’s implemented right now for the development project. I makes sense to support putting things directly in :deps, to be consistent with t.d.a. You can create an issue if you want. I need to have a look at this, but if it’s not too much work, I will add support for this in the next version we release.

seancorfield05:09:43

Thanks, Joakim!

furkan3ayraktar05:09:56

I didn’t know :deps alias is considered default and automatically loaded. Could you share where did you find that @U1G0HH87L? I’m asking this because you wrote “to be consistent with t.d.a”.

furkan3ayraktar05:09:57

Ah nevermind, you mean the main :deps key, not an alias. Yeah, those deps should be loaded

furkan3ayraktar05:09:08

And also paths I guess, if any.

tengstrand07:09:56

Yes you are right, it should be both the :paths and :deps . I update the issue!

👍 1
Travis18:09:39

just wondering, is there an example anywhere of a multimethod being used as a component ? curious what the interface would look like

furkan3ayraktar18:09:11

We have that in several components and it is not a special case. We define and implement the multimethod in the implementation (core.clj) and we have a single function that proxies to the implementation from the interface.clj. Let’s say multimethod is foo. It is implemented as usual. Then in interface:

(defn foo [args]
  (core/foo args))

Travis18:09:04

ah, ok. I think I see. Makes perfect since

Travis18:09:42

interface basically has no notion that there is a multimethod behind the scenes in core

furkan3ayraktar06:09:18

Yes, that is correct 👍

xlfe22:09:00

Just looking at polylith - really like the goals. Are there any public examples of poly with both jvm (deps.edn) and shadow-cljs (browser) bases in one monorepo?