protobuf-javascript
protobuf-javascript copied to clipboard
Unable to access extensions from JavaScript
We use code like this to encode a version of the gRPC protocol:
import "google/protobuf/descriptor.proto";
extend google.protobuf.FileOptions {
string protocol_version = 51000;
}
option (protocol_version) = "0.1.0";
And in Python, one can access it using:
import test_service_pb2
version = test_service_pb2.DESCRIPTOR.GetOptions().Extensions[test_service_pb2.protocol_version]
But it seems there is no way to access extensions from JavaScript code?
Is this still the case? I am trying to write a protoc compiler in JS and I am similarly unable to get the extensions here (I believe).
The issue is here: https://github.com/protocolbuffers/protobuf-javascript/blob/main/generator/js_generator.cc#L432 . We should just delete the function.
hello, Does this problem still exist? I've also encountered