vtprotobuf icon indicating copy to clipboard operation
vtprotobuf copied to clipboard

Add protobuf editions support

Open jun-song-6723 opened this issue 5 months ago • 5 comments

I added support for Protobuf Editions by updating the plugin.SupportedFeatures variable in cmd/protoc-gen-go-vproto/main.go.

I also updated the versions of all dependencies in go.mod to support this feature.

jun-song-6723 avatar Jul 10 '25 15:07 jun-song-6723

+1 for adding support for Editions

@vmg can you please review this change, or is there someone else who can? Thanks 🙏

matthewd98 avatar Nov 25 '25 21:11 matthewd98

Tagging contributors with recent activity who can hopefully help review and merge this: @nockty @howardjohn @evgfedotov @GiedriusS @coxley @dethi

matthewd98 avatar Nov 29 '25 18:11 matthewd98

I don’t have commit privileges, so my review benefit is low. :)

That being said, it would help if the PR included reproducible before/after test instructions to make it easier to validate. I’ve never used editions, and perhaps the others haven’t either. This means I don’t have anything easy off-hand to validate behavior prior and expectations after the change.

coxley avatar Nov 29 '25 19:11 coxley

I don’t have commit privileges, so my review benefit is low. :)

That being said, it would help if the PR included reproducible before/after test instructions to make it easier to validate. I’ve never used editions, and perhaps the others haven’t either. This means I don’t have anything easy off-hand to validate behavior prior and expectations after the change.

Thanks for responding!

In short, editions replace syntax = "proto2" or syntax = "proto3". Instead of the hardcoded behaviors of the past, editions define a collection of features, each with a default behavior that can be overridden at multiple levels (e.g., file, message, field)

They shouldn’t affect the generated code unless a new feature is introduced in a later edition that vtproto doesn’t yet support. That said, I agree with you about adding a test to show the generated code matches expectations.

matthewd98 avatar Nov 30 '25 04:11 matthewd98

This is very neat and should help unblock some stuff I want to do on my end.

+1 for adding tests to this PR. Even just a simple test in https://github.com/planetscale/vtprotobuf/tree/main/testproto would help us prevent regression in the future.

sluongng avatar Dec 01 '25 12:12 sluongng