Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firestore Swift Cpp Experiment #13956

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open

Conversation

cherylEnkidu
Copy link
Contributor

@cherylEnkidu cherylEnkidu commented Oct 23, 2024

Here are some imperfections in this PR. Please feel free to suggest better solutions:

  1. Exposure of C++ APIs in the Objective-C Interface
    The Swift layer can only access public APIs of Objective-C. In Swift Package Manager, only a single path can be designated as the public header path. To enable additional features in the Swift layer, it must access internal C++ members held by the Objective-C object.

  2. Swift's async/await functionality requires Objective-C callbacks for implementation. As a result, a public API—used exclusively by the Swift layer—was introduced. (Potentially this can be avoid using a C++ class contains Swift member, since the current structure only supports one way dependency, Swift class has C++ member. This impl is listed as a future improvement)

  3. The FirebaseFirestoreCpp binary build structure in Swift Package Manager is currently written as pseudo-code and has not been verified.

  4. The include path in this PR using relative path instead of full path, since full path leads to build failure for unknown reason.

@google-oss-bot
Copy link

google-oss-bot commented Oct 23, 2024

1 Warning
⚠️ Did you forget to add a changelog entry? (Add #no-changelog to the PR description to silence this warning.)

Generated by 🚫 Danger

Copy link
Contributor

github-actions bot commented Oct 23, 2024

Apple API Diff Report

Commit: ca0161f
Last updated: Thu Jan 30 12:58 PST 2025
View workflow logs & download artifacts


FirebaseCore

Functions

[MODIFIED] FIRFirebaseVersion
[MODIFIED] FIRFirebaseVersion
Swift:
+  func FirebaseVersion () -> String
-  func FirebaseVersion () -> String
Objective-C:
+  NS_SWIFT_NAME ( FirebaseVersion ()) NSString * FIRFirebaseVersion ( void )
-  NSString * _Nonnull FIRFirebaseVersion ( void )

[BUILD ERROR] FirebaseFirestoreInternal


[BUILD ERROR] FirebaseFirestore


s.public_header_files = 'FirebaseFirestoreInternal/**/*.h'
s.public_header_files = [
'FirebaseFirestoreInternal/**/*.h',
'Firestore/Swift/Source/SwiftAPI/*.swift',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swift files should not be in the headers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants