Skip to content

feat(firestore): Add data converter - #8672

Closed
supersimple33 wants to merge 3 commits into
invertase:mainfrom
supersimple33:feat/AddDataConverterTypes
Closed

supersimple33 wants to merge 3 commits into
invertase:mainfrom
supersimple33:feat/AddDataConverterTypes

Conversation

@supersimple33

Copy link
Copy Markdown

Description

I have added the withConverter method which is provided in the JS sdk to the package here.

Release Summary

  • Added withConverter to CollectionReference
  • Created new interface FirestoreDataConverter

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 Aug 23, 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 Aug 23, 2025 5:55pm

@CLAassistant

CLAassistant commented Aug 23, 2025 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@supersimple33 supersimple33 changed the title feat(firestorm): Add data converter feat(firestore): Add data converter Aug 25, 2025
@supersimple33

Copy link
Copy Markdown
Author

Bump!

@supersimple33

Copy link
Copy Markdown
Author

Bump!

@macksal

macksal commented Sep 11, 2025

Copy link
Copy Markdown

Have you noticed that CollectionReference only has one type param, but it's passed two?

export interface CollectionReference<T extends DocumentData = DocumentData> extends Query<T> {

In your method declaration:

withConverter<NewAppModelType, NewDbModelType extends DocumentData = DocumentData>(
  converter: FirestoreDataConverter<NewAppModelType>,
): CollectionReference<NewAppModelType, NewDbModelType>;

It's not just your code, I came across this PR because there's something wrong with these typings already.

@supersimple33

supersimple33 commented Sep 12, 2025 •

Copy link
Copy Markdown
Author

Hey @macksal good catch I didn't notice it but you're right the types in this repo aren't yet inline with the firebase sdk since they are lacking the DbModel type im gonna remove that for now since adding it should be its own PR.

Edit: or actually after taking a quick look it may make more sense for me to just add it in now I guess since that type is needed elsewhere.

@MichaelVerdon

Copy link
Copy Markdown
Contributor

Hi there, this looks good can you please add some tests?

@JohnValanidas

JohnValanidas commented Oct 21, 2025 •

Copy link
Copy Markdown

Any traction on this @supersimple33 ? if not, I wouldn't mind putting some work in. I could really use this for something I am working on.

@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 18, 2025
@mikehardy

Copy link
Copy Markdown
Collaborator

Obsoleted by #8744 which will hopefully merge soon

This branch was successfully deployed

1 active deployment
Preview — 370ee659 Deployed Aug 23, 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.

6 participants