Releases: google/protobuf.dart
package:protoc_plugin v22.3.0
- Update the generated code to improve readability and to better follow common Dart patterns.
- No longer generate empty enum (
*.pbenum.dart
) files. - No longer generate empty server (
*.pbserver.dart
) files. - Ignore
implementation_imports
for some generated files.
package:protoc_plugin v22.2.0
-
Bump
protobuf
constraint to^4.1.0
-
Read
default_host
andoauth_scopes
options from gRPC service definitions
and write that information to the generated gRPC clients. -
Adjust the deprecation messages for the message
clone()
andcopyWith()
methods (#998). -
Generate dartdocs for grpc services (#973).
We now parse and generate code cooresponding to the proto options
google.api.default_host
andgoogle.api.oauth_scopes
:service Firestore { option (google.api.default_host) = "firestore.googleapis.com"; option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform," "https://www.googleapis.com/auth/datastore"; ...
Will generate as:
class FirestoreClient extends $grpc.Client { /// The hostname for this service. static const $core.String defaultHost = 'firestore.googleapis.com'; /// OAuth scopes needed for the client. static const $core.List<$core.String> oauthScopes = [ 'https://www.googleapis.com/auth/cloud-platform', 'https://www.googleapis.com/auth/datastore', ]; ...
-
Minimum SDK dependency bumped from 3.3.0 to 3.6.0. (#1001)
package:protobuf v4.1.0
package:protoc_plugin v22.1.0
- Fix factory argument types for protobuf
Map
fields. (#975) - Fix import order changes when files are passed in different order to
protoc
. (#952) - Add fromDart() and toDart() methods to convert between core Duration and proto Duration (#986)
- Update the GRPC service generator to emit constructors that use super parameters.
package:protoc_plugin v22.0.1
- Bump
protobuf
constraint to^4.0.0
package:protoc_plugin v22.0.0
- Remove
PbEventMixin
mixin. (#738) - Type of repeated fields is now
PbList
(instead ofList
), type of map fields is nowPbMap
(instead ofMap
). (#903) This change requires protobuf-4.0.0. - Generated files now export
GeneratedMessageGenericExtensions
from the protobuf library. (#503, #907) - Generate doc comments for enum types and values, rpc services and methods. (#900, #909)
deprecated
options in messages, grpc services and methods, and enum types and values are now handled to generate Dart@deprecated
annotations. (#900, #908)protoc_plugin
and generated files now require Dart 3.3.0. (#953)- Fix performance issues when handling documentation comments in protobufs. (#935, #955)
- Fix grpc methods with names 'call' and 'request' conflicting with other methods in the generated code and causing compile-time errors. (#963, #159)
package:protobuf v4.0.0
- Breaking: The following types and members are now removed:
PbEventMixin
PbFieldChange
EventBuffer
GeneratedMessage.createRepeatedField
GeneratedMessage.createMapField
These were used to implement events, which are unused internally. To keep API surface small (to make it easier to change the library or migrate to another library) these types and members are removed. (#738)
- Breaking:
CodedBufferWriter.writeRawBytes
now takes aUint8List
argument (instead ofTypedData
). GeneratedMessageGenericExtensions.deepCopy
is now annotated with@useResult
and will generate a warning when its result is not used. (#896)- Breaking:
PbMap.unmodifiable
now takes key and value field types as arguments, instead of anotherPbMap
.
To migrate, usePbMap.unmodifiable(map.keyFieldType, map.valueFieldType)
instead ofPbMap.unmodifiable(map)
. (#902) - Messages deserialized from JSON now generate the unknown fields when serialized as JSON. Note that, as before, unknown fields in JSON messages are not stored in the
unknownFields
of the message. They are only used by the JSON serializers to support roundtripping. (#49, #918) - Minimum SDK dependency bumped from 2.19.0 to 3.3.0. (#953)
protoc_plugin-21.1.2
protoc_plugin-21.1.1
- Rename a local variable used with message constructors to avoid potential conflicts with protobuf field names. (#869)
protoc_plugin-21.1.0
-
Generate code comments for annotated protobuf inputs. (#161)
-
Generate message constructor arguments by default again. New flag
disable_constructor_args
disables generating the arguments.Constructor arguments were removed in 21.0.0 as they increase dart2js binary sizes even when the arguments are not used.
Example usage to disable constructor arguments:
protoc --dart_out='disable_constructor_args,<other options>:.' ...