| commit | a1dceed95d7e9250bea950a2ed10173f43ab83f6 | [log] [tgz] |
|---|---|---|
| author | Ömer Sinan Ağacan <omersa@google.com> | Mon Nov 17 12:30:45 2025 +0100 |
| committer | GitHub <noreply@github.com> | Mon Nov 17 11:30:45 2025 +0000 |
| tree | 63c75e5b302f6479575974f9f5caf4cf47ffc489 | |
| parent | 46c36977f213c961148a9455a5894f2e8c7ba722 [diff] |
protoc_plugin refactors (#1082) - Move static method `FileGenerator._getDeclaredMixins` to the end of the file as a top-level function. This is a utility method but it came first in the class and it's quite large (~90 lines). Move it to the end so that it will allow top-down reading of the class and won't obstruct more important details like fields. - Refactor import prefix generation: currently if I'm importing `container` in `file`, I need to do `container.importPrefix(context: file)`. This is confusing and it took me a while to figure out what it's doing: It's a method on the container type but it modifies the file. Files can import, not containers. So files should have import prefixes, not containers. Move the method to `FileGenerator`. The code above now looks like `file.importPrefix(container)`. Also document the fact that just generating the import prefix for an imported thing does not make it imported automatically. This is quite error prone, if I call `file.importPrefix(container)` and use the prefix in e.g. `EnumGenerator`, I need to make sure to update `FileGenerator` to actually generate the import. It would be good to refactor this so that just using an prefix is enough to import it. But for now this part is not done. - Minor changes: use spread syntax instead of `[]..addAll(...)` and similar. Add one line space between some of the fields.
Protocol Buffers (protobuf) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data.
This repository is home to packages related to protobuf support for Dart.
| Package | Description | Published Version |
|---|---|---|
| protobuf | Runtime library for protocol buffers support. | |
| protoc_plugin | A protobuf protoc compiler plugin used to generate Dart code. | |
| benchmarks | Benchmarks for various protobuf functions. |
For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.