This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-27
Channels
- # announcements (1)
- # aws (10)
- # babashka (53)
- # calva (133)
- # clj-kondo (46)
- # cljdoc (6)
- # cljs-dev (33)
- # clojure (105)
- # clojure-boston (1)
- # clojure-europe (11)
- # clojure-nl (4)
- # clojure-poland (1)
- # clojure-switzerland (6)
- # clojure-uk (13)
- # clojurescript (106)
- # cursive (1)
- # datascript (2)
- # emacs (13)
- # events (1)
- # figwheel-main (4)
- # fulcro (17)
- # graphql (8)
- # heroku (2)
- # honeysql (8)
- # lsp (76)
- # luminus (30)
- # malli (12)
- # meander (23)
- # music (1)
- # nextjournal (83)
- # off-topic (6)
- # pathom (3)
- # polylith (19)
- # re-frame (8)
- # reagent (2)
- # reveal (3)
- # shadow-cljs (54)
- # sql (9)
- # testing (11)
- # tools-deps (15)
- # xtdb (14)
I’m starting with polylith, and I find that copying the function signatures from the implementation to the interface is annoying. I still like the idea of the separation though. I’m thinking about, as a starting point, generating these signatures. Have others have the same thought?
Are you migrating an existing codebase or writing code from scratch?
There are no tools that I know about that could generate a first guess of an interface.
I think everyone finds it a bit annoying at first, but I've found that it's a good time to think about docstrings and function ordering. I tend to keep my interface
files in strictly alphabetical order and have the docstrings focused on users/client code calls, but my impl
files in grouped functionality order and docstrings focused on future maintainers.
Given a polylith project with global extra-deps, when I update a global dependency, then how do I get the dependent projects and trigger a CI?
You can only add library dependencies to the component, base and project level, not to the workspace top level. The way to go is to add the “global” dependency to all your projects.
The https://github.com/furkan3ayraktar/clojure-polylith-realworld-example-app has this deps.edn-file in the root-level...what about these deps defined there? Why are they defined there?
The :dev
and :test
aliases in the root deps.edn
file configures the development
project. All other aliases in that file configures things you want to do with the Clojure CLI, for example specifying the alias`:outdated` to use https://github.com/liquidz/antq.
Q about public dynamic vars and Polylith: I have some (currently legacy) code that has a public dynamic var that callers need to set via binding
when calling into the module. The dynamic var is part of the public interface but it's also something that the implementation has to rely on. Given that, in Polylith, the interface
requires the impl
, I can't put it directly in the interface
because the impl
could not require the interface
. Is this one of those cases where something like top.brick.interface.dynamic
would be a good location, so that both client code and the brick implementation can require it, much as is recommended with protocols? (i.e., top.brick.interface.protocols
)
I think this is the right way to go. Putting the shared code in the sub-interface looks clean to me.

If the only operations you are doing on the dynamic var are reading and binding, you can just expose some functions in the interface that do the same job