-
Notifications
You must be signed in to change notification settings - Fork 172
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
Ability to generate typings for grpc-node service files #75
Conversation
My vote is on
If I understand correctly, just the |
They are generated, however they don't really have the full code for performing the call, and they heavily rely on the "magical" Not sure if this is the right issue to discuss, but I would like to have a golang-like API, because so far I find it the most robust. For unary methods they have a pretty straightforward implementation with usual function that returns a value, and for streaming calls they also have a function that accepts a |
This sounds good to me as well, I will implement that. Regarding the "code generation" for grpc-node. I think it really depends on how you internally work with
I am doing simple calls, no streaming whatsoever. So for me just having a However, I also could create JavaScript code which creates small snippets you can call
|
2ef5815
to
bf20513
Compare
Currently writing tests, but I don't really understand the test setup, yet. I am taking the existin But when I add now a second I think the examples should be seperated from files neede to test the code. |
Maybe we could add subfolders to the examples directory and then modify generate.sh to create them, eg
Would this help? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Is it possible to generate typings for the grpc-node services files? |
This PR is by far from being finished, I opened it anyway to allow some discussion.
Also #74 should be merged first in order to
npm run-script build
again.First of all the current output would be:
I have two points worth to discuss:
What should the command look like to differentiate between
grpc
definition files andgrpc-web
definitio files? At the moment simply usingservice=true
createsgrpc-web
files. However, the term "service" also appears in thegrpc
terminology. Maybe do something likeservice=grpc
andservice=grpc-web
? Might also lead to confusion. On the other hand, having to commands (e.g.grpc-web=true
andgrpc=true
) will lead to problems like: merge the twod.ts
files?What type of files do we want to generate? For my use case the
service.d.ts
(as shown above) file is sufficient. Are service stubs needed?