Skip to content
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

[🐛] Modular API discrepancies from firebase-js-sdk #7967

Open
jin-qin opened this issue Aug 12, 2024 · 3 comments
Open

[🐛] Modular API discrepancies from firebase-js-sdk #7967

jin-qin opened this issue Aug 12, 2024 · 3 comments
Labels

Comments

@jin-qin
Copy link

jin-qin commented Aug 12, 2024

Issue

Observed some modular API discrepancies between react-native-firebase and firebase-js-sdk.

For example, DocumentSnapshot::exists() is declared as a function in firebase-js-sdk while it is defined as a boolean value in react-native-firebase. There are some similar cases but unfortunately I am not able to identify all of them.

This issue bothered me because I want to write platform-specific codes with firebase-js-sdk and react-native-firebase.

Say I have two wrapper files named firebase.native.ts (import react-native-firebase) and firebase.web.ts (import firebase-js-sdk), then I have another file named test-api.ts which imports either firebase sdk based on platform. In this file, it tries to read from Firestore and want to check if snapshot exists. I expect the usage like snapshot.exists() can work for both native and js environment while currently it cannot.

Kindly ask if someone can help fix them? Thank you so much!


@russellwheatley
Copy link
Member

Hi, thanks for raising this. It would constitute a breaking change. I've raised this internally as we're thinking of having a breaking change in the nearish future, and this seems like it should be a part of that.

@gregfenton
Copy link
Contributor

Note: the field .exists was a property in the Firebase Web Client SDK up to v8. It became a method .exists() in v9.

Copy link

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

@github-actions github-actions bot added the Stale label Sep 23, 2024
@mikehardy mikehardy added Keep Open avoids the stale bot and removed Stale labels Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants