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

Update gRPC library in dgraph-js to use gRPC-js #125

Merged
merged 11 commits into from
Sep 25, 2020

Conversation

all-seeing-code
Copy link
Contributor

@all-seeing-code all-seeing-code commented Sep 22, 2020

  1. Extend support to connect to dgraph client via Slash endpoints and apiKey
const clientStub = new dgraph.clientStubFromSlashGraphQLEndpoint(
  graphQlEndpoint,
  apiKey
);
const dgraphClient = new dgraph.DgraphClient(clientStub);
  1. Migrate from grpc npm module to grpc-js in lieu of the deprecation of the former.

This change is Reviewable

@all-seeing-code all-seeing-code requested a review from gja September 24, 2020 09:50
Copy link
Contributor

@vardhanapoorv vardhanapoorv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: Minor comments. Add an example for this in the examples folder and also add a section in README regarding the usage. Later let's see if we can add a test for this.

Reviewed 2 of 17 files at r1, 2 of 3 files at r2, 4 of 10 files at r3, 8 of 12 files at r4, 2 of 2 files at r5, 2 of 2 files at r6, 8 of 8 files at r7.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @anurags92 and @gja)


package.json, line 53 at r7 (raw file):

  "dependencies": {
    "@grpc/grpc-js": "^1.1.7",
    "@types/url-parse": "^1.4.3",

"@types/url-parse" can go in devDependencies


examples/tls/index.js, line 12 at r7 (raw file):

    //     $ dgraph cert -n localhost
    //     $ dgraph cert -c user
    console.log(path.join(__dirname, "tls", "ca.crt"));

log statement can be removed


src/clientStubFromSlash.ts, line 5 at r7 (raw file):

import { DgraphClientStub } from "./clientStub";

const PORT = "443";

can be lowercase

@all-seeing-code all-seeing-code merged commit 60b803c into master Sep 25, 2020
@all-seeing-code all-seeing-code deleted the anurags92/updategrpc branch September 25, 2020 12:01
shivaji-kharse pushed a commit that referenced this pull request Nov 5, 2024
Currently, the `grpc` dependency is causing the issue shown in issue
#231 due to an incompatibility with the most recent version of `grpc`
and any platform other than Linux based on our testing. We've also shown
reports that the prebuilt binaries downloaded by `gprc` are causing
massive bloat _**(nearly a 5x increase in size)**_ to our bundles that
are generated with the dependency included.

Upon investigation, we noticed that `grpc` isn't actually used by
anything in the library anymore, and was seemingly [added back by
mistake](#183) during the
most recent release, as `@grpc/grpc-js` is used in place of it.

Sources:
[Original PR](#125) to remove
`grpc`
[PR I made last year](#164),
where `grpc` was not in the list of dependencies at the time,
reinforcing the fact that it was added back by mistake
[The README of this very
repo](https://github.com/dgraph-io/dgraph-js?tab=readme-ov-file#install),
which has instructions to install `@grpc/grpc-js` and not `grpc`, and
[here is the PR](#182) where
that change was made

This PR is to remove the `grpc` dependency from the package to
accomplish the following:
- remedy the installation issue
- reduce install sizes
- get rid of an unused dependency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants