Skip to content

Switch generator to use bufbuild/protoplugin#119

Open
stefanvanburen wants to merge 2 commits intomainfrom
svanburen/protoplugin
Open

Switch generator to use bufbuild/protoplugin#119
stefanvanburen wants to merge 2 commits intomainfrom
svanburen/protoplugin

Conversation

@stefanvanburen
Copy link
Member

No strong feeling on landing this, but just wanted to see how our plugin would look if we integrated https://github.com/bufbuild/protoplugin, which eliminates some of the boilerplate of handling the plugin.

Vaguely relates to #18, although I think the language the plugin is written in now is less important than ever.

Also takes a pass at cleaning up the go code and tests.

No strong feeling on landing this, but just wanted to see how our plugin
would look if we integrated https://github.com/bufbuild/protoplugin,
which eliminates some of the boilerplate of handling the plugin.

Vaguely relates to #18, although I think the language the plugin is
written in now is less important than ever.

Also takes a pass at cleaning up the go code and tests.

Signed-off-by: Stefan VanBuren <svanburen@buf.build>

resp.SupportedFeatures = proto.Uint64(uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) | uint64(pluginpb.CodeGeneratorResponse_FEATURE_SUPPORTS_EDITIONS))
resp.MinimumEdition = proto.Int32(int32(descriptorpb.Edition_EDITION_PROTO3))
resp.MaximumEdition = proto.Int32(int32(descriptorpb.Edition_EDITION_2023))
Copy link
Member Author

@stefanvanburen stefanvanburen Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regardless of whether or not we land this, it's probably only a matter of time before we're asked to support edition 2024. (similar: grpc/grpc#40639)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool - I don't mind adding that in this PR, or can be a different one, there doesn't seem to be any new syntax for services as usual

Signed-off-by: Stefan VanBuren <svanburen@buf.build>
@stefanvanburen
Copy link
Member Author

I know we've already solved our go -> wheel setup with goreleaser, but looks like https://github.com/simonw/go-to-wheel is a new approach (just wanted to mention!).


resp.SupportedFeatures = proto.Uint64(uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) | uint64(pluginpb.CodeGeneratorResponse_FEATURE_SUPPORTS_EDITIONS))
resp.MinimumEdition = proto.Int32(int32(descriptorpb.Edition_EDITION_PROTO3))
resp.MaximumEdition = proto.Int32(int32(descriptorpb.Edition_EDITION_2023))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool - I don't mind adding that in this PR, or can be a different one, there doesn't seem to be any new syntax for services as usual

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants