[FR]: Expose the Firestore Pipelines API to Objective-C
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- objective-c, swift
Research direction
Start by reading the Swift Pipelines implementation under Firestore/Swift/Source/SwiftAPI/Pipeline and the Objective-C bridge in FIRPipelineBridge.h to understand the existing API surface. The issue proposes either a new supported Objective-C API or stabilizing the bridge, so the design and scope need agreement before implementation. Done means Objective-C-bound clients can use Pipelines through a documented, supported API; the issue names no tests to run.
Written by the indexing model from the issue text.
Description
Description
-
Use case. Cross-language consumers of the Firebase iOS SDK that bind it through Objective-C cannot use Firestore Pipelines. The concrete case is Kotlin Multiplatform: Kotlin/Native's cinterop (and the Kotlin Gradle plugin's SwiftPM import) sees only Objective-C headers, so a Kotlin library such as the GitLive Firebase Kotlin SDK, which mirrors the Firebase Android SDK's
com.google.firebase.firestoreAPI on iOS overFirebaseFirestoreInternal, can reach every Firestore feature except Pipelines. The Android SDK (com.google.firebase.firestore.pipeline) and the JS SDK (firebase/firestore/pipelines) both expose Pipelines to their languages, so Pipelines is now the one Firestore feature a shared Kotlin codebase cannot offer on iOS. The same applies to any other Objective-C-bound binding (React Native's Objective-C modules, Flutter's Objective-C plugins, C# bindings). -
Current behaviour. The Pipelines API is implemented in Swift (
Firestore/Swift/Source/SwiftAPI/Pipeline) on top of the Objective-C bridge inFIRPipelineBridge.h. The bridge classes are the only Objective-C-visible part, and 13.0.0 prefixed them with__(__FIRPipelineBridge,__FIRExprBridge,__FIRStageBridge, ...) to mark them internal and hide them from autocomplete, so they are neither a supported nor a stable surface. The Swift API itself uses structs, generics and protocols (Expression,Pipeline,PipelineSnapshot), which do not get@objcrepresentations. Everything else recently added to Firestore has an Objective-C surface (FIRVectorValueand+[FIRFieldValue vectorWithArray:], theminimum/maximumtransforms in 12.19.0, the new BSON types in 13.0.0), which is what makes Pipelines the outlier. -
Proposal. Give Pipelines a supported Objective-C API, in either of two shapes:
- Public Objective-C classes mirroring the Android/JS surface: a
FIRPipelineSourcereturned by-[FIRFirestore pipeline], aFIRPipelinewith stage methods,FIRExpr/FIRField/FIRConstantexpression classes,FIRAggregateFunction,FIROrdering, andFIRPipelineSnapshot/FIRPipelineResultfor the results. The Swift API could then be a thin layer over these, as the rest of Firestore's Swift extensions are over the Objective-C classes. - Or promote the existing bridge classes to a supported, documented API (drop the
__prefix or add public typealiases), with the usual source-stability guarantees, since the bridge already covers the stages, expressions and results the Swift API uses.
- Public Objective-C classes mirroring the Android/JS surface: a
API Proposal
A sketch of the first shape, following the Android SDK's pipeline() / collection() / where() / sort() / execute() naming:
FIRPipeline *pipeline = [[db pipeline] collection:@"books"];
pipeline = [pipeline where:[[FIRField fieldNamed:@"rating"] greaterThan:[FIRConstant constantWithInt:4]]];
pipeline = [pipeline sort:@[ [[FIRField fieldNamed:@"rating"] descending] ]];
pipeline = [pipeline limit:10];
[pipeline executeWithCompletion:^(FIRPipelineSnapshot *_Nullable snapshot, NSError *_Nullable error) {
for (FIRPipelineResult *result in snapshot.results) {
NSLog(@"%@", result.data);
}
}];
With a realtime variant mirroring addSnapshotListener: on queries:
id<FIRListenerRegistration> registration =
[pipeline addSnapshotListener:^(FIRPipelineSnapshot *_Nullable snapshot, NSError *_Nullable error) { ... }];
Firebase Product(s)
Firestore
- Dominant language
- C++
- Stars
- 7k
- Forks
- 1.8k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 70
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from firebase/firebase-ios-sdk
-
api: analytics
Difficulty 4/5 3-5 days Newbie friendliness 35/100
firebase/firebase-ios-sdk#17075 ·
Maintainers usually reply within 1 day
-
api: firestore
Difficulty 4/5 3-5 days Newbie friendliness 43/100
firebase/firebase-ios-sdk#17073 ·
Maintainers usually reply within 1 day
-
RTDB: `.info` listen `onComplete` runs off the repo queue, so `infoSyncTree` is mutated from two threads (crash in `FSyncTree applyOperationHelper`)Possibly taken @paulb777 claimed this 3 days ago. Open
firebase/firebase-ios-sdk#17069 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Firestore watch stream keeps an expired App Check token until the next Auth refresh (no-op App Check change listener in FirestoreClient)Possibly taken @dconeybe claimed this 5 days ago. Openapi: firestore
firebase/firebase-ios-sdk#17056 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
api: crashlytics
Difficulty 4/5 3-5 days Newbie friendliness 35/100
firebase/firebase-ios-sdk#17046 ·
Maintainers usually reply within 1 day
All issues in firebase/firebase-ios-sdk
Similar issues
-
feat
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Issue-Docs Needs-Triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
microsoft/winget-cli#6692 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stratum-mining/sv2-tp#167 ·
Maintainers usually reply within 1 day
-
better error message bug low priority semantics strings
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day