Bradleycorn
08/07/2024, 6:41 PMkpgalligan
08/07/2024, 9:49 PMIs the intention that the (KMP) code in the "library" folder should be committed to the app's github repo?Yes I started writing up a long post about how it works internally last night, but it got offensively long pretty quickly. Mostly because I like to sidebar about things. In summary, there are 3 "repo linking" options that are generally available: • submodule • subtree • subrepo The first 2 are "official" git things, although submodule is more "official" than subtree. submodule does not store the code in the consuming repo. The other two options do. The general idea is that submodule puts its complexity right out in front to the developer, while the other two try to keep the complexity to admins or CI (generally). GitPortal is a rewrite of subrepo. Long story. For what GitPortal does, the source really needs to be in the app/consuming repo. This is one of several reasons why submodule wasn't the underlying tech used. In "unidirectional" mode, it's not that important. You could implement something similar with submodule, although it's pretty easy to get into trouble with submodule. In "bidirectional" mode, the whole point is that you edit the app code and KMP code in the app repo, and KMP changes are shared by CI. Also, I guess as an FYI, the sample folder is "library", but it can be any folder, or a subfolder. Also, FYI, all 3 options take all of the code in the "other" repo and stick it in a folder in the app/consuming repo.
Bradleycorn
08/08/2024, 1:25 PMBradleycorn
08/08/2024, 1:58 PMnew-feature
branch in my ios project and do some work, and then a team member pulls new-feature
to work on it, how do they know which "version" of the KMP code goes with that branch? Keeping the code in the app repo solves that problem. The KMP code is part of my ios app, just like all of the swift code (it's just compiled with a different compiler) so of course it should be in the app repo. That's sort of what made it click for me.kpgalligan
08/08/2024, 2:36 PMThe KMP code is part of my ios app, just like all of the swift code (it's just compiled with a different compiler) so of course it should be in the app repo.Yeah, that. Exactly. submodule is more generally used for importing library code. The mental "switch" I'm trying to push here is that the KMP code isn't library code. It's part of the app, Android or iOS. The difficulty is if both apps and KMP code are in the same repo, you can't edit either app safely without potentially changing the KMP code, then impacting the "other" app. So, there's more potential overhead for each change, and the teams are now "coupled". Splitting the apps, but syncing the KMP, could maybe solve that problem (we'll see what people think). Yesterday's post starts to get into the problems, but doesn't talk about solutions: https://touchlab.co/kmp-teams-piloting-vs-scaling More posts coming.
Bradleycorn
08/08/2024, 3:12 PMkpgalligan
08/08/2024, 3:28 PMkpgalligan
08/08/2024, 3:29 PM