Skip to content

feat!: add Edition 2024 Support #2060

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mkruskal-google
Copy link
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

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.

1 participant