Skip to content

feat!: add Edition 2024 Support#2060

Merged
mkruskal-google merged 2 commits intoprotobufjs:masterfrom
mkruskal-google:edition2024
Dec 16, 2025
Merged

feat!: add Edition 2024 Support#2060
mkruskal-google merged 2 commits intoprotobufjs:masterfrom
mkruskal-google:edition2024

Conversation

@mkruskal-google
Copy link
Copy Markdown
Contributor

This adds basic edition 2024 support in preparation for our upcoming 32.0 release. This is not completely finalized yet, and this PR will likely be held off until closer to the release date.

Edition 2024 only adds 2 new global features, and two grammar changes:

  • Import option - similar to import weak but more constrained and well-behaved. These imports are only only necessary during .proto parsing and should only be used for option interpretation (which protobuf.js doesn't do). They do not represent codegen dependencies and it is not valid to non-option symbols exported from option dependencies
  • Visibility modifiers - new export/local modifiers are now available for enums and messages, with a global feature default_symbol_visibility to control the default behavior. These will allow you to hide symbols from other proto files, but have no effect on codegen. The default behavior in 2024 changes from EXPORT_ALL to EXPORT_TOP_LEVEL, where only top-level symbols are exported without an explicit export modifier.
  • Style guide enforcement - A new enforce_naming_style feature will enable style guide enforcement in protoc by default starting in edition 2024. This can be disabled by setting it to STYLE_LEGACY

Copy link
Copy Markdown
Contributor

@sofisl sofisl left a comment

Choose a reason for hiding this comment

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

My biggest question is, why are we deleting 2023 defaults? Can't protos specify what edition version they're going to use?

@mkruskal-google
Copy link
Copy Markdown
Contributor Author

We're not deleting 2023 defaults, we're just adding 2024 ones

@mkruskal-google mkruskal-google merged commit 53e8492 into protobufjs:master Dec 16, 2025
6 checks passed
@mkruskal-google mkruskal-google deleted the edition2024 branch December 16, 2025 18:47
@github-actions github-actions bot mentioned this pull request Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants