Skip to content

Protocol Buffers v28.0

Compare
Choose a tag to compare
@JasonLunn JasonLunn released this 28 Aug 19:53
· 595 commits to main since this release

Announcements

  • Protobuf News may include additional announcements or pre-announcements for upcoming changes.

Compiler

  • UPB text encoder without using reflection for Rust (used for a message's Debug trait) that will print out field number to value entries instead of field name to value entries of a message like how it's expected for the usual text format using reflection. (f9dd9ce)
  • Enable MessageLite::DebugString to use Message::DebugString where possible. (f810cc5)
  • Always report plugin support errors from protoc. (986ef8d)
  • Stop supporting EDITION_PROTO2 as an alias for EDITION_LEGACY. (35b3425)
  • Rename DynamicCastToGenerated/DownCastToGenerated to (18da465)
  • Mark deleted fields in descriptor.proto reserved (44c409d)
  • Protoc: support inf, -inf, nan, and -nan in option values (#15017) (3c03e93)

C++

  • Move -Werror to our test/dev bazelrc files. (#17938) (f5a1b17)
  • Introduce FieldDescriptor::cpp_string_type() API to replace direct ctype inspection which will be removed in the next breaking change (72b0b7a)
  • Removed specific MSVC settings when installing (#17285) (770090e)
  • Omit the _raw_default_instance_ declaration when using DLL linkage. (79c55cb)
  • Enable MessageLite::DebugString to use Message::DebugString where possible. (f810cc5)
  • Fix a bug in which proto code uses ctype instead of string_type internally. (dfbe987)
  • Add an optimization that prevents an exponential number of comparisons on deeply (594a71f)
  • Replace FindHelper() with BucketNumber() when only the bucket number is required. (8c7b1ec)
  • Stop supporting EDITION_PROTO2 as an alias for EDITION_LEGACY. (35b3425)
  • Rename DynamicCastToGenerated/DownCastToGenerated to (18da465)
  • Prohibit using features in the same file they're defined in. (24b91a7)
  • Implement new Debug API with redaction. (bb68eb2)
  • Use bool HasHasbits(const FieldDescriptor*) instead of manual checks. (448e326)
  • Add java to reserved names to escape extensions to java_. This may break existing references to gencode for extensions named java. (c99cf4b)
  • Put arena cleanup nodes on a separate chunked list instead of at the ends of arena blocks. (f70d90b)
  • Fix validation checks of implicit presence. (d6c2833)
  • Clarify map behaviors in editions. (0dbd99a)
  • Protoc: support inf, -inf, nan, and -nan in option values (#15017) (3c03e93)

Java

  • Binary compatibility shims for GeneratedMessageV3, SingleFieldBuilderV3, RepeatedFieldBuilderV3, and their nested classes to restore binary compatibility with <=v3.x.x generated code built against v3.x.x prior to v4.26.0 breaking release. (6bf01c5)
  • Remove unused pom.xml files. (aaf5f79)
  • Add overload for LazyStringArrayList.add(String): boolean (761d49a)
  • Hoist SmallSortedMap.getNumArrayEntries() outside loops over array entries (229c958)
  • Omit the _raw_default_instance_ declaration when using DLL linkage. (79c55cb)
  • Java: Deprecate newExtensionWriter. (7122ba1)
  • Immutable java: Use new lower-allocation extension serialization APIs from gencode (4151486)
  • Reserialize all unresolved features using java features from the generated pool in case of descriptors from the custom pool. (415a147)
  • Fix delimited inheritance in all languages. (8beb970)
  • Full java runtime: Avoid allocating ArrayList iterators when serializing UnknownFieldSet (fac847c)
  • Move back deprecation of java utf8 feature to 2024. (bd7078d)
  • Reparse unknown features using extension registry containing Java features. (68d9087)
  • Remove field SmallSortedMap.maxArraySize (16e0a63)
  • Delete unused method SmallSortedSet.getOverflowEntriesDescending (c05be32)
  • Avoid allocating FieldSet iterator if FieldSet is empty (3ba7280)
  • Lazily resolve features for proto2 and proto3 for compatibility with old open source gencode that does not invoke feature resolution from gencode static init. (11c27df)
  • Implement new Debug API with redaction. (bb68eb2)
  • Replace SmallSortedMap.EmptySet with equivalent Collections.emptySet() (c6e2778)
  • Add java to reserved names to escape extensions to java_. This may break existing references to gencode for extensions named java. (c99cf4b)
  • Avoid allocating TreeMap in UnknownFieldSet.Builder.asMap (4b7c2d4)
  • Avoid allocating iterator in TextFormat printing UnknownFieldSet (8c6e5b7)
  • Add null to the list of reserved words. (510c143)
  • Add UnknownFieldSet.isEmpty (c56bddd)
  • Java full runtime: Avoid allocating when calling asMap on empty UnknownFieldSet (d0b016f)
  • Return the default instance when parsing from an empty byte[]. (f597991)
  • Deprecate building from source with Maven to be removed in 4.28.x. (4c8da99)
  • Java full runtime: Avoid allocating iterator if UnknownFieldSet's TreeMap is empty (4f12891)
  • Proto java full runtime: avoid allocating Integers accessing enum lists (cc79f77)
  • Split bootstrapped java_features.proto to keep it from leaking out. (2257232)
  • Java Proto lite: avoid boxing Integers accessing enum lists (fb054c8)
  • In the Kotlin DSL, reference builder methods with property syntax. (e9c9970)
  • Java Proto Lite: Serialize repeated enums without allocating (de6aba9)
  • Avoid boxing when serializing primitive lists in CodedOutputStreamWriter (eaee04d)

Kotlin

  • Remove unused pom.xml files. (aaf5f79)
  • In the Kotlin DSL, reference builder methods with property syntax. (e9c9970)

Csharp

  • Fix delimited inheritance in all languages. (8beb970)
  • Handle groups in C# JsonParser (#16970) (092cc15)
  • Introduce MessageDescriptor.IsMapType in C# reflection to make it easier to tell whether a given message was generated by protoc for a map field. (047fc76)
  • C#: Fix discovery of oneof declarations in descriptor protos. (b50ff60)

Objective-C

  • [ObjC] Issue stderr warnings for deprecated generation options. (b276420)
  • [ObjC] Add api to add a field to another collection of unknown fields. (0790ab4)
  • [ObjC] Fix GPBUnknownField/GPBUnknownFields copy. (b3b9888)
  • [ObjC] Raise an exception for a nil message. (35bd2be)
  • [ObjC] Deprecate GPBUnknownFieldSet and related apis. (9f6ee72)
  • [ObjC] More tests around unknown to known failure cases. (e822dce)
  • [ObjC] Support errors when merging unknown fields to a message. (c46340e)
  • [ObjC] Add apis for removing things from GPBUnknownFields. (c5c9c89)
  • [ObjC] Collect unknown fields as data (a6b3535)
  • [ObjC] Internal helper for getting the unknown field data from a message (bf2d4e7)
  • [ObjC] Update tests to use both unknown fields apis. (0832b52)
  • [ObjC] Deprecate GPBTextFormatForUnknownFieldSet(). (d1b6f8c)
  • [ObjC] Parsing helper and tests around unknown fields. (9b16ee4)
  • [ObjC] Add test around enum unknown values. (fad7b78)
  • [ObjC] Expose a helper for stream error. (cf7abf6)
  • [ObjC] Support MessageSet with GPBUnknownFields. (ddf9b76)
  • [ObjC] Update MessageSet Parsing. (5fa8cd9)
  • [ObjC] Validate MessageSet expectations. (3aa491c)
  • [ObjC] Improve parsing validations (ef4898f)
  • [ObjC] Add Swift helpers for GPBUnknownFields/GPBUnknownField. (6750ed8)
  • [ObjC] Introduce the new GPBUnknownFields type. (47f633e)
  • Rename DynamicCastToGenerated/DownCastToGenerated to (18da465)

Rust

  • Move -Werror to our test/dev bazelrc files. (#17938) (f5a1b17)
  • Add visibility for rust public aliases for '@protobuf//:protobuf_rust' (2cee142)
  • UPB text encoder without using reflection for Rust (used for a message's Debug trait) that will print out field number to value entries instead of field name to value entries of a message like how it's expected for the usual text format using reflection. (f9dd9ce)
  • Enable MessageLite::DebugString to use Message::DebugString where possible. (f810cc5)
  • See also UPB changes below, which may affect Rust.

Python

  • Raise warnings for deprecated python cpp extension GetDebugString(). (5fc5558)
  • Remove service.py usages in builder (902a68a)
  • Raise warnings for deprecated google/protobuf/reflection.py APIs. (38140ac)
  • Nextgen Proto Pythonic API: Struct/ListValue assignment and creation (e17821c)
  • Fix delimited inheritance in all languages. (8beb970)
  • Make bytearray work (again) (#16691) (eb67a91)
  • Nextgen Proto Pythonic API: Timestamp/Duration assignment, creation and calculation (b690e72)
  • Update rules_python to 0.28.0 (e1bf1f0)
  • Nextgen Proto Pythonic API: “Add-on” proto for length prefixed serialize/parse (3a9f074)
  • Rename DynamicCastToGenerated/DownCastToGenerated to (18da465)
  • Fixed printing of nan floats/doubles in Python. (f651080)
  • Nextgen Proto Pythonic API: “Add-on” proto for JSON serialize/parse (6c91de9)
  • Nextgen Proto Pythonic API: “Add-on” proto for serialize/parse (495ba7b)
  • Use struct instead of ctype. allows the protobuf python library to work on cpython 3.11's new wasm target [1] (9de810a)
  • Nextgen Proto Pythonic API: Add 'in' operator (24f27c3)
  • Automated rollback of commit f799af8. (c4bf83b)
  • Catch all the exceptions in python JSON ParseDict and raise (9cc5be1)

PHP

PHP C-Extension

  • Fix segmentation faults with enabled keep_descriptor_pool_after_request (#16993) (e844510)
  • See also UPB changes below, which may affect PHP C-Extension.

Ruby

  • [Ruby] Warn if assigning a "UTF-8" string with invalid UTF-8. (#17253) (fe9a53c)
  • Remove Arena_pin in favor of adopting the UPB freezing API. (1194440)
  • Fix Ruby FFI to pass MiniTable to upb_Message_New() aka new_message_from_def(). (47f4bc9)

Ruby C-Extension

  • Move -Werror to our test/dev bazelrc files. (#17938) (f5a1b17)
  • [Ruby] Warn if assigning a "UTF-8" string with invalid UTF-8. (#17253) (fe9a53c)
  • [Ruby] Fix mismatched pointer type (#17240) (0aa7449)
  • Remove Arena_pin in favor of adopting the UPB freezing API. (1194440)
  • See also UPB changes below, which may affect Ruby C-Extension.

UPB (Python/PHP/Ruby C-Extension)

  • Move -Werror to our test/dev bazelrc files. (#17938) (f5a1b17)
  • UPB text encoder without using reflection for Rust (used for a message's Debug trait) that will print out field number to value entries instead of field name to value entries of a message like how it's expected for the usual text format using reflection. (f9dd9ce)
  • Fix delimited inheritance in all languages. (8beb970)
  • Fixed printing of nan floats/doubles in Python. (f651080)

Other

  • Remove --copt="-Werror" from .bazelrc (#18005) (c9454f4)
  • Remove protobuf rust from BCR presubmits for now. (92552d3)
  • Set -ex in test_java.yml (6a7e215)
  • Refactor java maven GHA test to use our generated jars. (671ef8b)
  • Remove /utf-8 flag added in #14197 (440dc83)
  • Downgrade CMake to 3.29 to workaround Abseil issue. (cd75dd5)
  • Add minimal Python support to MODULE.bazel (2eb4d69)
  • Fix(bazel/python): incompatible_enable_proto_toolchain_resolution (#17078) (8434c12)
  • Add Rust support to MODULE.bazel (f3c140f)
  • Add rules_fuzzing dependency to MODULE.bazel. (a450c9c)
  • Reenable FFI tests on CRuby. (e595749)
  • Update comment for message_type (023e69d)
  • Enable textproto conformance tests for "-0" and "-0F". (13caa08)
  • Fix #10007: Propagate msvc-style link flags to clang-cl with Bazel (55592a2)
  • Add system_python to protobuf_deps.bzl. (8a11178)