bufbuild / protobuf-es

Protocol Buffers for ECMAScript. The only JavaScript Protobuf library that is fully-compliant with Protobuf conformance tests.
Apache License 2.0
960 stars 55 forks source link

V2: Support option retention #827

Closed timostamm closed 1 month ago

timostamm commented 1 month ago

This PR adds support for option retention: Options can specify whether they should be included in generated code (making them accessible at runtime), or be only available for plugins, while generating code.

With this change, options that specify retention = RETENTION_SOURCE are available in plugins written on top of @bufbuild/protoplugin. But they will not be included in the code generated by protoc-gen-es.