-
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
Support for proto3 optional fields #263
Comments
Looking at the code, I think that supporting that could be as easy as updating the implementation of ts-protoc-gen/src/ts/message.ts Line 17 in e680d69
|
This would be a very useful feature for users who are holding on to proto2 because of |
I definitely need this feature. Now it's a blocker in my project wechaty/grpc#109 |
I'm going to take on fixing this. DefinitelyTyped/DefinitelyTyped#52380 is a requirement to fix this in this repo. |
Thanks for picking this up @awbraunstein. Apologies for the delay on acking this. I made progress on this branch, but got sidetracked before getting to address the types that you've contributed to DefinitelyTyped. Feel free to take from that branch (if you don't already have it functioning) and raise a PR once the types are merged. Thanks! |
@MarcusLongmuir Thanks for the pointer to the branch. I have something that looks very similar locally, though I haven't written any tests yet, so I may steal yours. |
This is resurrecting #227 which has been closed without any feedback.
protoc 3.12+ has experimental support for
optional
in proto3 (see https://github.com/protocolbuffers/protobuf/blob/master/docs/implementing_proto3_presence.md). Of all the code generators I checks, this one is the only one which does not support it.As its goal is to generate declaration files for the protoc JS output which does support that feature, it would be great if it could be supported.
The text was updated successfully, but these errors were encountered: