firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

Firestore Swift Cpp Experiment

Open cherylEnkidu opened this issue 1 year ago • 3 comments

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.

cherylEnkidu avatar Oct 23 '24 02:10 cherylEnkidu

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

Generated by :no_entry_sign: Danger

google-oss-bot avatar Oct 23 '24 02:10 google-oss-bot

Apple API Diff Report

Commit: 0e81241c75ca2be6977aee732588d277d0ae9fe3 Last updated: Tue Feb 11 13:31 PST 2025 View workflow logs & download artifacts


[BUILD ERROR] FirebaseFirestoreInternal


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] FirebaseFirestore


github-actions[bot] avatar Oct 23 '24 02:10 github-actions[bot]

I only see relative paths in public headers which is required. Is there a place where relative headers are used other than in a public header?

Aw I see, so public headers can only used relative path?

The reason I am asking is that I cannot include existing files from the previous API folder, Firestore/core/src/api. For example, I am unable to add Firestore/core/src/api/aggregate_query.h. Even when using a relative path for aggregate_query, the file contains other includes with full paths that Swift Package Manager cannot resolve.

Also, use relative path would fail syntax check: Firestore/core/interfaceForSwift/api/collection_stage.h:19: Include the directory when naming .h files [build/include_subdir]

cherylEnkidu avatar Jan 08 '25 16:01 cherylEnkidu