-
Notifications
You must be signed in to change notification settings - Fork 821
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
fix(grpc): patch original client methods #631
Conversation
Codecov Report
@@ Coverage Diff @@
## master #631 +/- ##
==========================================
- Coverage 91.95% 91.89% -0.07%
==========================================
Files 190 189 -1
Lines 9487 9350 -137
Branches 856 852 -4
==========================================
- Hits 8724 8592 -132
+ Misses 763 758 -5
|
this: typeof grpcTypes.Client, | ||
methods: grpcTypes.ServiceDefinition<ImplementationType>, | ||
methods: { [key: string]: { originalName?: string } }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this ServiceDefintion
type removed for better readability?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's right.
d783b9e
to
a1a85fd
Compare
shimmer.massWrap( | ||
client.prototype as never, | ||
Object.keys(methods) as never[], | ||
methodsToWrap as never[], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this a never[]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Would be nice to add a test (if not too difficult), perhaps by using the example provided in the issue ?
4fa0107
to
b664db2
Compare
a9771a2
to
6897a29
Compare
Which problem is this PR solving?
Short description of the changes
The client constructor in the grpc module creates a method alias using the originalName (if present). We didn't patch/trace these methods before, so this PR resolves this problem.
Original issue nodejs client doesn't seem to work with include path, anymore grpc/grpc#12135
I have verified the solution with grpc example with dynamic codegen and been confirmed to be working.
/cc @markwolff