Skip to content

Remove unused options on field descriptors with excluded types #3730

Open
@emcfarlane

Description

@emcfarlane

Feature

Excluding types removes the types and types that depend on it (fields, methods). Options aren't removed from the file descriptor as they can safely be ignored as unrecognized bytes when the extension is removed.

However, this can bloat the generated code for languages that include the full file descriptor. Languages like ruby are particular sensitive as the bytes aren't compressed. For example, using protovalidate/example removing protovalidate types with --exclude-type=buf.validate will produce generated code without dependency on buf.validate but the protovalidate options account for 15% of the generated code size. Protobuf-es v2 (protoc-gen-es) is also affected but less at 5%.

Metadata

Metadata

Assignees

Labels

FeatureNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions