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.