feat: allow passing grpc in service constructor#241
Conversation
Codecov Report
@@ Coverage Diff @@
## master #241 +/- ##
=========================================
+ Coverage 92.18% 92.3% +0.12%
=========================================
Files 4 4
Lines 307 312 +5
Branches 60 62 +2
=========================================
+ Hits 283 288 +5
Misses 15 15
Partials 9 9
Continue to review full report at Codecov.
|
|
|
||
| if (config.grpc) { | ||
| this.grpc = config.grpc; | ||
| this.grpcVersion = config.grpcVersion || 'grpc/unknown'; |
There was a problem hiding this comment.
It would be nice if we had a way to track specifically which grpc module is getting used, and what version. I think we're going to want that data.
There was a problem hiding this comment.
We cannot - I asked about it a few days ago and there is no way to tell from inside the code if we are using this or that version of gRPC. Asking clients to pass a version is probably the best solution here. Given that we control all clients, we can make sure we do pass the version all the time.
Alternatively, I can throw if grpc is passed and grpcVersion is not. WDYT?
There was a problem hiding this comment.
The only alternative I can think of here is having a common interface for grpc (core and js) that effectively returns the version and distribution.
Would you mind filing a feature request against gRPC? Should be additive. I'd be ok with what's here for now, but I just want a plan to have better data as we go.
This PR prepares us to the Global Switch to
@grpc/grpc-js. Making it possible to pass anothergrpcimplementation for those packages that are not yet ready to switch.