grpc.github.io icon indicating copy to clipboard operation
grpc.github.io copied to clipboard

Update nodejs quickstart to document static codegen path.

Open hsaliak opened this issue 9 years ago • 6 comments

Now that gRPC.io 1.0 is launched, we can update our nodejs quickstart to document the static codegen facilities available.

Things needed:

  • Explain how to install the grpc_node plugin. Add readme for grpc-tools
  • Explain how protoc and the grpc plugin that ships with grpc-tools static code can be used to generate code.

@LisaFC not sure if this is something you can pick up given that we have an example already. @murgatroid99 i'll file a bug in the grpc repo to add README.md to grpc-tools, after which I think @LisaFC will have the content needed to make this change.

hsaliak avatar Sep 07 '16 21:09 hsaliak

Issue for readme: grpc/grpc#8025

hsaliak avatar Sep 07 '16 21:09 hsaliak

examples/node/static_codegen/README.md is not work for me.

This is my solution. Run commands in examples/node

  • $ npm install grpc-tools
  • codegen
./node_modules/grpc-tools/bin/protoc.js --js_out=import_style=commonjs,binary:./static_codegen/ --grpc_out=./static_codegen/ -I ../protos/ ../protos/helloworld.proto

sherdeadlock avatar Oct 24 '16 13:10 sherdeadlock

Should we document both approaches in the Quickstart or just mention the static option?

I know in the Tutorial we just use the dynamic model and mention the static version in the intro: http://www.grpc.io/docs/tutorials/basic/node.html#example-code-and-setup

Also do we currently recommend one approach over the other?

LisaFC avatar Oct 24 '16 13:10 LisaFC

I would lean towards only showing the canonical way of generating code, which I assume is through the tools exposed through the grpc-tools node package.

markmandel avatar Oct 25 '16 22:10 markmandel

Can we close this?

jtattermusch avatar Dec 12 '17 20:12 jtattermusch

can someone answer @LisaFC 's question? namely, is there a recommended approach? if there's no recommandation to use the dynamic approach thant the static one should be better documented. Also, I feel the static approach is better suited for typescript folks IMO since typings could be generated with protoc.

adematte avatar Feb 05 '18 09:02 adematte