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

firebase_interop package #47

Open
m1-nann opened this issue Jan 28, 2019 · 1 comment
Open

firebase_interop package #47

m1-nann opened this issue Jan 28, 2019 · 1 comment

Comments

@m1-nann
Copy link

m1-nann commented Jan 28, 2019

Could we also create firebase_interop package? I am aware there is already the firebase package for Flutter and Web. Though it does not work on node, or planned to focus on node.

One of the reason I would want to have it on node is to write apis for clients that first runs in node before actually get on the browser.

Another reason is that the firebase and firebase-admin libraries share many similarities between then database and firestore. I would suggest to be able to seperate those two from the admin_interop in the future.

This is my use case:

class Context{
  Database realtime;
  Firestore firestore;
}
mixin CartWriter implements Context, NodeBase {
  update(){
    realtime.ref(this.ref).update(this.toJSON);
  }
}

Now if I want to user CartWriter for both server and client, it's a little tricky because it has to distinguish between Database from firebase and one from firebase-admin.
One requirement is that the client API cannot import firebase_admin_interop.dart because it includes the require('firebase-admin'), which shouldn't be packaged together in the build.

What do you think?

@pulyaevskiy
Copy link
Owner

This looks similar to pulyaevskiy/firebase-admin-interop#16

There is definitely a need to unify api interfaces across different platforms which include web, server and Flutter.

It’ll probably require a separate firebase_api package which is used by all platform specific packages to implement actual functionality.

I’d definitely like that. It’s just a matter of finding time for this. (it would also require collaboration across all maintainers if platform specific packages so that generic interface satisfies everyone’s requirements).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants