Skip to content

Protocol Buffers v26.0-rc1

Pre-release
Pre-release
Compare
Choose a tag to compare
@shaod2 shaod2 released this 25 Jan 18:55
· 2558 commits to main since this release

Announcements

  • This version includes breaking changes to: C++, Java, PHP, Python, Ruby.
    • [C++] Make protobuf comply with the C++ layering check (a7b0421)
    • [C++] Remove const GetArena method on RepeatedPtrField (748ab16)
    • [C++] Disallow incorrect ctype usage (755b690)
    • [C++] Remove deprecated std::string error collector overrides (543fbcd)
    • [C++] Promote ExtensionRange to a proper class (5b12bc8)
    • [C++] Remove deprecated clear APIs on repeated fields (229906f)
    • [C++] Remove C++ legacy syntax descriptor APIs (cf2d696)
    • [C++] Remove deprecated syntax APIs (715b543)
    • [C++] Remove deprecated SupportsUnknownEnumValues method (0a6a516)
    • [Java] Remove unused helper methods for creating new mutable arraylists. (7874474)
    • [Java] Use Editions features in Java full runtimes. (65c65c2)
    • [Java] Stop generating the "newInstance" method. This is not used anymore. (c0d08bd)
    • [Java] Remove unused overload of AbstractMessageLite.addAll that worked on a Collection instead of a List. (3b9bd6d)
    • [Java] Remove obsolete runtime internalBuildGeneratedFileFrom which was for backwards compatibility with old gencode. (9310d2e)
    • [Java] Remove unnecessary overloads of methods: (94a2a44)
    • [Java] Remove unnecessary generated overrides for GeneratedMessage.Builder methods: (7bff169)
    • [Java] The base class for generated messages will be GeneratedMessage, not GeneratedMessageV3.
      (5df0387)
    • [Java] Remove deprecated runtime methods for compatibility with old v2.x.x gencode. (e555bd2)
    • [Java] Remove deprecated TextFormat print methods. These should be replaced by corresponding TextFormat.printer() methods. (dfb8a4c)
    • [Java] Lock down visibility for descriptor syntax APIs. (1aeacd4)
    • [Java] Make deprecated Java gencode PARSER variable private. (b4858b2)
    • [PHP] Validate UTF-8 in string setters, as previously announced. (d14dbbc)
    • [PHP] Remove support for PHP generic services (40ad3fa)
    • [Python] Made text_format output default to UTF-8. (bf00034)
    • [Python] Remove deprecated syntax accessor. (fd40c87)
    • [Python] Remove RegisterExtension in message class (4ebba68)
    • [Python] Reject extend repeated field with none iterable (Raise TypeError) (1658213)
    • [Python] Remove Deprecated APIs that add non top descriptor. (c51f111)
    • [Python] check if Timestamp is valid. (4f77929)
    • [Python] Remove msg.UnknownFields() support in pure python and cpp extension. (0eac77c)
    • [Ruby] Removed syntax and added has_presence?/is_packed?. (dbd4dce)
    • [Ruby] Fixed json_encode/json_decode to use the message's pool. (a8b8ea0)
    • [Ruby] Freeze is now recursive, affecting all sub-messages, maps, and repeated fields. (31313b1)
    • [Ruby] Fixed inconsistencies in Message#to_h, as previously announced. (fd69938)
    • [Ruby] Dropped support for Ruby DSL, as previously announced. (5cfc9e7)
    • [Ruby] Lock down visibility for descriptor syntax APIs. (1aeacd4)
    • [Ruby] Fixed json_encode/json_decode to use the message's pool. (a8b8ea0)
  • Protobuf News may include additional announcements or pre-announcements for upcoming changes.

Compiler

C++

  • Correct type_resolver_util to set syntax=proto3 instead of syntax=proto2 on proto3 files. (040dde7)
  • Remove edition getter from C++ descriptor APIs (93b219f)
  • Breaking change: Remove const GetArena method on RepeatedPtrField (748ab16)
  • Breaking change: Disallow incorrect ctype usage (755b690)
  • Breaking change: Remove deprecated std::string error collector overrides (543fbcd)
  • Breaking change: Promote ExtensionRange to a proper class (5b12bc8)
  • Breaking change: Remove deprecated clear APIs on repeated fields (229906f)
  • Breaking change: Remove C++ legacy syntax descriptor APIs (cf2d696)
  • Fixed UTF-8 TextFormat output to protect against invalid UTF-8 in string fields. (1ac8c04)
  • Breaking change: Remove deprecated syntax APIs (715b543)
  • Fix DurationToMilliseconds mult overflow (17b8dd6)
  • Breaking change: Remove deprecated SupportsUnknownEnumValues method (0a6a516)
  • Have Arena::Create support arena constructible types (578e07e)
  • Enforce stricter version checks for Protobuf C++ by removing the notion of "minimal version of protoc/headers"; exact version match is required. (6eed7a2)
  • Compare explicit zeroes from prototext in partially. (8c24163)
  • Move the declarations in SerialArena to more closely match the style guide. (349122f)

