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

Browser Support #12

Open
snipebin opened this issue Oct 19, 2020 · 1 comment
Open

Browser Support #12

snipebin opened this issue Oct 19, 2020 · 1 comment

Comments

@snipebin
Copy link
Contributor

Currently the DGraphium client implementation relies on the gRPC dgraph-js client which is not designed to be used in the browser.

DGraph publishes https://github.com/dgraph-io/dgraph-js-http for browser envs.

I see two possible approaches to implement:

  1. Add browser support to @dgraphium/client by implementing the same interface but using https://github.com/dgraph-io/dgraph-js-http instead, then generating a bundle with the implementation and making it available using the https://docs.npmjs.com/files/package.json#browser field, or

  2. Create a new package, i.e. @dgraphium/http-client

Thoughts?

@binier
Copy link
Owner

binier commented Oct 19, 2020

I believe implementation part can be easily generalized across http and gRPC client's. So I'd definitely like to avoid repetition on that part...

2nd solution is a bit easier and more flexible, however only downside is that logic will need to go in another package (maybe client-core) and then we'll use it in both clients.

Not sure about the 1st option.. I doubt it will properly work for both versions without tradeoffs.

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

No branches or pull requests

2 participants