I have a big question big, Why <explicitAPI> is no...
# multiplatform
f
I have a big question big, Why explicitAPI is not by default in the shared library template of KMP? On Swift a library is internal by default and on Kotlin it’s open. Using explicitAPI, especially for iOS, reduce the exposed content, so the generated header content and I guess the compilation time. I mean, It forces the developer to control what is exposed.
👀 1
thank you color 2
j
> I mean, It forces the developer to control what is exposed Many of us argued that
internal
should be the default prior to 1.0 and nothing in the last 10 years has really changed my mind on that. Still seems like a huge blunder to make it public. Explicit API is sad, but it's all we've got. I agree it should be in any kind of template one might use to create a library.
f
Yes, that’s the common reason to use this rule when developing a library. In KMP, it has another important, especially for iOS, as everything is public, the bridge contains also everything, meaning lesser performance for Xcode dev experience and more ...
j
Thanks for sharing @François! I'd never heard of
explicitApi
before, despite maintaining two KMP libraries. In one of them I unintentionally exposed a small test class before. Not a big deal but nice to have a way to prevent that 👀
f