Hey đ
This question comes from an iOS background, and my Kotlin/Multiplatform knowledge is still fairly limited.
One thing we are struggling with is modularisation on the iOS side. Since the shared KMP code is exposed to iOS as a single framework, it feels hard to build a scalable/lightweight modular structure in the iOS codebase. Even if we improve our feature packaging internally (core modules, interface/implementation separation, etc.), most of our feature packages still end up depending on one large shared framework that keeps growing over time. Preventing our feature packages from being lightweight.
So Iâm wondering: has anyone found a good way to work around this? More specifically, is there any practical way to reduce or better control the impact of the single generated framework on the iOS side?
A couple of ideas Iâve thought about, but havenât validated yet:
⢠Generating a mock for every entity coming from the shared multiplatform code and having them all in a separate package where feature packages can depend on
⌠We would have another âgodâ package consisting only of mocks, which should still be better than the actual shared code package.
⌠Would require additional effort to register/resolve dependencies.
⌠Feels like too much overhead.
⢠Somehow dividing the generated framework into smaller chunks so feature packages only depend on what they need (But as far as I understood this is not really possible from Kotlin side)
Has anyone dealt with this before, or found a pattern that works well in practice? Thanks! đ