This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-30
Channels
- # announcements (5)
- # babashka (9)
- # beginners (48)
- # calva (300)
- # clj-kondo (9)
- # clojure (44)
- # clojure-austin (2)
- # clojure-europe (14)
- # clojure-uk (4)
- # clojurescript (1)
- # conjure (2)
- # datascript (3)
- # datomic (8)
- # exercism (5)
- # fulcro (1)
- # luminus (4)
- # music (1)
- # off-topic (12)
- # pathom (6)
- # rdf (18)
- # react (8)
- # sci (78)
- # shadow-cljs (12)
- # spacemacs (4)
- # tools-build (5)
- # tools-deps (26)
- # vim (4)
- # xtdb (8)
Have any of you worked on a hybrid of monolithic and split repo?
And by that, I mean a monolith that include child-libraries via git submodules, so that others can make use of these child-libraries via deps.edn
, while still working with it as if it was a monolith. I’m starting a project where I think it would make sense, but I would like to hear if others have some gotchas and bad experiences with it.
we use this approach in #babashka https://github.com/babashka/babashka worked out fairly well I think, cc @U04V15CAJ
for me forgetting to do a submodule update was the worst of the issues 😅
I don't get it! Why do you need git submodules if you have deps.edn?
because those git submodules are projects of their own. The alternative is to use them as git deps, but this allows me to quicker iterate
It sounds I've been doing exactly what @U0B1SDL67 is asking
You can use local/root in your parent project while the git submodules are still their own independent project
> independent project > You mean like a separate repo? Oh I'm sure there's a reason but I'm wondering how this is better than having everything on the same git repo.
Yes, a separate repo. E.g.: https://github.com/babashka/sci https://github.com/babashka/fs are projects on their own but also used in babashka. I don't want to bump a git sha every time I make a small change to SCI or fs, so I use them as git submodules. Putting all those projects inside the babashka repo doesn't make sense since those projects can be independently used from babashka.
Oh, I get it now, thanks for the explanation. I was going to recommend #polylith but if you need your projects to be separate repos it wouldn't work, obviously.
The way i think about it is if i have bunch of code deploying as a single purpose set of microservices, polylith seems to be a good fit. ie, one repo and multiple deployable artifacts/services. If its a single deployable artifact, use submodules and/or git/maven deps. Both approaches try to address the code resuse problem but for me it depends on what am I trying to build.
git/maven deps vs submodules comes down to your dev practices/iteration needs etc like borkdude mentioned
well in theory I could also make a small (bb) script that quickly updates the git/shas of the libraries that I'm developing
babashka is the only repo where I'm working like this. in other projects I usually switch between local/root and then back to git shas
in the babashka case, the build is also still based on leiningen which doesn't support git deps, which is why I chose git submodules initially. I needed uberjar, etc to work which wasn't there a few years ago in the deps.edn world
it's occurring to me that you can switch between local/root and git shas also via an -Sdeps
argument perhaps, for development
Just fyi, Clojure CLI does not work with git deps using sub modules