This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-25
Channels
- # aleph (18)
- # announcements (7)
- # asami (18)
- # babashka (15)
- # babashka-sci-dev (79)
- # beginners (61)
- # calva (4)
- # clj-kondo (23)
- # cljfx (16)
- # cljs-dev (6)
- # clojure (63)
- # clojure-bay-area (3)
- # clojure-europe (33)
- # clojure-nl (1)
- # clojure-survey (4)
- # clojure-uk (5)
- # clojurescript (136)
- # conjure (1)
- # cursive (8)
- # datahike (7)
- # datalevin (1)
- # datomic (30)
- # emacs (10)
- # events (2)
- # figwheel (2)
- # fulcro (20)
- # google-cloud (1)
- # lsp (6)
- # luminus (4)
- # malli (5)
- # music (3)
- # nextjournal (1)
- # off-topic (9)
- # other-languages (3)
- # pathom (16)
- # polylith (34)
- # re-frame (14)
- # reagent (19)
- # releases (6)
- # sci (2)
- # shadow-cljs (33)
I'm revisiting this project after a year of last looking at it (29th March, if I recall 馃檪 )
I'm about to start on a new project and I was going to see if I could use polylith and see how it works out for me. One thing I want to retouch again and is important, is the use of a "dependency" library (the one I prefer is juxt Clip). In that, I can "wire" together various things (like database connections, redis connections, and configuration for jetty/ring and so on and so forth). I was wondering then, would the idea be to have the -main
that initialises juxt clip in a component? Does anyone have any prior insight/experience of using clip (or mount, or integrant) with Polylith and an approach I could learn from?
Hi @U11EL3P9U! I haven鈥檛 heard Clip before so I can鈥檛 comment on that. I know some people uses Stuart Sierra鈥檚 Component with Polylith. We use mount in our project at work. We have states in several components that fetch configuration from AWS Systems manager when they get initialised, so we do not have config files around. Mount states depend on each other by just requiring a state from another namespace, which goes well with Polylith鈥檚 idea in my opinion. However, I haven鈥檛 actually used other options like Integrant or Component in a real project to say mount is better or worse. You can have a look at https://app.slack.com/client/T03RZGPFR/C013B7MQHJQ/thread/C013B7MQHJQ-1636972221.236800 and also check out @U04V70XH6鈥檚 https://github.com/seancorfield/usermanager-example/tree/polylith to see how you could use Component in a project.
Thank you. I'm currently experimenting with integrating Juxt Clip in a fresh example project to see how it might work. Let's see what happens!
I suppose (not related to clip per se), but a -main
being a public API should go into base
?
Exactly, external/public API鈥檚 should go into bases
I think Component users initialise their state in the bases as well.
If you have a public repo, it would be nice to share with the rest of the world! 馃挭
So, got a little example running that uses juxt cilp to inject certain things (like db connection etc). I've noticed, and this most likely already answered, there is duplication in the deps.edn. So, in my dev
alias in the workspace, I had to relist all the reitit
dependencies that are also listed in the bases/rest-api/deps.edn
file. This seems also to be the case (which I used as a basis for reference) in
(thanks @furkan3ayraktar). Is this just a given of how this all works?
Duplication of dependencies only necessary in case you are using Cursive IDE (https://github.com/cursive-ide/cursive/issues/2554). It鈥檚 also mentioned https://polylith.gitbook.io/poly/workflow/testing#how-tests-are-executed in the documentation.
Ah right, so in my workspace deps.edn, I can reference, for example, {:extra-deps {bases/rest-api {local/root "bases/rest-api"}}}}
:thumbsup:
Hey folks, is there any nicer way of getting a project
s classpath (from the command line) than cd-ing to its subfolder and using the clojure cli?
Hi! There is no command for that in the poly CLI at the moment. What is your use case for this? If we can justify it, we can add a new command for this. It wouldn鈥檛 be too hard to include it in the CLI tool since we have the code for calculating the classpath for the tests already in the workspace.
NVD checking, using a tool like https://github.com/rm-hull/nvd-clojure
Also, while I'm here asking questions, how difficult you think it would be to add a command to poly CLI that returns the commits that affect a project? We're trying to figure out how we could keep https://clojurians.slack.com/archives/C013B7MQHJQ/p1645449050736409 for our projects once they are migrated
Yeah, you can open a Github issue.
For the latter, I鈥檓 not sure but @U1G0HH87L could answer that better. If we have it somewhere in the code, maybe we can include it in the workspace map, so that you can extract from there. I think, a separate command for this could be to much for poly tool, however, that鈥檚 just my opinion. Also, @U1G0HH87L is playing with letting users of poly CLI to add their own commands to the tool. Once that happens, this could be something you can add easily, as long as it鈥檚 in the workspace map.
While waiting for custom commands to be implemented, you can create an alias in your workspace and include the the polylith
repo, see how :extra-deps
is included https://github.com/polyfy/polylith/blob/4189a30782f1ed21aa1fb55e50355bd862e4b339/examples/doc-example/deps.edn#L27 + your own code that uses the poly code to read the workspace. The workspace contains which bricks a project contains, e.g. projects:poly:component-names:src
. Based on that information and the bricks, you should be able to implement this yourself (with support from me, if needed) @U08BJGV6E.