feat(firestore): variable() and arrayFilter() API features for pipelines#9017
feat(firestore): variable() and arrayFilter() API features for pipelines#9017russellwheatley wants to merge 19 commits into
variable() and arrayFilter() API features for pipelines#9017Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request expands the Firestore pipeline capabilities by adding support for variable expressions and array filtering. These additions allow developers to perform more advanced queries and data transformations directly within pipelines. The changes include updates to the core library, native bridge implementations for both Android and iOS, and updated type definitions to support the new API surface. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for variable expressions and the arrayFilter function within Firestore pipelines across Android, iOS, and Web platforms. The changes include updates to the serialization and parsing logic in native code, the addition of new TypeScript interfaces and helper functions, and comprehensive testing including unit, type, and E2E tests. A review comment suggests refining the return type of the variable function to VariableExpression to enhance type safety and maintain consistency with the Firebase JS SDK.
variable() and arrayFilter API features for pipelinesvariable() and arrayFilter() API features for pipelines
|
iOS fails surprisingly not flakes |
|
Hello 👋, this PR has been opened for more than 14 days with no activity on it. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically |
|
have this one about ready locally but other priorities while it went stale 🤦 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #9017 +/- ##
==========================================
+ Coverage 60.70% 63.43% +2.74%
==========================================
Files 239 288 +49
Lines 11586 14701 +3115
Branches 2774 3128 +354
==========================================
+ Hits 7032 9324 +2292
- Misses 4444 5318 +874
+ Partials 110 59 -51 🚀 New features to boost your workflow:
|
* feat(firestore): arrayFirst and arrayFirstN API features * feat(firestore, ios): arrayFirst and arrayFirstN API features * feat(firestore, android): arrayFirst and arrayFirstN API features * test(firestore): arrayFirst and arrayFirstN API features * chore(firestore): arrayFirst and arrayFirstN API removed from config * chore: iOS does not support arrayFirst and arrayFirstN yet
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
The native Swift implementation already supports arrayFirst and arrayFirstN pipeline functions. Remove them from the JS-side unsupported guard so they can reach the native runtime on iOS.
…st/arrayFirstN from iOS unsupported list
7fedf77 to
af7e195
Compare
… bridge FIRFindNearestStageBridge expects EUCLIDEAN/COSINE/DOT_PRODUCT uppercase strings; lowercase values from JS were rejected with invalid-argument.
Export nor from the pipelines API and coerce xor/nor through boolean expressions on iOS. Parse count_if aggregate predicates from expr or args.
Tag integer literals in JS and coerce them through numericOperand on iOS so 0/1 are not bridged as booleans in arithmetic and ordering comparisons. Preserve Bool/CFBoolean in constant bridging.
…sions Add iOS lowering for array_slice, array_last_n, maximum_n, and minimum_n with literal or expression count/offset arguments.
Add regression tests for nor, countIf, findNearest, integer constants, array helpers, and related pipeline stages exercised during iOS fixes.
af7e195 to
41991b4
Compare
|
firestore pipeline nearest and firestore transaction failures on other noted - will investigate |
Description
Adds Firestore Pipeline expression APIs and native lowering for
variable(),arrayFilter(),arrayFirst,arrayFirstN, and related array helpers, plus iOS bug fixes found during e2e verification.Features
arrayFilter()in the JS pipeline builder and public exportsvariable()across TypeScript, web/macOS reconstruction, Android, and iOS loweringarrayFirst,arrayFirstN,arrayLastN,arraySlice,arrayMaximumN,arrayMinimumNnative lowering (Android + iOS)Bug fixes (iOS pipeline native)
findNearestdistanceMeasuretoEUCLIDEAN/COSINE/DOT_PRODUCTforFIRFindNearestStageBridge(lowercase values causedinvalid-argument)norand coercexor/northrough boolean-expression lowering likeand/orcount_ifaggregate predicates fromexprorargs[0]Bool/CFBooleanin constant bridging; avoid treating booleanNSNumberas integersintegerLiteralin JS and coerce vianumericOperandon iOS so0/1are not bridged as booleans in arithmetic and ordering comparisonsarrayFirst/arrayFirstNfrom iOS unsupported-function guard (now lowered natively)Tests & infra
Pipeline.e2e.jscoverage (99 passing on iOS and Android against cloudpipelines-e2e)Related issues
Release Summary
Firestore Pipelines:
variable(),arrayFilter(), array helper expressions, and iOS pipeline coercion fixes for booleans, integers,nor,count_if, andfindNearest.Checklist
AndroidiOSOther(macOS, web)e2etests added or updated inpackages/**/e2ejesttests added or updated inpackages/**/__tests__Test Plan
yarn tests:jest packages/firestore/__tests__/pipelines-parity.test.tsyarn tests:ios:test-reuse)yarn tests:android:test-cover-reuse)pipelines-e2evector index deployed;findNeareste2e passesThink
react-native-firebaseis great? Please consider supporting the project with any of the below:React Native FirebaseandInvertaseon Twitter