Fork me on GitHub
#polylith
<
2022-01-17
>
Hukka09:01:50

What are the benefits of transitioning to polylith via base first and monolithic component second (https://polylith.gitbook.io/polylith/conclusion/should-you-convert-your-system#from-a-monolith)? I was thinking that I would go with base first, and then start separating sensible components directly out of the bloated based.

james10:01:34

I don’t think that skipping the “monolithic component” step will cause you any problems. The reason it’s suggested in the documentation is because the step doesn’t add much overhead, keeps the system in a functional state during the migration, and puts the code closer to where it should be in a single step.

👍 1
tengstrand11:01:45

First you migrate to a single base, and then you extract all code except the public API into a monolithic component. The result is one base and one component. Another way of doing it is to start with a base, and then tease out one component at a time from that base. Normally your codebase has some kind of public API and that’s the reason we recommend starting with a base.

Hukka13:01:32

Yeah, I am doing the latter

👍 1
Pieter Koornhof12:01:02

We had 4 big apps, we started by migrating 1 of them in as a base. Then using those learnings we migrated in the second, also as a base, and continued like that. We are now up to 4 bases and our components have organically started growing out of these. We do not plan to actively move everything into components, because it will be too much work, but as we build new things and touch existing things, we do it from the component perspective. This is working pretty well for us as we could keep on delivering features while gradually optimising the codebase. We did have to overcomes (and are still overcoming) some issues because of existing architecture in our bases, but these are more of a speed bump than a road block and we are also overcoming those as time goes on. All in all still very happy we moved over

polylith 2
tengstrand12:01:30

I think we should skip the “monolithic component” step in the documentation. It’s better to keep the “mess” in the base while extracting to components. I add it to my todo list.

tengstrand05:01:29

Without the monolithic component, the components you extract can’t access code in the base, which means you can only extract code in “the leaves”, that doesn’t depend on other components (alternatively, also extract the code it needs into components at the same time). I guess this is probably still a better alternative (in many cases) than having a huge monolithic component that exposes parts of its functionality in its interface to support extracted components.

Hukka06:01:54

Indeed there were some… dependencies that I needed to solve. I really wanted one piece of functionality out of the base, so I could share it with another (cli and api). Ended up doing 5 components in the first refactor to solve the internal dependencies. But I could have just as well taken it all into one component that still wouldn't have been as massive as the original monolith.

Hukka06:01:17

I like that now while my base is bloated, I know that the components make sense

tengstrand06:01:47

Yes, I agree that it makes sense to keep all components clean.

tengstrand12:02:35

I’ve updated the https://app.gitbook.com/o/-LAhrWK-mSHRqiTNUTDP/s/-LAhrWK1psIWk5h5zNLV/conclusion/should-you-convert-your-system so that we now suggest people to extract one component at a time from the base.

tengstrand21:01:02

Hi everyone. I would like some help testing https://github.com/polyfy/polylith/tree/issue-160. Now a workspace will not automatically be initiated and commited to git. To get the old behaviour, you have to pass in :commit to the create workspace command. Please try it out and see how it works. One way is to install poly as a CLI Tool, like this (using the latest sha from the issue-160 branch): clojure -Ttools install io.github.polyfy/polylith '{:git/sha "07a85b4c679fcbab0ae0af64c1e928b43496894e" :deps/root "projects/poly"}' :as poly Then you can start a shell with: clojure -Tpoly shell …and play around with the “create workspace” command, e.g. create workspace name:myws top-ns:com.my.company :commit If the :commit parameter is left out, you can still run the different commands, but it will lack git information, and therefore the commands will behave like there were no changes in the workspace. One more thing. When you are running a shell, the autocomplete for “create workspace” is only accessible if you are outside a workspace. If you are inside an existing workspace, then you have to remember the “create workspace” syntax yourself.

polylith 4
1
💪 1
👍 2