Update nodejs quickstart to document static codegen path.
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.
Issue for readme: grpc/grpc#8025
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
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?
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.
Can we close this?
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.