Java

  • Drop Protobuf support for Android KitKat per EOL and add existing minimum Java 1.8 in Maven pom.xmls (303239d)
  • Breaking change: Remove unused helper methods for creating new mutable arraylists. (7874474)
  • Breaking change: Use Editions features in Java full runtimes. (65c65c2)
  • Breaking change: Stop generating the "newInstance" method. This is not used anymore. (c0d08bd)
  • Breaking change: Remove unused overload of AbstractMessageLite.addAll that worked on a Collection instead of a List. (3b9bd6d)
  • Breaking change: Remove obsolete runtime internalBuildGeneratedFileFrom which was for backwards compatibility with old gencode. (9310d2e)
  • Breaking change: Remove unnecessary overloads of methods: (94a2a44)
  • Breaking change: Remove unnecessary generated overrides for GeneratedMessage.Builder methods: (7bff169)
  • Breaking change: The base class for generated messages will be GeneratedMessage, not GeneratedMessageV3.
    (5df0387)
  • Breaking change: Remove deprecated runtime methods for compatibility with old v2.x.x gencode. (e555bd2)
  • Breaking change: Remove deprecated TextFormat print methods. These should be replaced by corresponding TextFormat.printer() methods. (dfb8a4c)
  • Support pretty printing proto2 Extensions inside of proto3 Anys in TextFormat.Printer. (c8e0160)
  • Breaking change: Lock down visibility for descriptor syntax APIs. (1aeacd4)
  • Enable Protobuf version validations in Protobuf Java Full. (a2f9268)
  • Breaking change: Make deprecated Java gencode PARSER variable private. (b4858b2)
  • Add Automatic-Module-Name (#14562) (d580fde)
  • Use Editions features in Java, Kotlin, and Java Lite code generators. (90e1b49)

Kotlin

  • Breaking change: Use Editions features in Java full runtimes. (65c65c2)
  • Breaking change: The base class for generated messages will be GeneratedMessage, not GeneratedMessageV3.
    (5df0387)
  • Use Editions features in Java, Kotlin, and Java Lite code generators. (90e1b49)

Objective-C

  • Improve handing of the WKT ObjC Category additions. (b146d14)
  • Add a unpack helper for GPBAny with extension support. (29fca8a)

Python

  • Fixed a bug when deep copying a map field with a closed enum value. (ca5ca62)
  • Breaking change: Made text_format output default to UTF-8. (bf00034)
  • Fixed a SEGV when deep copying a non-reified sub-message. (b9e4894)
  • Make str(msg) in Python print raw UTF-8 strings. Only invalid UTF-8 is escaped. (f2a91b3)
  • Breaking Change: Remove RegisterExtension in message class (4ebba68)
  • Breaking Change: Reject extend repeated field with none iterable (Raise TypeError) (1658213)
  • Breaking Change: Remove Deprecated APIs that add non top descriptor. (c51f111)
  • Breaking Change: Check if Timestamp is valid. (4f77929)
  • [Python/upb] Fixed SEGV when attempting to delete a message attribute (de52944)
  • Breaking Change: Remove msg.UnknownFields() support in pure python and cpp extension. (0eac77c)
  • Breaking change: Remove deprecated syntax accessor. (fd40c87)
  • Fixed a bug where FileDescriptor maps like message_types_by_name could return descriptors from other files. (c05b320)
  • Mark the python generator for editions support. (b01bd1b)
  • Add support and partial CI coverage for Python 3.12 (24fef03)
  • Implement Editions in Pure Python. (15eccf3)
  • Properly untrack Python GC objects during deallocation. (e32d094)
  • Raise warnings for python syntax usages (c508a40)
  • Fixed Python memory leak in map lookup. (b0eeb35)
  • Fix handling of Unicode escapes in string data in textproto files. (62a435c)

PHP

PHP C-Extension

  • Breaking change: Validate UTF-8 in string setters, as previously announced. (d14dbbc)
  • Optimized binary/JSON parsing to no longer copy input data into a temp buffer. (588d5aa)
  • See also UPB changes below, which may affect PHP C-Extension.

Ruby

  • Breaking change: Removed syntax and added has_presence?/is_packed?. (dbd4dce)
  • Breaking change: Fixed json_encode/json_decode to use the message's pool. (a8b8ea0)
  • Breaking change: Freeze is now recursive, affecting all sub-messages, maps, and repeated fields. (31313b1)
  • Breaking change: Fixed inconsistencies in Message#to_h, as previously announced. (fd69938)
  • Breaking change: Dropped support for Ruby DSL, as previously announced. (5cfc9e7)
  • In Ruby repeated fields, each_index actually iterates over the index (#11767) (f869cfa)
  • Breaking change: Lock down visibility for descriptor syntax APIs. (1aeacd4)
  • Make rules_ruby a dev-only dependency. (571b727)
  • Add support for extensions in CRuby, JRuby, and FFI Ruby (#14703) (42f8b77)
  • Add support for options in CRuby, JRuby and FFI (#14594) (ae1f2b7)

Ruby C-Extension

  • Breaking change: Removed syntax and added has_presence?/is_packed?. (dbd4dce)
  • Breaking change: Fixed json_encode/json_decode to use the message's pool. (a8b8ea0)
  • Breaking change: Freeze is now recursive, affecting all sub-messages, maps, and repeated fields. (31313b1)
  • Breaking change: Fixed inconsistencies in Message#to_h, as previously announced. (fd69938)
  • Upb: fix Ruby bug which allowed map.delete(key) on a frozen map (df57e54)
  • Add support for extensions in CRuby, JRuby, and FFI Ruby (#14703) (42f8b77)
  • Add support for options in CRuby, JRuby and FFI (#14594) (ae1f2b7)
  • See also UPB changes below, which may affect Ruby C-Extension.

UPB (Python/PHP/Ruby C-Extension)

  • Wrap C++ headers in #ifdef __cplusplus. (fc2d9da)
  • Add kUpb_DecodeOption_AlwaysValidateUtf8 decode option, to force UTF-8 validation of proto2 strings. (d4dfb9c)
  • Fixed non-conformance in upb JSON enum decoding when ignoring unknown enum values. (c16ac66)
  • Fix upb's json decoder ignoring trailing characters after a successfully parsed object. (fa15c21)
  • Fix upb_MiniTable_GetOneof(miniTable, field) to work correctly if field is the very first field in the proto. (e6ea44c)
  • Enabled editions support for upb generated code. (cf3a6f5)
  • Upb: stop generating hazzers for repeated fields (fa62c92)

Other

  • Extend Proto2 JSON test cases to cover more of the preexisting Proto3 JSON cases. (42ecd61)
  • Include JSON output tests with Proto2 messages in the conformance test suite. (255f95e)
  • Make the utf8_range implementation just in C (9c7d2b9)
  • Open-source editions Bazel rules for embedding defaults. (898d8fa)
  • Enable conformance tests over editions protos (a2ba8bc)
  • Move utf8_range into the protobuf repo (5ca8400)