Protocol Buffers 34.0 已经发布。Protocol Buffers(protobuf)是 Google 开源的语言无关、平台无关的可扩展机制,用于序列化结构化数据。
Announcements
- 此版本包含可能导致兼容性中断的破坏性变更,涉及以下语言:Objective-C、Python、PHP、C++、Bazel
- [Objective-C] 移除
-[GPBFieldDescriptor optional]( 3414dc1 )
- [Objective-C] 修复某些
GPB*Dictionary类型的空值注解。( ea67d6d )
- [Objective-C] 移除
generate_minimal_imports生成选项警告 ( 45b1297 )
- [Python] 在 Python Proto 中将 bool 赋给 int/enum 字段时,OSS 会引发错误。( 5b116fe )
- [Python] 移除已弃用的 UseDeprecatedLegacyJsonFieldConflicts() ( c301c2c )
- [Python] 移除已弃用的 FieldDescriptor.label ( 0a8ff55 )
- [Python] 从 python proto text_format 中移除 float_format/double_format ( e4854a1 )
- [Python] 移除OSS 中已弃用的 FieldDescriptor::label()。改用 is_repeated() 或 is_required() ( b76faa9 )
- [Python] 在 python proto 中,将非 timedelta 类型转换为 Duration 类型,或将非 datetime 类型转换为 Timestamp 类型时,会引发 TypeError 异常。(原始代码可能会引发 ArributeError 异常)( 00aaca1 )
- [Python] 从 python proto json_format 中移除 float_precision ( f027f1f )
- [PHP] 移除已弃用的 PHP API FieldDescriptor getLabel,改用 IsRepeated 或 isRequired。(4208121)
- [PHP] 移除已弃用的 PHP API ( 9c45014 )
- [PHP] 为 setter 添加 PHP 类型提示并移除冗余的 GPBUtil 检查 ( aee03b7 )
- [PHP] 支持 editions/proto2 的默认值 ( b01099d )
- [C++] 移除已弃用的 UseDeprecatedLegacyJsonFieldConflicts() ( c301c2c )
- [C++] 添加调试检查,确保 CopyFrom 的目标不是源的子类。( 7a75898 )
- [C++] 为多个 API 添加 [[nodiscard]]。(a70115f)
- [C++] 将生 generator headers 设为私有(3a2af35)
- [C++] 移除 OSS 中已弃用的 FieldDescriptor::has_optional_keyword()。改用 is_repeated() 或 has_presence() ( 68346ec )
- [C++] 移除 OSS 中已弃用的 FieldDescriptor::label()。改用 is_repeated() 或 is_required() ( b76faa9 )
- [C++] 移除 OSS 中已弃用的 FieldDescriptor::is_optional()。改用 (!is_required() && !is_repeated()) ( 9dbc5d4 )
- [C++] 移除 AddUnusedImportTrackFile() 和 ClearUnusedImportTrackFiles()。移除 PROTOBUF_FUTURE_RENAME_ADD_UNUSED_IMPORT ( 837a2cd )
- [C++] 移除接受原始指针作为参数的 proto2::util::MessageDifferencer::AddIgnoreCriteria,改用接受 unique_ptr 的重载方法。移除宏 PROTOBUF_FUTURE_REMOVE_ADD_IGNORE_CRITERIA ( b115358 )
- [C++] 将
RepeatedField、RepeatedPtrField和Map的 arena-enabled constructors 设为私有。( ef890c3 )
- [C++] 所有 entity names 均设长度限制 ( 2afb0dc )
- [Other] 移除已弃用的启用 MSVC 支持的标志 ( 97c979b )
- [Bazel] 移除已弃用的 ProtoInfo.transitive_imports。改用等效的 transitive_sources ( 0a5c2f6 )
- [Bazel] 将 @protobuf//bazel/flags:prefer_prebuilt_proto 标志更改为 True。( 84a30b5 )
- [Bazel] 仅遵循 Starlark 版本的 --proto_toolchain_for*( b5685c4 )
- Protobuf News 可能包括即将发生的变化的额外公告或预告。
更多详情可查看:https://github.com/protocolbuffers/protobuf/releases/tag/v34.0