GitLiveApp / firebase-kotlin-sdk

A Kotlin-first SDK for Firebase
https://gitliveapp.github.io/firebase-kotlin-sdk/
Apache License 2.0
1.11k stars 153 forks source link

Remove Native classes from Public API #555

Closed Daeda88 closed 3 months ago

Daeda88 commented 3 months ago

Fixes based on comment https://github.com/GitLiveApp/firebase-kotlin-sdk/pull/550#issuecomment-2190589666

nbransby commented 3 months ago

Understood, do these @PublishedApi function appear in the kdocs I wonder.

Does this change also mean the ios, android and is properties don't need to be extensions?

Daeda88 commented 3 months ago

Afaik internal methods marked with @PublishedApi are not accessible from kotlin, but they are from Java. So I don't think they need Kdoc.

As for the extensions for android/ios/JS, they are still needed as they extend the classes that are in common code, e.g 'Query', to provide access to the Native classes (e.g. 'NativeQuery'). It used to be that these native classes, usually Typealiases, where public as well, but with this change all of that is internal. So in order to still support construction with platform specific code I added some 'invoke' methods to the companion objects though extension as well.

That means, you can still do 'Query(androidQuery)' on platform code, but no longer from common code and it requires an import of 'dev.gitlive.firebase.firestore.invoke'.

nbransby commented 3 months ago

ok so ill finish the breaking change of converting all .js, .android, .ios properties to extensions in https://github.com/GitLiveApp/firebase-kotlin-sdk/pull/504

nbransby commented 3 months ago

Afaik internal methods marked with @PublishedApi are not accessible from kotlin, but they are from Java. So I don't think they need Kdoc.

Yes they dont need a docblock but I still wonder if dokka will publish them in the api docs