Skip to content

refactor(firestore): improve firestore types and add test - #8698

Closed
ycmjason wants to merge 4 commits into
invertase:mainfrom
ycmjason:fix-firestore-types
Closed

ycmjason wants to merge 4 commits into
invertase:mainfrom
ycmjason:fix-firestore-types

Conversation

@ycmjason

@ycmjason ycmjason commented Sep 16, 2025 •

Copy link
Copy Markdown
Contributor

Description

#8611 flaged that many types are currently broken.

This PR fixes most of the type issues by removing <AppModelType, DbModelType> and replaced with <T extends DocumentData>.

Also added tsd to make sure our .d.ts are legit. Fixed many issues thanks to it!

Related issues

#8611

Release Summary

Fix types for firestore

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

Added tsd to add some type testings to our apis.


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

@vercel

vercel Bot commented Sep 16, 2025 •

Copy link
Copy Markdown

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

Project Deployment Preview Comments Updated (UTC)
react-native-firebase Ready Ready Preview Comment Sep 16, 2025 8:49am

@ycmjason ycmjason changed the title fix firestore types and add test types: fix firestore types and add test Sep 16, 2025
@ycmjason ycmjason changed the title types: fix firestore types and add test types(firestore): fix firestore types and add test Sep 16, 2025
@ycmjason ycmjason changed the title types(firestore): fix firestore types and add test types(firestore): improve firestore types and add test Sep 16, 2025
@ycmjason ycmjason changed the title types(firestore): improve firestore types and add test refactor(firestore): improve firestore types and add test Sep 16, 2025
@cbdeveloper

Copy link
Copy Markdown

Hey there, any updates on this? Just got a runtime error as snapshot.exists() has become a method (I've recently upgraded from v21 to v23.3.1) and my code was still treating it as a property, and the types are now broken, so I got no type errors. Thanks!

@github-actions

Copy link
Copy Markdown
Contributor

Hello 👋, this PR has been opened for more than 2 months 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 15 days until this gets closed automatically

@github-actions github-actions Bot added the Stale label Oct 24, 2025
@cbdeveloper

Copy link
Copy Markdown

Hey @mikehardy @ycmjason , any updates on this one? Let me know if I can help somehow. Thank you

@github-actions github-actions Bot removed the Stale label Oct 29, 2025
@github-actions

Copy link
Copy Markdown
Contributor

Hello 👋, this PR has been opened for more than 2 months 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 15 days until this gets closed automatically

@github-actions github-actions Bot added the Stale label Nov 26, 2025
@mikehardy

Copy link
Copy Markdown
Collaborator

I think something bigger is about to happen - we've got a PR landing with long-awaited withConverter support

However, it will affect these firestore types deeply - could I ask an interested party here @ycmjason or @cbdeveloper to have a look at that and see what you think? The implementation there looks right but I'm unsure if it's a breaking change or not. The types appear to have fidelity with upstream firebase-js-sdk so they seem more correct to me but if they are breaking I want to make sure we release a major version with warning and explanation for everyone

And of course if I'm wrong in any of that analysis or assumptions please let me know 🙌

@github-actions github-actions Bot removed the Stale label Nov 29, 2025
@ycmjason

Copy link
Copy Markdown
Contributor Author

@mikehardy please count me in!

@mikehardy
mikehardy force-pushed the main branch 2 times, most recently from b38b33a to b1b9e92 Compare December 8, 2025 19:18
@mikehardy
mikehardy force-pushed the main branch 2 times, most recently from 38a52cd to 7af280b Compare December 8, 2025 20:10
@github-actions

github-actions Bot commented Jan 5, 2026

Copy link
Copy Markdown
Contributor

Hello 👋, this PR has been opened for more than 2 months 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 15 days until this gets closed automatically

This branch was successfully deployed

1 active deployment
Preview — 6d8173e7 Deployed Sep 16, 2025 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants