-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(firestore, types): support Generic Types #3810
Conversation
Updates firestore types to generic types, as is in the firestore web SDK. Allows to define specific document data types ensuring type safe operations with collections and documents, plus the convenience of automatic auto-complete from type defined document data.
Cool! Has a CI fail though, which I think would be resolved by simply opening the root of the monorepo in Visual Studio Code, re-opening the file, and asking it to reformat. Or perhaps from command-line asking prettier to auto-fix? I have it run as a save-hook on Code now so I'm not sure if it's configured correctly for command line
|
Hi @franciscosolla ! Sorry for the delay in reviewing this. I like the change a lot, I'm leaning towards merging it but I'd like to ask - are you certain this is not a breaking change? Or will this break typings for any of the users? I have no problem with breaking changes, but I do have a problem with accidentally breaking people without it being a semantic-version major release is all, and I want to mark it correctly. I'll try to test this locally in my project as well to cross-check Thanks! |
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/invertase/react-native-firebase/i6txvz1is |
We have added a feature to the repo where a patch-package file is generated for any changes so that others may easily test, the patches that implement this change are here: https://github.com/invertase/react-native-firebase/suites/1145045506/artifacts/16455376 I will test them myself to see if the typings still work in my work project, without regression |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the change applied to harmonize the DocumentData type with firebase-js-sdk this seems to work fine in my work project
Wow, I had forgotten about this haha, sorry. Thank you for fixing it. I'm happy that I could contribute to your project. I use it in every project I develop haha. Awesome work! @mikehardy |
* Updates Firestore Types to Generic Types Updates firestore types to generic types, as is in the firestore web SDK. Allows to define specific document data types ensuring type safe operations with collections and documents, plus the convenience of automatic auto-complete from type defined document data. * Update packages/firestore/lib/index.d.ts Co-authored-by: Mike Diarmid <mike.diarmid@gmail.com> Co-authored-by: Mike Hardy <github@mikehardy.net>
Updates firestore types to generic types, as is in the firestore web SDK.
Allows to define specific document data types ensuring type safe operations with collections and documents, plus the convenience of automatic auto-complete from type defined document data.
Description
I use type defined document data with firebase in my projects. Because the react-native-firebase implementation of firestore is not type generic I find myself replicating the type file to make then generic in my projects. As I have seen other people with the same problem, I decided to commit the types I've been using.
Related issues
Release Summary
Checklist
Android
iOS
e2e
tests added or updated inpackages/\*\*/e2e
jest
tests added or updated inpackages/\*\*/__tests__
Test Plan
Think
react-native-firebase
is great? Please consider supporting the project with any of the below:React Native Firebase
andInvertase
on Twitter