grpc icon indicating copy to clipboard operation
grpc copied to clipboard

Proto 3.15 supports `optional` again!

Open huan opened this issue 4 years ago • 1 comments

According to https://stackoverflow.com/a/62566052/1123955, we can get rid of the wrapper in our protos.

Presence tracking was added to proto3 in response to user feedback, both from inside Google and from open-source users. The proto3 wrapper types were previously the only supported presence mechanism for proto3. Users have pointed to both efficiency and usability issues with the wrapper types.

See: https://github.com/protocolbuffers/protobuf/blob/v3.12.0/docs/implementing_proto3_presence.md#background

This change will be a BREAKING CHANGE so it should be discussed later.

Useful Resources

Blockers

  • [x] gen-grpc-gateway, gen-openapiv2: add support for proto3 optional
    • https://github.com/grpc-ecosystem/grpc-gateway/pull/1951
    • Released v2.3.0 (2021-02-25)
  • [x] Failed to generate pb file when using proto3 version.
    • https://github.com/grpc/grpc-node/issues/1717
    • grpc-tools v1.11.0: Bump protobuf dependency to 3.15.6 #1718
    • grpc-tools v1.11.1: make the plugin compatible with proto3 optional fields #1725
  • [x] grpc_tools_node_protoc_ts
    • https://github.com/agreatfool/grpc_tools_node_protoc_ts/issues/88
  • [ ] protoc-gen-lint
    • https://github.com/ckaznocha/protoc-gen-lint/issues/20
  • [x] ts-protoc-gen (web gRPC)
    • https://github.com/improbable-eng/ts-protoc-gen/issues/263

More details

huan avatar Feb 19 '21 12:02 huan

Hi, I stumbled upon this issue while tackling the similar problem: yoheimuta/protolint#234.

FWIW, protoc-gen-protolint supports proto3 optional. Moreover, protoc-gen-protolint is meant to be a drop-in replacement of protoc-gen-lint. I hope your blocker issue will be resolved soon.

yoheimuta avatar May 04 '22 02:05 yoheimuta