[go: nahoru, domu]

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

functional api like firebase/firestore #1662

Open
Fuzzyma opened this issue Jan 20, 2022 · 3 comments
Open

functional api like firebase/firestore #1662

Fuzzyma opened this issue Jan 20, 2022 · 3 comments
Assignees
Labels
api: firestore Issues related to the googleapis/nodejs-firestore API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@Fuzzyma
Copy link
Fuzzyma commented Jan 20, 2022

Is your feature request related to a problem? Please describe.

The old firebase/firestore API seems to be the same as the one of the nodejs-firestore SDK. However, with v9 you get a functional approach with firebase/firestore and its actually quite pleasant to use. Beside this, I have to use 2 different apis for 2 different usecases now and that kinda sucks

Describe the solution you'd like

Are there any plans on moving to the functional API for this package as well?

@Fuzzyma Fuzzyma added priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Jan 20, 2022
@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/nodejs-firestore API. label Jan 20, 2022
@ehsannas ehsannas self-assigned this Jan 21, 2022
@ehsannas
Copy link
Contributor

Thanks for your suggestion @Fuzzyma . The assumption is that server-side code is not sensitive to the size (as much as a web client), and as a result clients would benefit most from the tree shaking. I do see your point about the advantages of not using two different APIs for different use cases. I'll follow up with the team to see whether there are any plans for this and I'll post an update when I have more information.

@Fuzzyma
Copy link
Author
Fuzzyma commented Jan 21, 2022

I agree that size concerns don't don't apply for node. But consistency is rather important.

There is one more important factor: composition doesn't need monkey patching. A good example is the package fireway. It patches the methods from this package to allow for dry runs and to track stats. However, if those methods would simply be functions, a wrapper would serve the same functionality in a way cleaner and maintainable way.

Also: I am pretty sure atm there is a lot of duplicated code between firebase/firestore and @google-cloud/firestore which probably could be reused when using compositional code.

@laurentpayot
Copy link

@Fuzzyma you might find this firebase-admin discussion interesting: firebase/firebase-admin-node#1238

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/nodejs-firestore API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants