google / google/protobuf.dart

Consider generating enum classes in the same file with messages

Open
#688 1 comment 3 reactions 0 assignees View on GitHub
refactoring
Dominant language
Dart
Stars
572
Forks
196
Avg merge
1h 59m
Merged PRs (30d)
2

Description

Currently classes for enums are defined in separate files. I don't know what the reason was for this, and it's not documented. I asked to a few people and they also don't know. We should just generate enum classes in the same files with messages.

One problem is how to migrate existing code that imports `.pbenum.dart` files without too much disruption. If it's possible to (1) import and re-export things from another file (2) add a deprecation warning to a file, then we can generate a warning when the `.pbenum.dart` files are imported but keep exporting the same classes. Then remove the files in a few releases.

cc @sigurdm

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.