Skip to content

Protocol Buffers v28.0-rc1

Pre-release
Pre-release
Compare
Choose a tag to compare
@zhangskz zhangskz released this 11 Jul 23:47
· 1501 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++

  • 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

  • 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

  • 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] Add Swift helpers for GPBUnknownFields/GPBUnknownField. (6750ed8)
  • [ObjC] Introduce the new GPBUnknownFields type. (47f633e)
  • Rename DynamicCastToGenerated/DownCastToGenerated to (18da465)

Rust

  • 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)

Python

  • 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

  • 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

  • [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)

  • 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

  • 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)