Skip to content

fix(firestore): restore generic root type exports#8989

Closed
russellwheatley wants to merge 3 commits into
mainfrom
issue-8975
Closed

fix(firestore): restore generic root type exports#8989
russellwheatley wants to merge 3 commits into
mainfrom
issue-8975

Conversation

@russellwheatley

@russellwheatley russellwheatley commented Apr 21, 2026

Copy link
Copy Markdown
Member

Description

Fix a Firestore TypeScript regression where root imports like DocumentSnapshot, Transaction, and WriteBatch resolved to non-generic runtime class declarations instead of the intended public generic types.

This updates the Firestore root export surface and emitted declarations so root-imported Firestore types behave correctly in type positions again, and adds regression coverage for the reported usage patterns.

Why compare-types did not catch it

compare-types currently compares Firestore modular/type files such as types/firestore.d.ts and modular.d.ts, not the package root index.d.ts consumer surface.

Because the generic types already existed in the modular/type declarations, the script saw the Firestore shapes as matching. The regression was in how the root package entrypoint re-exported those symbols for consumers importing from @react-native-firebase/firestore, which sits outside the current compare-types boundary.

Related issues

Release Summary

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
    • Other (macOS, web)
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan


Think react-native-firebase is great? Please consider supporting the project with any of the below:

@vercel

vercel Bot commented Apr 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-native-firebase Error Error Apr 28, 2026 1:53pm

Request Review

@russellwheatley russellwheatley changed the title Issue 8975 fix(firestore): restore generic root type exports Apr 21, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces generic type support (AppModelType and DbModelType) across the Firestore SDK, including CollectionReference, DocumentReference, DocumentSnapshot, Query, QuerySnapshot, Transaction, and WriteBatch. These changes enable improved type safety when working with custom data models and converters. The review feedback identifies opportunities to simplify type casting in FirestoreTransaction.ts where existing type information makes double-casting redundant.

Comment thread packages/firestore/lib/FirestoreTransaction.ts Outdated
Comment thread packages/firestore/lib/FirestoreTransaction.ts Outdated
Ehesp
Ehesp approved these changes Apr 27, 2026
Ehesp
Ehesp approved these changes Apr 27, 2026
@russellwheatley russellwheatley marked this pull request as ready for review April 30, 2026 08:27
@mikehardy

Copy link
Copy Markdown
Collaborator

I like this - but as a part of the full commit stream #8997 where it's been picked

@russellwheatley

Copy link
Copy Markdown
Member Author

Closing out, fix was merged in #8997

@InvertaseBot

Copy link
Copy Markdown
Collaborator

In order to prioritize work in this repository, closed issues and pull requests do not regularly receive attention.

If the underlying issue or pull request still requires attention, opening a new issue with a reproduction
after testing with current versions, or reposting the pull request as a new PR may be the most effective way forward.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐛] v24 new typescript interface not working

4 participants