-
Notifications
You must be signed in to change notification settings - Fork 654
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
createPackageDefinition without doing file I/O? #550
Comments
One of the primary goals of the proto-loader library is to avoid tying the API too directly to Protobuf.js's API, because we've been burned by that before. We are looking into other solutions for exposing message reflection information in the proto-loader library output, but we never had the intention of allowing people to construct message objects using Protobuf.js APIs made available by the output of gRPC. So if you actually have to construct message objects, you should continue to load the message types separately as you are currently doing. |
OK, I'll try to forget I ever knew that Protobuf.js was in there. |
Also, there's no support for grpc using pbjs / pbts at the moment. See #528. |
Or in other words, if you want compile-time code generation of your proto definitions, please use protoc instead. See https://github.com/grpc/grpc/tree/master/examples/node/static_codegen |
from protobufjs/protobuf.js#1117 also in need of the I am using the dynamic_codegen but not from https://github.com/grpc/grpc/blob/master/examples/node/dynamic_codegen/greeter_client.js So far my solution is to have a copy of this compiled this solution is not perfect, but works for my need; hopefully @nicoasnobble @murgatroid99 you guys can make a better solution |
Is your feature request related to a problem? Please describe.
I have a service
DeployService
that uses types such asPar
. I'm usingPar.create()
and such in one part of my app where I'm not doing any I/O, and making calls toDeployService
in other parts of the app.I can make a
Protobuf.Root
from the .json version of my message types that I get frompbjs
. This is fine forPar.create()
and such. But I don't see how to get aPackageDefinition
from this root. The only option I see isloadPackageDefinition
that does all the work of pbjs again, only at runtime.Describe the solution you'd like
export
createPackageDefinition
.Or at least make the
Protobuf.Root
available from thePackageDefinition
.Describe alternatives you've considered
I considered forking this code and adding the export declaration.
But out of expediency: I'm loading the message types twice: once for
Par.create()
and such, and again for gRPC calls.Additional context
for reference, the project I'm working on is https://github.com/JoshOrndorff/RChain-API
cc @JoshOrndorff
The text was updated successfully, but these errors were encountered: