Fork me on GitHub
#polylith
<
2021-08-07
>
emccue02:08:10

I have maybe a broad question about polylith - how "big" should components be?

emccue02:08:30

the examples have things like an article component

emccue02:08:21

but (realistically) the kinds of apps i've made have been one "main" deploy target, with a few smaller ones for periphery jobs or a really large codebase with multiple teams mostly independent projects

emccue02:08:37

and in the first case having small components feels like too much granularity

emccue02:08:48

and in the second it feels like it floods a global namespace

seancorfield05:08:27

@emccue I talk a bit about that in https://corfield.org/blog/2021/06/06/deps-edn-monorepo-3/ which focuses on naming, modularization, and dependencies. I don't think there's a "too big" or "too small" line to be drawn with any hardness but I think those three dimensions are something Polylith makes you think about.

seancorfield05:08:53

(In part IV I talk briefly about us switching to using projects for every deployable artifact -- and we have since moved all of our amorphous "batch jobs" code into bases (as batch-jobs) with a single -main entry point so that was a "large" block of code in a single brick (1,040 lines src + 170 lines test). Our largest two components are about 700 lines, but many of them are 100 lines at most. That just naturally seemed to be the granularity of things that we could identify as having as well-defined name, that represented a single, modular concept, with just the right amount of dependencies.

furkan3ayraktar06:08:29

Small and many components gives a lot of flexibility and ease during development time. Makes it easier to refactor, locate bugs, and communicate about the codebase within the team. In my opinion a codebase should not optimize the deployment or the artifact, it should optimize the developer experience.

3
pez13:08:30

@furkan3ayraktar: Rumour has it that you posted some pictures of your project dependencies here a while ago. It seems to have died at the 10K messages limits. Can you post again?

furkan3ayraktar13:08:19

Of course! Some fresh ones:

polylith 3
🤯 3
3
pez13:08:25

Haha, that’s awesome!

emccue18:08:55

These pictures are beautiful and i don't understand them really

😆 5
emccue19:08:36

but they are beautiful

pez19:08:10

Totally agree. Would be awesome in a frame on the wall.

❤️ 2
tengstrand20:08:28

I think the dependency diagram looks like something taken from The Matrix! 🙂

furkan3ayraktar04:08:44

Hahah, “You get used to it, I don’t even see the code”