Closed badsyntax closed 3 years ago
@badsyntax what's the status of this PR? 🤔
@IchordeDionysos unfortunately i'm still waiting on these changes to be released:
https://github.com/grpc/grpc-node/pull/1587 https://github.com/grpc/grpc-node/pull/1590
i need those changes to build a generic service interface that will work with both grpc
and @grpc/grpc-js
packages
https://github.com/grpc/grpc-node/pull/1587 is published so this PR is good for a review!
Any thoughts about this @MarcusLongmuir?
@MarcusLongmuir Any thoughts about this one? It's not a huge change but would be helpful for people i reckon.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: MarcusLongmuir
To complete the pull request process, please assign
You can assign the PR to them by writing /assign
in a comment when ready.
The full list of commands accepted by this bot can be found here.
Thanks for the merge @MarcusLongmuir. Is there an ETA for a release?
Apologies for the delay. We've just been overhauling a lot of permissions and repo configurations that made this rather laborious.
This has gone out in 0.14.0
: https://www.npmjs.com/package/ts-protoc-gen/v/0.14.0
Awesome thank you!
Unless i'm completely missing something, it's not possible to use the types generated by this package for a server implementation. This change fixes that.
I've had to make various upstream changes to allow the types to work across the
grpc
and@grpc/grpc-js
packages. I've been following & contributing to theproto-loader
typescript generator changes in https://github.com/grpc/grpc-node/pull/1474, and changes in this PR align with those changes.If using
@grpc/grpc-js
, a minimum version of1.2.0
is required. I'm not sure how best to handle this, whether we would mention this in the readme, or add it as apeerDependency
?grpc
and@grpc/grpc-js
packages. The code in this PR will generate types that only work with@grpc/grpc-js
. I hope to get come clarity on the types mismatch soon.~grpc
for this to work.~Changes
Example usage
Verification
I've used the generated files in an example app and they seem ok. I briefly explored writing tests but all the existing tests are testing the javascript implementation and not the generated types, so not sure how best to create tests for typescript interfaces.
I believe we can ignore the the failing build (linting) as this new code is consistent with existing code.
Related
https://github.com/improbable-eng/ts-protoc-gen/pull/221