Migrate from native grpc package to grpc-js #83
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The grpc npm package is currently receiving maintenance updates only and plans to be deprecated in April. This PR updates
lnrpcto use the recommended grpc-js package instead.I ran into issues getting the latest version of Electron to function properly using the native
grpcpackage, so I decided to give it's successorgrpc-jsa try. I've tested with with both unary and streaming RPCs with no issues. The diff is pretty small since the API is almost identical.There was only one issue with this migration which was caused by the Proxy on the
grpc.Clientobjects. The getter would be called, and therefore promisify, internal method invocations such as client. checkOptionalUnaryResponseArguments. This function was returning aPromiseinstead of anobject, causing a bunch of errors. To resolve this, I updated the Proxy not to promisify calls to base class functions.I am opening this PR to save you all the effort that I spent today resolving my own
grpcissues. If you prefer not to use the approach I took, feel free to close this PR. No hard feelings from my end 😁