New GeneratedMessage extension methods toTextFormat and writeTextFormat added to convert the message into the official protocol buffers text format. (#1080, #125)
Add well-known proto types as libraries. This change is required for protoc_plugin-25.0.0. (#1081)
Breaking: Hide PbList and PbMap constructors. It is not possible to construct these values correctly in user code, so the constructors are now private. Existing uses of PbList can be replaced by List and PbMap can be replaced by Map.
For immutable lists and maps, you can use built_value. (#1072)
Map fields now check key and value validity when adding elements. (#1065, #1076)
Update default size limit of CodedBufferReader from 67,108,864 bytes to 2,147,483,647 bytes, and default recursion limit from 64 to 100.
The new limits are consistent with the Java and C++ implementations. (#1060)
Fix GeneratedMessage.addExtension returning non-frozen and GeneratedMessage.getExtension allowing modifying an extension when the message is frozen before initializing the extension field set. (#1062)
Fix GeneratedMessage.getExtension returning differently typed lists when the message extension field set is initialized and frozen and initialized but not frozen. (#1062)
Fix PbList methods addAll, insertAll, replaceRange, setAll, setRange iterating the Iterable argument twice. (#730, #1070)
Fix GeneratedMessage.== throwing a type error when comparing map fields in some cases. (#1075, #1077)
This bug was introduced with protobuf-5.0.0.
GeneratedMessage.deepCopy. (#742)GeneratedMessage.mergeFromProto3Json when the ignoreUnknownFields optional argument is true. (#853)BuilderInfo methods to support protoc-plugin 23.0.0. (#1047)PbList.from from List<T> to Iterable<T>. (#1054)GeneratedMessage.clear. (#1057)GeneratedMessage methods mergeFromJson, mergeFromJsonMap, writeToJson, writeToJsonMap. (#1058)Internal refactoring to split the package into libraries. This allows conditionally importing different libraries and improving performance by using different encoding/decoding libraries based on the target platform. (#1026)
Some of the private PbFieldType members are made public, to allow using them in internal libraries. This type is for internal use only. (#1027)
Improve performance of GeneratedMessage members: writeToJsonMap, writeToJson, mergeFromJson, mergeFromJsonMap. (#1028)
Remove BuilderInfo.fromProto3Json and BuilderInfo.toProto3Json as a part of an internal refactoring.
Breaking: The following types and members are now removed:
PbEventMixinPbFieldChangeEventBufferGeneratedMessage.createRepeatedFieldGeneratedMessage.createMapFieldThese 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 a Uint8List argument (instead of TypedData).
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 another PbMap.
To migrate, use PbMap.unmodifiable(map.keyFieldType, map.valueFieldType) instead of PbMap.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.
Minimum SDK dependency bumped from 2.19.0 to 3.3.0. (#953)
CodedBufferReader readBytes now copies the returned bytes to avoid accidental sharing of the input buffer with the returned Uint8List. New member readBytesAsView added with the old behavior. (#863)
Avoid sharing the input buffer in unknown length-delimited fields using the new readBytes. (#863)
2.19.ReadonlyMessageMixin (#183, #644)frozenMessageModificationHandler (#175, #643)PbListBase and FrozenPbList types. All proto repeated fields now use PbList. To check if a list is frozen, use isFrozen getter. (#624, #626)GeneratedMessage.getField. This behavior is consistent with getField called on repeated fields. (#373, #707)PbMap constructor argument BuilderInfo? info. (d94d3f0)UnknownFieldSetField methods hasRequiredFields, isInitialized and getter length removed. (#721)PbMap._isReadonly field initialization in PbMap.unmodifiable. (#741, #754)mergeFromBuffer, mergeFromProto3Json, ...). (#489, #727)null values in proto3 JSON deserializer. (#751, #760, #763)reparseMessage. (#840)protobuf and protoc_plugin:Timestamp to Dart DateTime (#580, #577)BuilderInfo and FieldInfo properties (#597)BuilderInfo initialization by doing some of the work lazily (#606)Any messages from JSON (#568)repeated bytes and optional bytes fields. (#640)GeneratedMessage.rebuild now generates a warning when the return value is not used. (#631)protobuf.omit_field_names, enum value tags with protobuf.omit_enum_names in debug strings (toString methods) (#649)TimestampMixin.toDateTime now takes an optional named bool argument toLocal (defaults to false) for generating a DateTime in the local time zone (instead of UTC). (#653)infinity and nan doubles in JSON serializers (#652)1.1.2 - 1.1.4 into v2.dart format instead of dartfmt.oneof fields from proto3 json. The ‘whichFoo’ state would not be set.copyWith.GeneratedMessage.rebuild and GeneratedMessage.deepCopy replacing copyWith and clone. Using these alternatives can result in smaller binaries, because it is defined once instead of once per class. Use protoc_plugin from 19.1.0 to generate deprecation warnings for copyWith and clone methods.GeneratedMessage.getExtension throws when reading trying to read an extension that is present in the unknown fields. We consider this change a bug-fix because depending on the old behavior is indicative of a bug in your program.timeout to ClientContextpermissiveEnums option to mergeFromProto3Json. The comparison did not work properly.ExtensionRegistry.reparseMessage not handling map fields with scalar value types correctly.protoName) not being set correctly.permissiveEnums option to mergeFromProto3Json. It will do a case-insensitive matching of enum values ignoring - and _.protoc_plugin 19.0.0.String, int, and bool with usual default values.getDefault().TagNumber. This is used by code generated by protoc_plugin from version 19.0.0.mapEntryBuilderInfo in MapFieldInfo.Support for import public.
The generated code for a protofile a.proto that import public "b.proto" will export the generated code for b.proto.
See https://developers.google.com/protocol-buffers/docs/proto#importing-definitions.
Support for proto3 json (json with field names as keys)
GeneratedMessage.toProto3Json() to encode and GeneratedMessage.mergeFromProto3Json(json) to decode.FieldInfo objects have a new getter .protoName that gives the non-camel-case name of the field as in the .proto-file.
Breaking: The field-adder methods on BuilderInfo now takes only named optional arguments. To migrate, update protoc_plugin to version 18.0.0 or higher.
The field-adder methods on BuilderInfo all take a new argument protoName.
Breaking: Changed ExtensionRegistry.reparseMessage to reparse extensions deeply, that is it looks at every nested message and tries to reparse extensions from its unknown fields.
0.13.16 which accidentally introduced a breaking change, #284. This release is identical to 0.13.15.BuilderInfo.add with a tag number of 0. These would trigger assertions before.GeneratedMessage.isFrozen to query if the message has been frozen.AddedExtensionRegistry.reparseMessage()` for decoding extensions from unknown fields after the initial decoding.BuilderInfo.add now ignores fields with tag number 0. These would never be generated by the protoc_plugin so this is not considered a breaking change._FieldSet.oneofCases if the message contains oneofs.operator == and hashCode in PbMap so that two PbMaps are equal if they have equal key/value pairs.addAll on ExtensionRegistry for more conveniently adding multiple extensions at once.Add new method pc on BuilderInfo for adding repeated composite fields and remove redundant type check on items added to a PbList.
Deprecated BuilderInfo.pp and PbList.forFieldType.
Fix issue with parsing map field entries. The values for two different keys would sometimes be merged.
Deprecated PBMap.add.
Reading an unknown field set after freeze() now returns the existing field set before freezing instead of an empty UnknownFieldSet.
Reading an extension field after freeze() now returns the value set before freezing instead of the default value.
Breaking change: Changed BuilderInfo.m() to take class and package name of the protobuf message representing the map entry. Also changed BuilderInfo.addMapField as well as the constructors PbMap and MapFieldInfo.map to take a map entry BuilderInfo object.
This mostly affects generated code, which should now be built with protoc_plugin 15.0.0 or newer.
With this change we avoid creating a map entry BuilderInfo object for each PbMap instance, instead it is passed through the static BuilderInfo object in the generated subclasses of GeneratedMessage.
Breaking change: changed semantics of GeneratedMessage.toBuilder() to only make a shallow copy.
GeneratedMessage has a new abstract method: createEmptyInstance() that subclasses must implement.
Proto files must be rebuilt using protoc_plugin 14.0.0 or newer.
BuilderInfo.qualifiedMessageName.ProtobufEnum.initByValue which allows the return value to be fully typed.GeneratedMessage.freeze(). A frozen message and its sub-messages cannot be changed.CodedBufferWriter.writeTo to require Uint8List for performance.Map in PbMapMixinpkg/crypto for real.Require at least Dart SDK 1.13.
Removed dependency on pkg/crypto.
fixnum.setRange(): Do not assume Iterable has a sublist() method.Allow constants as field initial values as well as creation thunks to reduce generated code size.
Improve the performance of reading a protobuf buffer.
Fixed truncation error in least significant bits with large Int64 constants.