12019-06-28 version 3.9.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) 2 3 C++ 4 * Optimize and simplify implementation of RepeatedPtrFieldBase 5 * Don't create unnecessary unknown field sets. 6 * Remove branch from accessors to repeated field element array. 7 * Added delimited parse and serialize util. 8 * Reduce size by not emitting constants for fieldnumbers 9 * Fix a bug when comparing finite and infinite field values with explicit tolerances. 10 * TextFormat::Parser should use a custom Finder to look up extensions by number if one is provided. 11 * Add MessageLite::Utf8DebugString() to make MessageLite more compatible with Message. 12 * Fail fast for better performance in DescriptorPool::FindExtensionByNumber() if descriptor has no defined extensions. 13 * Adding the file name to help debug colliding extensions 14 * Added FieldDescriptor::PrintableNameForExtension() and DescriptorPool::FindExtensionByPrintableName(). 15 The latter will replace Reflection::FindKnownExtensionByName(). 16 * Replace NULL with nullptr 17 * Created a new Add method in repeated field that allows adding a range of elements all at once. 18 * Enabled enum name-to-value mapping functions for C++ lite 19 * Avoid dynamic initialization in descriptor.proto generated code 20 * Move stream functions to MessageLite from Message. 21 * Move all zero_copy_stream functionality to io_lite. 22 * Do not create array of matched fields for simple repeated fields 23 * Enabling silent mode by default to reduce make compilation noise. (#6237) 24 25 Java 26 * Expose TextFormat.Printer and make it configurable. Deprecate the static methods. 27 * Library for constructing google.protobuf.Struct and google.protobuf.Value 28 * Make OneofDescriptor extend GenericDescriptor. 29 * Expose streamingness of service methods from MethodDescriptor. 30 * Fix a bug where TextFormat fails to parse Any filed with > 1 embedded message sub-fields. 31 * Establish consistent JsonFormat behavior for nulls in oneofs, regardless of order. 32 * Update GSON version to 3.8.5. (#6268) 33 * Add `protobuf_java_lite` Bazel target. (#6177) 34 35 Python 36 * Change implementation of Name() for enums that allow aliases in proto2 in Python 37 to be in line with claims in C++ implementation (to return first value). 38 * Explicitly say what field cannot be set when the new value fails a type check. 39 * Duplicate register in descriptor pool will raise errors 40 * Add __slots__ to all well_known_types classes, custom attributes are not allowed anymore. 41 * text_format only present 8 valid digits for float fields by default 42 43 JavaScript 44 * Add Oneof enum to the list of goog.provide 45 46 PHP 47 * Make php message class final to avoid mocking. (#6277) 48 * Rename get/setXXXValue to get/setXXXWrapper. (#6295) 49 50 Ruby 51 * Remove to_hash methods. (#6166) 52 53 542019-04-29 version 3.8.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) 55 56 C++ 57 * Use std::atomic<int32> in case of myriad2 platform 58 * Always declare enums to be int-sized 59 * Added DebugString() and ShortDebugString() methods on MessageLite 60 * Specialized different parse loop control flows 61 * Make hasbits potentially in register. The or's start forming an obstacle because it's a read modify store on the same mem address on each iteration. 62 * Move to an internal MACRO for parser validity checks. 63 * Improve map parsing performance. 64 * Make MergePartialFromCodedStream non virtual. This allows direct calls, potential inlining and is also a code health improvement 65 * Add an overall limit to parse_context to prevent reading past it. This allows to remove a annoying level of indirection. 66 * Fix a mistake, we shouldn't verify map key/value strings for utf8 in opt mode for proto2. 67 * Further improvements to cut binary size. 68 * Prepare to make MergePartialFromCodedStream non-virtual. 69 * A report on some interesting behavior change in python (caused by b/27494216) made me realize there is a check that needs to be done in case the parse ended on a end group tag. 70 * Add a note of caution to the comments around skip in CodedOutputStream. 71 * Simplify end check. 72 * Add overload for ParseMessage for MessageLite/Message types. If the explicit type is not known inlining won't help de-virtualizing the virtual call. 73 * Reduce linker input. It turns out that ParseMessage is not inlined, producing template instantiations that are used only once and save nothing but cost more. 74 * Improve the parser. 75 * [c++17] Changed proto2::RepeatedPtrField iterators to no longer derive from the deprecated std::iterator class. 76 * Change the default value of case_insensitive_enum_parsing to false for JsonStringToMessage. 77 * Add a warning if a field name doesn't match the style guide. 78 * Fix TextFormat not round-trip correctly when float value is max float. 79 * Added locationed info for some errors at compiler 80 * Python reserved keywords are now working with getattr()/setattr() for most descriptors. 81 * Added AllowUnknownField() in text_format 82 * Append '_' to C++ reserved keywords for message, enum, extension 83 * Fix MSVC warning C4244 in protobuf's parse_context.h. 84 * Updating Iterators to be compatible with C++17 in MSVC. 85 * Use capability annotation in mutex.h 86 * Fix "UndefinedBehaviorSanitizer: cfi-bad-type" 87 * CriticalSectionLock class as a lightweight replacement for std::mutex on Windows platforms. 88 * Removed vestigial wire_format_lite_inl.h 89 90 C# 91 * Added System.Memory dependency. 92 93 Java 94 * Make Java protoc code generator ignore optimize_for LITE_RUNTIME. Users should instead use the Java lite protoc plugin. 95 * Change Extension getMessageDefaultInstance() to return Message instead of MessageLite. 96 * Prevent malicious input streams from leaking buffers for ByteString or ByteBuffer parsing. 97 * Release new Javalite runtime. 98 * Show warning in case potential file name conflict. 99 * Allow Java reserved keywords to be used in extensions. 100 * Added setAllowUnknownFields() in text format 101 * Add memoization to ExtensionRegistryLite.getEmptyRegistry() 102 * Improve performance of CodedOutputStream.writeUInt32NoTag 103 * Add an optimized mismatch-finding algorithm to UnsafeUtil. 104 * When serializing uint32 varints, check that we have MAX_VARINT32_SIZE bytes left, not just MAX_VARINT_SIZE. 105 * Minor optimization to RopeByteString.PieceIterator 106 107 JavaScript 108 * Simplify generated toObject code when the default value is used. 109 110 Python 111 * Changes implementation of Name() for enums that allow aliases in proto2 in Python to be in line with claims in C++ implementation (to return first value). 112 * Added double_format option in text format printer. 113 * Added iter and __contains__ to extension dict 114 * Added allow_unknown_field option in python text format parser 115 * Fixed Timestamp.ToDatetime() loses precision issue 116 * Support unknown field in text format printer. 117 * Float field will be convert to inf if bigger than struct.unpack('f', b'\xff\xff\x7f\x7f')[0] which is about 3.4028234664e+38, 118 convert to -inf if smaller than -3.4028234664e+38 119 * Allowed casting str->bytes in Message.__setstate__ 120 121 Ruby 122 * Helper methods to get enum name for Ruby. 123 124 1252019-01-24 version 3.7.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) 126 127 C++ 128 * Introduced new MOMI (maybe-outside-memory-interval) parser. 129 * Add an option to json_util to parse enum as case-insensitive. In the future, enum parsing in json_util will become case-sensitive. 130 * Added conformance test for enum aliases 131 * Added support for --cpp_out=speed:... 132 * Added use of C++ override keyword where appropriate 133 * Many other cleanups and fixes. 134 135 Java 136 * Fix illegal reflective access warning in JDK 9+ 137 * Add BOM 138 139 Python 140 * Added Python 3.7 compatibility. 141 * Modified ParseFromString to return bytes parsed . 142 * Introduce Proto C API. 143 * FindFileContainingSymbol in descriptor pool is now able to find field and enum values. 144 * reflection.MakeClass() and reflection.ParseMessage() are deprecated. 145 * Added DescriptorPool.FindMethodByName() method in pure python (c extension alreay has it) 146 * Flipped proto3 to preserve unknown fields by default. 147 * Added support for memoryview in python3 proto message parsing. 148 * Added MergeFrom for repeated scalar fields in c extension (pure python already has it) 149 * Surrogates are now rejected at setters in python3. 150 * Added public unknown field API. 151 * RecursionLimit is also set to max if allow_oversize_protos is enabled. 152 * Disallow duplicate scalars in proto3 text_format parse. 153 * Fix some segment faults for c extension map field. 154 155 PHP 156 * Most issues for json encoding/decoding in the c extension have been fixed. There are still some edge cases not fixed. For more details, check conformance/failure_list_php_c.txt. 157 * Supports php 7.3 158 * Added helper methods to convert between enum values and names. 159 * Allow setting/getting wrapper message fields using primitive values. 160 * Various bug fixes. 161 162 Ruby 163 * Ruby 2.6 support. 164 * Drops support for ruby < 2.3. 165 * Most issues for json encoding/decoding in the c extension have been fixed. There are still some edge cases not fixed. For more details, check conformance/failure_list_ruby.txt. 166 * Json parsing can specify an option to ignore unknown fields: msg.decode_json(data, {ignore_unknown_fields: true}). 167 * Added support for proto2 syntax (partially). 168 * Various bug fixes. 169 170 Csharp 171 * More support for FieldMask include merge, intersect and more. 172 * Increasing the default recursion limit to 100. 173 * Support loading FileDescriptors dynamically. 174 * Provide access to comments from descriptors. 175 * Added Any.Is method. 176 * Compatible with C# 6 177 * Added IComparable and comparison operators on Timestamp. 178 179 Objective C 180 * Add ability to introspect list of enum values (#4678) 181 * Copy the value when setting message/data fields (#5215) 182 * Support suppressing the objc package prefix checks on a list of files (#5309) 183 * More complete keyword and NSObject method (via categories) checks for field names, can result in more fields being rename, but avoids the collisions at runtime (#5289) 184 * Small fixes to TextFormat generation for extensions (#5362) 185 * Provide more details/context in deprecation messages (#5412) 186 * Array/Dictionary enumeration blocks NS_NOESCAPE annotation for Swift (#5421) 187 * Properly annotate extensions for ARC when their names imply behaviors (#5427) 188 * Enum alias name collision improvements (#5480) 189 190 1912018-07-27 version 3.6.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) 192 193 C++ 194 * Introduced workaround for Windows issue with std::atomic and std::once_flag 195 initialization (#4777, #4773). 196 197 PHP 198 * Added compatibility with PHP 7.3 (#4898). 199 200 Ruby 201 * Fixed Ruby crash involving Any encoding (#4718). 202 2032018-06-01 version 3.6.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) 204 205 C++ 206 * Starting from this release, we now require C++11. For those we cannot yet 207 upgrade to C++11, we will try to keep the 3.5.x branch updated with 208 critical bug fixes only. If you have any concerns about this, please 209 comment on issue #2780. 210 * Moved to C++11 types like std::atomic and std::unique_ptr and away from our 211 old custom-built equivalents. 212 * Added support for repeated message fields in lite protos using implicit 213 weak fields. This is an experimental feature that allows the linker to 214 strip out more unused messages than previously was possible. 215 * Fixed SourceCodeInfo for interpreted options and extension range options. 216 * Fixed always_print_enums_as_ints option for JSON serialization. 217 * Added support for ignoring unknown enum values when parsing JSON. 218 * Create std::string in Arena memory. 219 * Fixed ValidateDateTime to correctly check the day. 220 * Fixed bug in ZeroCopyStreamByteSink. 221 * Various other cleanups and fixes. 222 223 Java 224 * Dropped support for Java 6. 225 * Added a UTF-8 decoder that uses Unsafe to directly decode a byte buffer. 226 * Added deprecation annotations to generated code for deprecated oneof 227 fields. 228 * Fixed map field serialization in DynamicMessage. 229 * Cleanup and documentation for Java Lite runtime. 230 * Various other fixes and cleanups 231 * Fixed unboxed arraylists to handle an edge case 232 * Improved performance for copying between unboxed arraylists 233 * Fixed lite protobuf to avoid Java compiler warnings 234 * Improved test coverage for lite runtime 235 * Performance improvements for lite runtime 236 237 Python 238 * Fixed bytes/string map key incompatibility between C++ and pure-Python 239 implementations (issue #4029) 240 * Added __init__.py files to compiler and util subpackages 241 * Use /MT for all Windows versions 242 * Fixed an issue affecting the Python-C++ implementation when used with 243 Cython (issue #2896) 244 * Various text format fixes 245 * Various fixes to resolve behavior differences between the pure-Python and 246 Python-C++ implementations 247 248 PHP 249 * Added php_metadata_namespace to control the file path of generated metadata 250 file. 251 * Changed generated classes of nested message/enum. E.g., Foo.Bar, which 252 previously generates Foo_Bar, now generates Foo/Bar 253 * Added array constructor. When creating a message, users can pass a php 254 array whose content is field name to value pairs into constructor. The 255 created message will be initialized according to the array. Note that 256 message field should use a message value instead of a sub-array. 257 * Various bug fixes. 258 259 Objective-C 260 * We removed some helper class methods from GPBDictionary to shrink the size 261 of the library, the functionary is still there, but you may need to do some 262 specific +alloc / -init… methods instead. 263 * Minor improvements in the performance of object field getters/setters by 264 avoiding some memory management overhead. 265 * Fix a memory leak during the raising of some errors. 266 * Make header importing completely order independent. 267 * Small code improvements for things the undefined behaviors compiler option 268 was flagging. 269 270 Ruby 271 * Added ruby_package file option to control the module of generated class. 272 * Various bug fixes. 273 274 Javascript 275 * Allow setting string to int64 field. 276 277 Csharp 278 * Unknown fields are now parsed and then sent back on the wire. They can be 279 discarded at parse time via a CodedInputStream option. 280 * Movement towards working with .NET 3.5 and Unity 281 * Expression trees are no longer used 282 * AOT generics issues in Unity/il2cpp have a workaround (see this commit for 283 details) 284 * Floating point values are now compared bitwise (affects NaN value 285 comparisons) 286 * The default size limit when parsing is now 2GB rather than 64MB 287 * MessageParser now supports parsing from a slice of a byte array 288 * JSON list parsing now accepts null values where the underlying proto 289 representation does 290 2912017-12-20 version 3.5.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) 292 Planned Future Changes 293 * Make C++ implementation C++11 only: we plan to require C++11 to build 294 protobuf code starting from 3.6.0 release. Please join this github issue: 295 https://github.com/protocolbuffers/protobuf/issues/2780 to provide your feedback. 296 297 protoc 298 * Fixed a bug introduced in 3.5.0 and protoc in Windows now accepts non-ascii 299 characters in paths again. 300 301 C++ 302 * Removed several usages of C++11 features in the code base. 303 * Fixed some compiler warnings. 304 305 PHP 306 * Fixed memory leak in C-extension implementation. 307 * Added discardUnknokwnFields API. 308 * Removed duplicatd typedef in C-extension headers. 309 * Avoided calling private php methods (timelib_update_ts). 310 * Fixed Any.php to use fully-qualified name for DescriptorPool. 311 312 Ruby 313 * Added Google_Protobuf_discard_unknown for discarding unknown fields in 314 messages. 315 316 C# 317 * Unknown fields are now preserved by default. 318 * Floating point values are now bitwise compared, affecting message equality 319 check and Contains() API in map and repeated fields. 320 321 3222017-11-13 version 3.5.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) 323 Planned Future Changes 324 * Make C++ implementation C++11 only: we plan to require C++11 to build 325 protobuf code starting from 3.6.0 release. Please join this github issue: 326 https://github.com/protocolbuffers/protobuf/issues/2780 to provide your feedback. 327 328 General 329 * Unknown fields are now preserved in proto3 for most of the language 330 implementations for proto3 by default. See the per-language section for 331 details. 332 * reserve keyword are now supported in enums 333 334 C++ 335 * Proto3 messages are now preserving unknown fields by default. If you rely on 336 unknowns fields being dropped. Please use DiscardUnknownFields() explicitly. 337 * Deprecated the unsafe_arena_release_* and unsafe_arena_add_allocated_* 338 methods for string fields. 339 * Added move constructor and move assignment to RepeatedField, 340 RepeatedPtrField and google::protobuf::Any. 341 * Added perfect forwarding in Arena::CreateMessage 342 * In-progress experimental support for implicit weak fields with lite protos. 343 This feature allows the linker to strip out more unused messages and reduce 344 binary size. 345 * Various performance optimizations. 346 347 Java 348 * Proto3 messages are now preserving unknown fields by default. If you’d like 349 to drop unknown fields, please use the DiscardUnknownFieldsParser API. For 350 example: 351 Parser<Foo> parser = DiscardUnknownFieldsParser.wrap(Foo.parser()); 352 Foo foo = parser.parseFrom(input); 353 * Added a new CodedInputStream decoder for Iterable<ByteBuffer> with direct 354 ByteBuffers. 355 * TextFormat now prints unknown length-delimited fields as messages if 356 possible. 357 * FieldMaskUtil.merge() no longer creates unnecessary empty messages when a 358 message field is unset in both source message and destination message. 359 * Various performance optimizations. 360 361 Python 362 * Proto3 messages are now preserving unknown fields by default. Use 363 message.DiscardUnknownFields() to drop unknown fields. 364 * Add FieldDescriptor.file in generated code. 365 * Add descriptor pool FindOneofByName in pure python. 366 * Change unknown enum values into unknown field set . 367 * Add more Python dict/list compatibility for Struct/ListValue. 368 * Add utf-8 support for text_format.Merge()/Parse(). 369 * Support numeric unknown enum values for proto3 JSON format. 370 * Add warning for Unexpected end-group tag in cpp extension. 371 372 PHP 373 * Proto3 messages are now preserving unknown fields. 374 * Provide well known type messages in runtime. 375 * Add prefix ‘PB’ to generated class of reserved names. 376 * Fixed all conformance tests for encode/decode json in php runtime. C 377 extension needs more work. 378 379 Objective-C 380 * Fixed some issues around copying of messages with unknown fields and then 381 mutating the unknown fields in the copy. 382 383 C# 384 * Added unknown field support in JsonParser. 385 * Fixed oneof message field merge. 386 * Simplify parsing messages from array slices. 387 388 Ruby 389 * Unknown fields are now preserved by default. 390 * Fixed several bugs for segment fault. 391 392 Javascript 393 * Decoder can handle both paced and unpacked data no matter how the proto is 394 defined. 395 * Decoder now accept long varint for 32 bit integers. 396 397 3982017-08-14 version 3.4.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) 399 Planned Future Changes 400 * There are some changes that are not included in this release but are planned 401 for the near future 402 - Preserve unknown fields in proto3: We are going to bring unknown fields 403 back into proto3. In this release, some languages start to support 404 preserving unknown fields in proto3, controlled by flags/options. Some 405 languages also introduce explicit APIs to drop unknown fields for 406 migration. Please read the change log sections by languages for details. 407 For general timeline and plan: 408 409 https://docs.google.com/document/d/1KMRX-G91Aa-Y2FkEaHeeviLRRNblgIahbsk4wA14gRk/view 410 411 For issues and discussions: 412 413 https://github.com/protocolbuffers/protobuf/issues/272 414 415 - Make C++ implementation C++11 only: we plan to require C++11 to build 416 protobuf code starting from 3.5.0 or 3.6.0 release, after unknown fields 417 semantic changes are finished. Please join this 418 github issue: 419 420 https://github.com/protocolbuffers/protobuf/issues/2780 421 422 to provide your feedback. 423 424 General 425 * Extension ranges now accept options and are customizable. 426 * "reserve" keyword now supports “max” in field number ranges, 427 e.g. reserve 1000 to max; 428 429 C++ 430 * Proto3 messages are now able to preserve unknown fields. The default 431 behavior is still to drop unknowns, which will be flipped in a future 432 release. If you rely on unknowns fields being dropped. Please use 433 Message::DiscardUnknownFields() explicitly. 434 * Packable proto3 fields are now packed by default in serialization. 435 * Following C++11 features are introduced when C++11 is available: 436 - move-constructor and move-assignment are introduced to messages 437 - Repeated fields constructor now takes std::initializer_list 438 - rvalue setters are introduced for string fields 439 * Experimental Table-Driven parsing and serialization available to test. To 440 enable it, pass in table_driven_parsing table_driven_serialization protoc 441 generator flags for C++ 442 443 $ protoc --cpp_out=table_driven_parsing,table_driven_serialization:./ \ 444 test.proto 445 446 * lite generator parameter supported by the generator. Once set, all generated 447 files, use lite runtime regardless of the optimizer_for setting in the 448 .proto file. 449 * Various optimizations to make C++ code more performant on PowerPC platform 450 * Fixed maps data corruption when the maps are modified by both reflection API 451 and generated API. 452 * Deterministic serialization on maps reflection now uses stable sort. 453 * file() accessors are introduced to various *Descriptor classes to make 454 writing template function easier. 455 * ByteSize() and SpaceUsed() are deprecated.Use ByteSizeLong() and 456 SpaceUsedLong() instead 457 * Consistent hash function is used for maps in DEBUG and NDEBUG build. 458 * "using namespace std" is removed from stubs/common.h 459 * Various performance optimizations and bug fixes 460 461 Java 462 * Introduced new parser API DiscardUnknownFieldsParser in preparation of 463 proto3 unknown fields preservation change. Users who want to drop unknown 464 fields should migrate to use this new parser API. For example: 465 466 Parser<Foo> parser = DiscardUnknownFieldsParser.wrap(Foo.parser()); 467 Foo foo = parser.parseFrom(input); 468 469 * Introduced new TextFormat API printUnicodeFieldValue() that prints field 470 value without escaping unicode characters. 471 * Added Durations.compare(Duration, Duration) and 472 Timestamps.compare(Timestamp, Timestamp). 473 * JsonFormat now accepts base64url encoded bytes fields. 474 * Optimized CodedInputStream to do less copies when parsing large bytes 475 fields. 476 * Optimized TextFormat to allocate less memory when printing. 477 478 Python 479 * SerializeToString API is changed to SerializeToString(self, **kwargs), 480 deterministic parameter is accepted for deterministic serialization. 481 * Added sort_keys parameter in json format to make the output deterministic. 482 * Added indent parameter in json format. 483 * Added extension support in json format. 484 * Added __repr__ support for repeated field in cpp implementation. 485 * Added file in FieldDescriptor. 486 * Added pretty-print filter to text format. 487 * Services and method descriptors are always printed even if generic_service 488 option is turned off. 489 * Note: AppEngine 2.5 is deprecated on June 2017 that AppEngine 2.5 will 490 never update protobuf runtime. Users who depend on AppEngine 2.5 should use 491 old protoc. 492 493 PHP 494 * Support PHP generic services. Specify file option php_generic_service=true 495 to enable generating service interface. 496 * Message, repeated and map fields setters take value instead of reference. 497 * Added map iterator in c extension. 498 * Support json encode/decode. 499 * Added more type info in getter/setter phpdoc 500 * Fixed the problem that c extension and php implementation cannot be used 501 together. 502 * Added file option php_namespace to use custom php namespace instead of 503 package. 504 * Added fluent setter. 505 * Added descriptor API in runtime for custom encode/decode. 506 * Various bug fixes. 507 508 Objective-C 509 * Fix for GPBExtensionRegistry copying and add tests. 510 * Optimize GPBDictionary.m codegen to reduce size of overall library by 46K 511 per architecture. 512 * Fix some cases of reading of 64bit map values. 513 * Properly error on a tag with field number zero. 514 * Preserve unknown fields in proto3 syntax files. 515 * Document the exceptions on some of the writing apis. 516 517 C# 518 * Implemented IReadOnlyDictionary<K,V> in MapField<K,V> 519 * Added TryUnpack method for Any message in addition to Unpack. 520 * Converted C# projects to MSBuild (csproj) format. 521 522 Ruby 523 * Several bug fixes. 524 525 Javascript 526 * Added support of field option js_type. Now one can specify the JS type of a 527 64-bit integer field to be string in the generated code by adding option 528 [jstype = JS_STRING] on the field. 529 5302017-04-05 version 3.3.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) 531 Planned Future Changes 532 * There are some changes that are not included in this release but are 533 planned for the near future: 534 - Preserve unknown fields in proto3: please read this doc: 535 536 https://docs.google.com/document/d/1KMRX-G91Aa-Y2FkEaHeeviLRRNblgIahbsk4wA14gRk/view 537 538 for the timeline and follow up this github issue: 539 540 https://github.com/protocolbuffers/protobuf/issues/272 541 542 for discussion. 543 - Make C++ implementation C++11 only: we plan to require C++11 to build 544 protobuf code starting from 3.4.0 or 3.5.0 release. Please join this 545 github issue: 546 547 https://github.com/protocolbuffers/protobuf/issues/2780 548 549 to provide your feedback. 550 551 C++ 552 * Fixed map fields serialization of DynamicMessage to correctly serialize 553 both key and value regardless of their presence. 554 * Parser now rejects field number 0 correctly. 555 * New API Message::SpaceUsedLong() that’s equivalent to 556 Message::SpaceUsed() but returns the value in size_t. 557 * JSON support 558 - New flag always_print_enums_as_ints in JsonPrintOptions. 559 - New flag preserve_proto_field_names in JsonPrintOptions. It will instruct 560 the JSON printer to use the original field name declared in the .proto 561 file instead of converting them to lowerCamelCase when printing JSON. 562 - JsonPrintOptions.always_print_primtive_fields now works for oneof message 563 fields. 564 - Fixed a bug that doesn’t allow different fields to set the same json_name 565 value. 566 - Fixed a performance bug that causes excessive memory copy when printing 567 large messages. 568 * Various performance optimizations. 569 570 Java 571 * Map field setters eagerly validate inputs and throw NullPointerExceptions 572 as appropriate. 573 * Added ByteBuffer overloads to the generated parsing methods and the Parser 574 interface. 575 * proto3 enum's getNumber() method now throws on UNRECOGNIZED values. 576 * Output of JsonFormat is now locale independent. 577 578 Python 579 * Added FindServiceByName() in the pure-Python DescriptorPool. This works only 580 for descriptors added with DescriptorPool.Add(). Generated descriptor_pool 581 does not support this yet. 582 * Added a descriptor_pool parameter for parsing Any in text_format.Parse(). 583 * descriptor_pool.FindFileContainingSymbol() now is able to find nested 584 extensions. 585 * Extending empty [] to repeated field now sets parent message presence. 586 587 PHP 588 * Added file option php_class_prefix. The prefix will be prepended to all 589 generated classes defined in the file. 590 * When encoding, negative int32 values are sign-extended to int64. 591 * Repeated/Map field setter accepts a regular PHP array. Type checking is 592 done on the array elements. 593 * encode/decode are renamed to serializeToString/mergeFromString. 594 * Added mergeFrom, clear method on Message. 595 * Fixed a bug that oneof accessor didn’t return the field name that is 596 actually set. 597 * C extension now works with php7. 598 * This is the first GA release of PHP. We guarantee that old generated code 599 can always work with new runtime and new generated code. 600 601 Objective-C 602 * Fixed help for GPBTimestamp for dates before the epoch that contain 603 fractional seconds. 604 * Added GPBMessageDropUnknownFieldsRecursively() to remove unknowns from a 605 message and any sub messages. 606 * Addressed a threading race in extension registration/lookup. 607 * Increased the max message parsing depth to 100 to match the other languages. 608 * Removed some use of dispatch_once in favor of atomic compare/set since it 609 needs to be heap based. 610 * Fixes for new Xcode 8.3 warnings. 611 612 C# 613 * Fixed MapField.Values.CopyTo, which would throw an exception unnecessarily 614 if provided exactly the right size of array to copy to. 615 * Fixed enum JSON formatting when multiple names mapped to the same numeric 616 value. 617 * Added JSON formatting option to format enums as integers. 618 * Modified RepeatedField<T> to implement IReadOnlyList<T>. 619 * Introduced the start of custom option handling; it's not as pleasant as it 620 might be, but the information is at least present. We expect to extend code 621 generation to improve this in the future. 622 * Introduced ByteString.FromStream and ByteString.FromStreamAsync to 623 efficiently create a ByteString from a stream. 624 * Added whole-message deprecation, which decorates the class with [Obsolete]. 625 626 Ruby 627 * Fixed Message#to_h for messages with map fields. 628 * Fixed memcpy() in binary gems to work for old glibc, without breaking the 629 build for non-glibc libc’s like musl. 630 631 Javascript 632 * Added compatibility tests for version 3.0.0. 633 * Added conformance tests. 634 * Fixed serialization of extensions: we need to emit a value even if it is 635 falsy (like the number 0). 636 * Use closurebuilder.py in favor of calcdeps.py for compiling JavaScript. 637 6382017-01-23 version 3.2.0 (C++/Java/Python/PHP/Ruby/Objective-C/C#/JavaScript/Lite) 639 General 640 * Added protoc version number to protoc plugin protocol. It can be used by 641 protoc plugin to detect which version of protoc is used with the plugin and 642 mitigate known problems in certain version of protoc. 643 644 C++ 645 * The default parsing byte size limit has been raised from 64MB to 2GB. 646 * Added rvalue setters for non-arena string fields. 647 * Enabled debug logging for Android. 648 * Fixed a double-free problem when using Reflection::SetAllocatedMessage() 649 with extension fields. 650 * Fixed several deterministic serialization bugs: 651 * MessageLite::SerializeAsString() now respects the global deterministic 652 serialization flag. 653 * Extension fields are serialized deterministically as well. Fixed protocol 654 compiler to correctly report importing-self as an error. 655 * Fixed FileDescriptor::DebugString() to print custom options correctly. 656 * Various performance/codesize optimizations and cleanups. 657 658 Java 659 * The default parsing byte size limit has been raised from 64MB to 2GB. 660 * Added recursion limit when parsing JSON. 661 * Fixed a bug that enumType.getDescriptor().getOptions() doesn't have custom 662 options. 663 * Fixed generated code to support field numbers up to 2^29-1. 664 665 Python 666 * You can now assign NumPy scalars/arrays (np.int32, np.int64) to protobuf 667 fields, and assigning other numeric types has been optimized for 668 performance. 669 * Pure-Python: message types are now garbage-collectable. 670 * Python/C++: a lot of internal cleanup/refactoring. 671 672 PHP (Alpha) 673 * For 64-bit integers type (int64/uint64/sfixed64/fixed64/sint64), use PHP 674 integer on 64-bit environment and PHP string on 32-bit environment. 675 * PHP generated code also conforms to PSR-4 now. 676 * Fixed ZTS build for c extension. 677 * Fixed c extension build on Mac. 678 * Fixed c extension build on 32-bit linux. 679 * Fixed the bug that message without namespace is not found in the descriptor 680 pool. (#2240) 681 * Fixed the bug that repeated field is not iterable in c extension. 682 * Message names Empty will be converted to GPBEmpty in generated code. 683 * Added phpdoc in generated files. 684 * The released API is almost stable. Unless there is large problem, we won't 685 change it. See 686 https://developers.google.com/protocol-buffers/docs/reference/php-generated 687 for more details. 688 689 Objective-C 690 * Added support for push/pop of the stream limit on CodedInputStream for 691 anyone doing manual parsing. 692 693 C# 694 * No changes. 695 696 Ruby 697 * Message objects now support #respond_to? for field getters/setters. 698 * You can now compare “message == non_message_object” and it will return false 699 instead of throwing an exception. 700 * JRuby: fixed #hashCode to properly reflect the values in the message. 701 702 Javascript 703 * Deserialization of repeated fields no longer has quadratic performance 704 behavior. 705 * UTF-8 encoding/decoding now properly supports high codepoints. 706 * Added convenience methods for some well-known types: Any, Struct, and 707 Timestamp. These make it easier to convert data between native JavaScript 708 types and the well-known protobuf types. 709 7102016-09-23 version 3.1.0 (C++/Java/Python/PHP/Ruby/Objective-C/C#/JavaScript/Lite) 711 General 712 * Proto3 support in PHP (alpha). 713 * Various bug fixes. 714 715 C++ 716 * Added MessageLite::ByteSizeLong() that’s equivalent to 717 MessageLite::ByteSize() but returns the value in size_t. Useful to check 718 whether a message is over the 2G size limit that protobuf can support. 719 * Moved default_instances to global variables. This allows default_instance 720 addresses to be known at compile time. 721 * Adding missing generic gcc 64-bit atomicops. 722 * Restore New*Callback into google::protobuf namespace since these are used 723 by the service stubs code 724 * JSON support. 725 * Fixed some conformance issues. 726 * Fixed a JSON serialization bug for bytes fields. 727 728 Java 729 * Fixed a bug in TextFormat that doesn’t accept empty repeated fields (i.e., 730 “field: [ ]”). 731 * JSON support 732 * Fixed JsonFormat to do correct snake_case-to-camelCase conversion for 733 non-style-conforming field names. 734 * Fixed JsonFormat to parse empty Any message correctly. 735 * Added an option to JsonFormat.Parser to ignore unknown fields. 736 * Experimental API 737 * Added UnsafeByteOperations.unsafeWrap(byte[]) to wrap a byte array into 738 ByteString without copy. 739 740 Python 741 * JSON support 742 * Fixed some conformance issues. 743 744 PHP (Alpha) 745 * We have added the proto3 support for PHP via both a pure PHP package and a 746 native c extension. The pure PHP package is intended to provide usability 747 to wider range of PHP platforms, while the c extension is intended to 748 provide higher performance. Both implementations provide the same runtime 749 APIs and share the same generated code. Users don’t need to re-generate 750 code for the same proto definition when they want to switch the 751 implementation later. The pure PHP package is included in the php/src 752 directory, and the c extension is included in the php/ext directory. 753 754 Both implementations provide idiomatic PHP APIs: 755 * All messages and enums are defined as PHP classes. 756 * All message fields can only be accessed via getter/setter. 757 * Both repeated field elements and map elements are stored in containers 758 that act like a normal PHP array. 759 760 Unlike several existing third-party PHP implementations for protobuf, our 761 implementations are built on a "strongly-typed" philosophy: message fields 762 and array/map containers will throw exceptions eagerly when values of the 763 incorrect type (not including those that can be type converted, e.g., 764 double <-> integer <-> numeric string) are inserted. 765 766 Currently, pure PHP runtime supports php5.5, 5.6 and 7 on linux. C 767 extension runtime supports php5.5 and 5.6 on linux. 768 769 See php/README.md for more details about installment. See 770 https://developers.google.com/protocol-buffers/docs/phptutorial for more 771 details about APIs. 772 773 Objective-C 774 * Helpers are now provided for working the Any well known type (see 775 GPBWellKnownTypes.h for the api additions). 776 * Some improvements in startup code (especially when extensions aren’t used). 777 778 Javascript 779 * Fixed missing import of jspb.Map 780 * Fixed valueWriterFn variable name 781 782 Ruby 783 * Fixed hash computation for JRuby's RubyMessage 784 * Make sure map parsing frames are GC-rooted. 785 * Added API support for well-known types. 786 787 C# 788 * Removed check on dependency in the C# reflection API. 789 7902016-09-06 version 3.0.2 (C++/Java/Python/Ruby/Objective-C/C#/JavaScript/Lite) 791 General 792 * Various bug fixes. 793 794 Objective C 795 * Fix for oneofs in proto3 syntax files where fields were set to the zero 796 value. 797 * Fix for embedded null character in strings. 798 * CocoaDocs support 799 800 Ruby 801 * Fixed memory corruption bug in parsing that could occur under GC pressure. 802 803 Javascript 804 * jspb.Map is now properly exported to CommonJS modules. 805 806 C# 807 * Removed legacy_enum_values flag. 808 809 8102016-07-27 version 3.0.0 (C++/Java/Python/Ruby/Objective-C/C#/JavaScript/Lite) 811 General 812 * This log only contains changes since the beta-4 release. Summarized change 813 log since the last stable release (v2.6.1) can be found in the github 814 release page. 815 816 Compatibility Notice 817 * v3.0.0 is the first API stable release of the v3.x series. We do not expect 818 any future API breaking changes. 819 * For C++, Java Lite and Objective-C, source level compatibility is 820 guaranteed. Upgrading from v3.0.0 to newer minor version releases will be 821 source compatible. For example, if your code compiles against protobuf 822 v3.0.0, it will continue to compile after you upgrade protobuf library to 823 v3.1.0. 824 * For other languages, both source level compatibility and binary level 825 compatibility are guaranteed. For example, if you have a Java binary built 826 against protobuf v3.0.0. After switching the protobuf runtime binary to 827 v3.1.0, your built binary should continue to work. 828 * Compatibility is only guaranteed for documented API and documented 829 behaviors. If you are using undocumented API (e.g., use anything in the C++ 830 internal namespace), it can be broken by minor version releases in an 831 undetermined manner. 832 833 Ruby 834 * When you assign a string field `a.string_field = "X"`, we now call 835 #encode(UTF-8) on the string and freeze the copy. This saves you from 836 needing to ensure the string is already encoded as UTF-8. It also prevents 837 you from mutating the string after it has been assigned (this is how we 838 ensure it stays valid UTF-8). 839 * The generated file for `foo.proto` is now `foo_pb.rb` instead of just 840 `foo.rb`. This makes it easier to see which imports/requires are from 841 protobuf generated code, and also prevents conflicts with any `foo.rb` file 842 you might have written directly in Ruby. It is a backward-incompatible 843 change: you will need to update all of your `require` statements. 844 * For package names like `foo_bar`, we now translate this to the Ruby module 845 `FooBar`. This is more idiomatic Ruby than what we used to do (`Foo_bar`). 846 847 JavaScript 848 * Scalar fields like numbers and boolean now return defaults instead of 849 `undefined` or `null` when they are unset. You can test for presence 850 explicitly by calling `hasFoo()`, which we now generate for scalar fields. 851 852 Java Lite 853 * Java Lite is now implemented as a separate plugin, maintained in the 854 `javalite` branch. Both lite runtime and protoc artifacts will be available 855 in Maven. 856 857 C# 858 * Target platforms now .NET 4.5, selected portable subsets and .NET Core. 859 * legacy_enum_values option is no longer supported. 860 8612016-07-15 version 3.0.0-beta-4 (C++/Java/Python/Ruby/Objective-C/C#/JavaScript) 862 General 863 * Added a deterministic serialization API for C++. The deterministic 864 serialization guarantees that given a binary, equal messages will be 865 serialized to the same bytes. This allows applications like MapReduce to 866 group equal messages based on the serialized bytes. The deterministic 867 serialization is, however, NOT canonical across languages; it is also 868 unstable across different builds with schema changes due to unknown fields. 869 Users who need canonical serialization, e.g. persistent storage in a 870 canonical form, fingerprinting, etc, should define their own 871 canonicalization specification and implement the serializer using reflection 872 APIs rather than relying on this API. 873 * Added OneofOptions. You can now define custom options for oneof groups. 874 import "google/protobuf/descriptor.proto"; 875 extend google.protobuf.OneofOptions { 876 optional int32 my_oneof_extension = 12345; 877 } 878 message Foo { 879 oneof oneof_group { 880 (my_oneof_extension) = 54321; 881 ... 882 } 883 } 884 885 C++ (beta) 886 * Introduced a deterministic serialization API in 887 CodedOutputStream::SetSerializationDeterministic(bool). See the notes about 888 deterministic serialization in the General section. 889 * Added google::protobuf::Map::swap() to swap two map fields. 890 * Fixed a memory leak when calling Reflection::ReleaseMessage() on a message 891 allocated on arena. 892 * Improved error reporting when parsing text format protos. 893 * JSON 894 - Added a new parser option to ignore unknown fields when parsing JSON. 895 - Added convenient methods for message to/from JSON conversion. 896 * Various performance optimizations. 897 898 Java (beta) 899 * File option "java_generate_equals_and_hash" is now deprecated. equals() and 900 hashCode() methods are generated by default. 901 * Added a new JSON printer option "omittingInsignificantWhitespace" to produce 902 a more compact JSON output. The printer will pretty-print by default. 903 * Updated Java runtime to be compatible with 2.5.0/2.6.1 generated protos. 904 905 Python (beta) 906 * Added support to pretty print Any messages in text format. 907 * Added a flag to ignore unknown fields when parsing JSON. 908 * Bugfix: "@type" field of a JSON Any message is now correctly put before 909 other fields. 910 911 Objective-C (beta) 912 * Updated the code to support compiling with more compiler warnings 913 enabled. (Issue 1616) 914 * Exposing more detailed errors for parsing failures. (PR 1623) 915 * Small (breaking) change to the naming of some methods on the support classes 916 for map<>. There were collisions with the system provided KVO support, so 917 the names were changed to avoid those issues. (PR 1699) 918 * Fixed for proper Swift bridging of error handling during parsing. (PR 1712) 919 * Complete support for generating sources that will go into a Framework and 920 depend on generated sources from other Frameworks. (Issue 1457) 921 922 C# (beta) 923 * RepeatedField optimizations. 924 * Support for .NET Core. 925 * Minor bug fixes. 926 * Ability to format a single value in JsonFormatter (advanced usage only). 927 * Modifications to attributes applied to generated code. 928 929 Javascript (alpha) 930 * Maps now have a real map API instead of being treated as repeated fields. 931 * Well-known types are now provided in the google-protobuf package, and the 932 code generator knows to require() them from that package. 933 * Bugfix: non-canonical varints are correctly decoded. 934 935 Ruby (alpha) 936 * Accessors for oneof fields now return default values instead of nil. 937 938 Java Lite 939 * Java lite support is removed from protocol compiler. It will be supported 940 as a protocol compiler plugin in a separate code branch. 941 9422016-05-16 version 3.0.0-beta-3 (C++/Java/Python/Ruby/Nano/Objective-C/C#/JavaScript) 943 General 944 * Supported Proto3 lite-runtime in C++/Java for mobile platforms. 945 * Any type now supports APIs to specify prefixes other than 946 type.googleapis.com 947 * Removed javanano_use_deprecated_package option; Nano will always has its own 948 ".nano" package. 949 950 C++ (Beta) 951 * Improved hash maps. 952 - Improved hash maps comments. In particular, please note that equal hash 953 maps will not necessarily have the same iteration order and 954 serialization. 955 - Added a new hash maps implementation that will become the default in a 956 later release. 957 * Arenas 958 - Several inlined methods in Arena were moved to out-of-line to improve 959 build performance and code size. 960 - Added SpaceAllocatedAndUsed() to report both space used and allocated 961 - Added convenient class UnsafeArenaAllocatedRepeatedPtrFieldBackInserter 962 * Any 963 - Allow custom type URL prefixes in Any packing. 964 - TextFormat now expand the Any type rather than printing bytes. 965 * Performance optimizations and various bug fixes. 966 967 Java (Beta) 968 * Introduced an ExperimentalApi annotation. Annotated APIs are experimental 969 and are subject to change in a backward incompatible way in future releases. 970 * Introduced zero-copy serialization as an ExperimentalApi 971 - Introduction of the `ByteOutput` interface. This is similar to 972 `OutputStream` but provides semantics for lazy writing (i.e. no 973 immediate copy required) of fields that are considered to be immutable. 974 - `ByteString` now supports writing to a `ByteOutput`, which will directly 975 expose the internals of the `ByteString` (i.e. `byte[]` or `ByteBuffer`) 976 to the `ByteOutput` without copying. 977 - `CodedOutputStream` now supports writing to a `ByteOutput`. `ByteString` 978 instances that are too large to fit in the internal buffer will be 979 (lazily) written to the `ByteOutput` directly. 980 - This allows applications using large `ByteString` fields to avoid 981 duplication of these fields entirely. Such an application can supply a 982 `ByteOutput` that chains together the chunks received from 983 `CodedOutputStream` before forwarding them onto the IO system. 984 * Other related changes to `CodedOutputStream` 985 - Additional use of `sun.misc.Unsafe` where possible to perform fast 986 access to `byte[]` and `ByteBuffer` values and avoiding unnecessary 987 range checking. 988 - `ByteBuffer`-backed `CodedOutputStream` now writes directly to the 989 `ByteBuffer` rather than to an intermediate array. 990 * Improved lite-runtime. 991 - Lite protos now implement deep equals/hashCode/toString 992 - Significantly improved the performance of Builder#mergeFrom() and 993 Builder#mergeDelimitedFrom() 994 * Various bug fixes and small feature enhancement. 995 - Fixed stack overflow when in hashCode() for infinite recursive oneofs. 996 - Fixed the lazy field parsing in lite to merge rather than overwrite. 997 - TextFormat now supports reporting line/column numbers on errors. 998 - Updated to add appropriate @Override for better compiler errors. 999 1000 Python (Beta) 1001 * Added JSON format for Any, Struct, Value and ListValue 1002 * [ ] is now accepted for both repeated scalar fields and repeated message 1003 fields in text format parser. 1004 * Numerical field name is now supported in text format. 1005 * Added DiscardUnknownFields API for python protobuf message. 1006 1007 Objective-C (Beta) 1008 * Proto comments now come over as HeaderDoc comments in the generated sources 1009 so Xcode can pick them up and display them. 1010 * The library headers have been updated to use HeaderDoc comments so Xcode can 1011 pick them up and display them. 1012 * The per message and per field overhead in both generated code and runtime 1013 object sizes was reduced. 1014 * Generated code now include deprecated annotations when the proto file 1015 included them. 1016 1017 C# (Beta) 1018 In general: some changes are breaking, which require regenerating messages. 1019 Most user-written code will not be impacted *except* for the renaming of enum 1020 values. 1021 1022 * Allow custom type URL prefixes in `Any` packing, and ignore them when 1023 unpacking 1024 * `protoc` is now in a separate NuGet package (Google.Protobuf.Tools) 1025 * New option: `internal_access` to generate internal classes 1026 * Enum values are now PascalCased, and if there's a prefix which matches the 1027 name of the enum, that is removed (so an enum `COLOR` with a value 1028 `COLOR_BLUE` would generate a value of just `Blue`). An option 1029 (`legacy_enum_values`) is temporarily available to disable this, but the 1030 option will be removed for GA. 1031 * `json_name` option is now honored 1032 * If group tags are encountered when parsing, they are validated more 1033 thoroughly (although we don't support actual groups) 1034 * NuGet dependencies are better specified 1035 * Breaking: `Preconditions` is renamed to `ProtoPreconditions` 1036 * Breaking: `GeneratedCodeInfo` is renamed to `GeneratedClrTypeInfo` 1037 * `JsonFormatter` now allows writing to a `TextWriter` 1038 * New interface, `ICustomDiagnosticMessage` to allow more compact 1039 representations from `ToString` 1040 * `CodedInputStream` and `CodedOutputStream` now implement `IDisposable`, 1041 which simply disposes of the streams they were constructed with 1042 * Map fields no longer support null values (in line with other languages) 1043 * Improvements in JSON formatting and parsing 1044 1045 Javascript (Alpha) 1046 * Better support for "bytes" fields: bytes fields can be read as either a 1047 base64 string or UInt8Array (in environments where TypedArray is supported). 1048 * New support for CommonJS imports. This should make it easier to use the 1049 JavaScript support in Node.js and tools like WebPack. See js/README.md for 1050 more information. 1051 * Some significant internal refactoring to simplify and modularize the code. 1052 1053 Ruby (Alpha) 1054 * JSON serialization now properly uses camelCased names, with a runtime option 1055 that will preserve original names from .proto files instead. 1056 * Well-known types are now included in the distribution. 1057 * Release now includes binary gems for Windows, Mac, and Linux instead of just 1058 source gems. 1059 * Bugfix for serializing oneofs. 1060 1061 C++/Java Lite (Alpha) 1062 A new "lite" generator parameter was introduced in the protoc for C++ and 1063 Java for Proto3 syntax messages. Example usage: 1064 1065 ./protoc --cpp_out=lite:$OUTPUT_PATH foo.proto 1066 1067 The protoc will treat the current input and all the transitive dependencies 1068 as LITE. The same generator parameter must be used to generate the 1069 dependencies. 1070 1071 In Proto3 syntax files, "optimized_for=LITE_RUNTIME" is no longer supported. 1072 1073 10742015-12-30 version 3.0.0-beta-2 (C++/Java/Python/Ruby/Nano/Objective-C/C#/JavaScript) 1075 General 1076 * Introduced a new language implementation: JavaScript. 1077 * Added a new field option "json_name". By default proto field names are 1078 converted to "lowerCamelCase" in proto3 JSON format. This option can be 1079 used to override this behavior and specify a different JSON name for the 1080 field. 1081 * Added conformance tests to ensure implementations are following proto3 JSON 1082 specification. 1083 1084 C++ (Beta) 1085 * Various bug fixes and improvements to the JSON support utility: 1086 - Duplicate map keys in JSON are now rejected (i.e., translation will 1087 fail). 1088 - Fixed wire-format for google.protobuf.Value/ListValue. 1089 - Fixed precision loss when converting google.protobuf.Timestamp. 1090 - Fixed a bug when parsing invalid UTF-8 code points. 1091 - Fixed a memory leak. 1092 - Reduced call stack usage. 1093 1094 Java (Beta) 1095 * Cleaned up some unused methods on CodedOutputStream. 1096 * Presized lists for packed fields during parsing in the lite runtime to 1097 reduce allocations and improve performance. 1098 * Improved the performance of unknown fields in the lite runtime. 1099 * Introduced UnsafeByteStrings to support zero-copy ByteString creation. 1100 * Various bug fixes and improvements to the JSON support utility: 1101 - Fixed a thread-safety bug. 1102 - Added a new option “preservingProtoFieldNames” to JsonFormat. 1103 - Added a new option “includingDefaultValueFields” to JsonFormat. 1104 - Updated the JSON utility to comply with proto3 JSON specification. 1105 1106 Python (Beta) 1107 * Added proto3 JSON format utility. It includes support for all field types 1108 and a few well-known types except for Any and Struct. 1109 * Added runtime support for Any, Timestamp, Duration and FieldMask. 1110 * [ ] is now accepted for repeated scalar fields in text format parser. 1111 * Map fields now have proper O(1) performance for lookup/insert/delete 1112 when using the Python/C++ implementation. They were previously using O(n) 1113 search-based algorithms because the C++ reflection interface didn't 1114 support true map operations. 1115 1116 Objective-C (Beta) 1117 * Various bug-fixes and code tweaks to pass more strict compiler warnings. 1118 * Now has conformance test coverage and is passing all tests. 1119 1120 C# (Beta) 1121 * Various bug-fixes. 1122 * Code generation: Files generated in directories based on namespace. 1123 * Code generation: Include comments from .proto files in XML doc 1124 comments (naively) 1125 * Code generation: Change organization/naming of "reflection class" (access 1126 to file descriptor) 1127 * Code generation and library: Add Parser property to MessageDescriptor, 1128 and introduce a non-generic parser type. 1129 * Library: Added TypeRegistry to support JSON parsing/formatting of Any. 1130 * Library: Added Any.Pack/Unpack support. 1131 * Library: Implemented JSON parsing. 1132 1133 Javascript (Alpha) 1134 * Added proto3 support for JavaScript. The runtime is written in pure 1135 JavaScript and works in browsers and in Node.js. To generate JavaScript 1136 code for your proto, invoke protoc with "--js_out". See js/README.md 1137 for more build instructions. 1138 11392015-08-26 version 3.0.0-beta-1 (C++/Java/Python/Ruby/Nano/Objective-C/C#) 1140 About Beta 1141 * This is the first beta release of protobuf v3.0.0. Not all languages 1142 have reached beta stage. Languages not marked as beta are still in 1143 alpha (i.e., be prepared for API breaking changes). 1144 1145 General 1146 * Proto3 JSON is supported in several languages (fully supported in C++ 1147 and Java, partially supported in Ruby/C#). The JSON spec is defined in 1148 the proto3 language guide: 1149 1150 https://developers.google.com/protocol-buffers/docs/proto3#json 1151 1152 We will publish a more detailed spec to define the exact behavior of 1153 proto3-conformant JSON serializers and parsers. Until then, do not rely 1154 on specific behaviors of the implementation if it’s not documented in 1155 the above spec. More specifically, the behavior is not yet finalized for 1156 the following: 1157 - Parsing invalid JSON input (e.g., input with trailing commas). 1158 - Non-camelCase names in JSON input. 1159 - The same field appears multiple times in JSON input. 1160 - JSON arrays contain “null” values. 1161 - The message has unknown fields. 1162 1163 * Proto3 now enforces strict UTF-8 checking. Parsing will fail if a string 1164 field contains non UTF-8 data. 1165 1166 C++ (Beta) 1167 * Introduced new utility functions/classes in the google/protobuf/util 1168 directory: 1169 - MessageDifferencer: compare two proto messages and report their 1170 differences. 1171 - JsonUtil: support converting protobuf binary format to/from JSON. 1172 - TimeUtil: utility functions to work with well-known types Timestamp 1173 and Duration. 1174 - FieldMaskUtil: utility functions to work with FieldMask. 1175 1176 * Performance optimization of arena construction and destruction. 1177 * Bug fixes for arena and maps support. 1178 * Changed to use cmake for Windows Visual Studio builds. 1179 * Added Bazel support. 1180 1181 Java (Beta) 1182 * Introduced a new util package that will be distributed as a separate 1183 artifact in maven. It contains: 1184 - JsonFormat: convert proto messages to/from JSON. 1185 - TimeUtil: utility functions to work with Timestamp and Duration. 1186 - FieldMaskUtil: utility functions to work with FieldMask. 1187 1188 * The static PARSER in each generated message is deprecated, and it will 1189 be removed in a future release. A static parser() getter is generated 1190 for each message type instead. 1191 * Performance optimizations for String fields serialization. 1192 * Performance optimizations for Lite runtime on Android: 1193 - Reduced allocations 1194 - Reduced method overhead after ProGuarding 1195 - Reduced code size after ProGuarding 1196 1197 Python (Alpha) 1198 * Removed legacy Python 2.5 support. 1199 * Moved to a single Python 2.x/3.x-compatible codebase, instead of using 2to3. 1200 * Fixed build/tests on Python 2.6, 2.7, 3.3, and 3.4. 1201 - Pure-Python works on all four. 1202 - Python/C++ implementation works on all but 3.4, due to changes in the 1203 Python/C++ API in 3.4. 1204 * Some preliminary work has been done to allow for multiple DescriptorPools 1205 with Python/C++. 1206 1207 Ruby (Alpha) 1208 * Many bugfixes: 1209 - fixed parsing/serialization of bytes, sint, sfixed types 1210 - other parser bugfixes 1211 - fixed memory leak affecting Ruby 2.2 1212 1213 JavaNano (Alpha) 1214 * JavaNano generated code now will be put in a nano package by default to 1215 avoid conflicts with Java generated code. 1216 1217 Objective-C (Alpha) 1218 * Added non-null markup to ObjC library. Requires SDK 8.4+ to build. 1219 * Many bugfixes: 1220 - Removed the class/enum filter. 1221 - Renamed some internal types to avoid conflicts with the well-known types 1222 protos. 1223 - Added missing support for parsing repeated primitive fields in packed or 1224 unpacked forms. 1225 - Added *Count for repeated and map<> fields to avoid auto-create when 1226 checking for them being set. 1227 1228 C# (Alpha) 1229 * Namespace changed to Google.Protobuf (and NuGet package will be named 1230 correspondingly). 1231 * Target platforms now .NET 4.5 and selected portable subsets only. 1232 * Removed lite runtime. 1233 * Reimplementation to use mutable message types. 1234 * Null references used to represent "no value" for message type fields. 1235 * Proto3 semantics supported; proto2 files are prohibited for C# codegen. 1236 Most proto3 features supported: 1237 - JSON formatting (a.k.a. serialization to JSON), including well-known 1238 types (except for Any). 1239 - Wrapper types mapped to nullable value types (or string/ByteString 1240 allowing nullability). JSON parsing is not supported yet. 1241 - maps 1242 - oneof 1243 - enum unknown value preservation 1244 12452015-05-25 version 3.0.0-alpha-3 (Objective-C/C#): 1246 General 1247 * Introduced two new language implementations (Objective-C, C#) to proto3. 1248 * Explicit "optional" keyword are disallowed in proto3 syntax, as fields are 1249 optional by default. 1250 * Group fields are no longer supported in proto3 syntax. 1251 * Changed repeated primitive fields to use packed serialization by default in 1252 proto3 (implemented for C++, Java, Python in this release). The user can 1253 still disable packed serialization by setting packed to false for now. 1254 * Added well-known type protos (any.proto, empty.proto, timestamp.proto, 1255 duration.proto, etc.). Users can import and use these protos just like 1256 regular proto files. Additional runtime support will be added for them in 1257 future releases (in the form of utility helper functions, or having them 1258 replaced by language specific types in generated code). 1259 * Added a "reserved" keyword in both proto2 and proto3 syntax. User can use 1260 this keyword to declare reserved field numbers and names to prevent them 1261 from being reused by other fields in the same message. 1262 1263 To reserve field numbers, add a reserved declaration in your message: 1264 1265 message TestMessage { 1266 reserved 2, 15, 9 to 11, 3; 1267 } 1268 1269 This reserves field numbers 2, 3, 9, 10, 11 and 15. If a user uses any of 1270 these as field numbers, the protocol buffer compiler will report an error. 1271 1272 Field names can also be reserved: 1273 1274 message TestMessage { 1275 reserved "foo", "bar"; 1276 } 1277 1278 * Various bug fixes since 3.0.0-alpha-2 1279 1280 Objective-C 1281 Objective-C includes a code generator and a native objective-c runtime 1282 library. By adding “--objc_out” to protoc, the code generator will generate 1283 a header(*.pbobjc.h) and an implementation file(*.pbobjc.m) for each proto 1284 file. 1285 1286 In this first release, the generated interface provides: enums, messages, 1287 field support(single, repeated, map, oneof), proto2 and proto3 syntax 1288 support, parsing and serialization. It’s compatible with ARC and non-ARC 1289 usage. Besides, user can also access it via the swift bridging header. 1290 1291 See objectivec/README.md for details. 1292 1293 C# 1294 * C# protobufs are based on project 1295 https://github.com/jskeet/protobuf-csharp-port. The original project was 1296 frozen and all the new development will happen here. 1297 * Codegen plugin for C# was completely rewritten to C++ and is now an 1298 integral part of protoc. 1299 * Some refactorings and cleanup has been applied to the C# runtime library. 1300 * Only proto2 is supported in C# at the moment, proto3 support is in 1301 progress and will likely bring significant breaking changes to the API. 1302 1303 See csharp/README.md for details. 1304 1305 C++ 1306 * Added runtime support for Any type. To use Any in your proto file, first 1307 import the definition of Any: 1308 1309 // foo.proto 1310 import "google/protobuf/any.proto"; 1311 message Foo { 1312 google.protobuf.Any any_field = 1; 1313 } 1314 message Bar { 1315 int32 value = 1; 1316 } 1317 1318 Then in C++ you can access the Any field using PackFrom()/UnpackTo() 1319 methods: 1320 1321 Foo foo; 1322 Bar bar = ...; 1323 foo.mutable_any_field()->PackFrom(bar); 1324 ... 1325 if (foo.any_field().IsType<Bar>()) { 1326 foo.any_field().UnpackTo(&bar); 1327 ... 1328 } 1329 * In text format, entries of a map field will be sorted by key. 1330 1331 Java 1332 * Continued optimizations on the lite runtime to improve performance for 1333 Android. 1334 1335 Python 1336 * Added map support. 1337 - maps now have a dict-like interface (msg.map_field[key] = value) 1338 - existing code that modifies maps via the repeated field interface 1339 will need to be updated. 1340 1341 Ruby 1342 * Improvements to RepeatedField's emulation of the Ruby Array API. 1343 * Various speedups and internal cleanups. 1344 13452015-02-26 version 3.0.0-alpha-2 (Python/Ruby/JavaNano): 1346 General 1347 * Introduced three new language implementations (Ruby, JavaNano, and 1348 Python) to proto3. 1349 * Various bug fixes since 3.0.0-alpha-1 1350 1351 Python: 1352 Python has received several updates, most notably support for proto3 1353 semantics in any .proto file that declares syntax="proto3". 1354 Messages declared in proto3 files no longer represent field presence 1355 for scalar fields (number, enums, booleans, or strings). You can 1356 no longer call HasField() for such fields, and they are serialized 1357 based on whether they have a non-zero/empty/false value. 1358 1359 One other notable change is in the C++-accelerated implementation. 1360 Descriptor objects (which describe the protobuf schema and allow 1361 reflection over it) are no longer duplicated between the Python 1362 and C++ layers. The Python descriptors are now simple wrappers 1363 around the C++ descriptors. This change should significantly 1364 reduce the memory usage of programs that use a lot of message 1365 types. 1366 1367 Ruby: 1368 We have added proto3 support for Ruby via a native C extension. 1369 1370 The Ruby extension itself is included in the ruby/ directory, and details on 1371 building and installing the extension are in ruby/README.md. The extension 1372 will also be published as a Ruby gem. Code generator support is included as 1373 part of `protoc` with the `--ruby_out` flag. 1374 1375 The Ruby extension implements a user-friendly DSL to define message types 1376 (also generated by the code generator from `.proto` files). Once a message 1377 type is defined, the user may create instances of the message that behave in 1378 ways idiomatic to Ruby. For example: 1379 1380 - Message fields are present as ordinary Ruby properties (getter method 1381 `foo` and setter method `foo=`). 1382 - Repeated field elements are stored in a container that acts like a native 1383 Ruby array, and map elements are stored in a container that acts like a 1384 native Ruby hashmap. 1385 - The usual well-known methods, such as `#to_s`, `#dup`, and the like, are 1386 present. 1387 1388 Unlike several existing third-party Ruby extensions for protobuf, this 1389 extension is built on a "strongly-typed" philosophy: message fields and 1390 array/map containers will throw exceptions eagerly when values of the 1391 incorrect type are inserted. 1392 1393 See ruby/README.md for details. 1394 1395 JavaNano: 1396 JavaNano is a special code generator and runtime library designed especially 1397 for resource-restricted systems, like Android. It is very resource-friendly 1398 in both the amount of code and the runtime overhead. Here is an an overview 1399 of JavaNano features compared with the official Java protobuf: 1400 1401 - No descriptors or message builders. 1402 - All messages are mutable; fields are public Java fields. 1403 - For optional fields only, encapsulation behind setter/getter/hazzer/ 1404 clearer functions is opt-in, which provide proper 'has' state support. 1405 - For proto2, if not opted in, has state (field presence) is not available. 1406 Serialization outputs all fields not equal to their defaults. 1407 The behavior is consistent with proto3 semantics. 1408 - Required fields (proto2 only) are always serialized. 1409 - Enum constants are integers; protection against invalid values only 1410 when parsing from the wire. 1411 - Enum constants can be generated into container interfaces bearing 1412 the enum's name (so the referencing code is in Java style). 1413 - CodedInputByteBufferNano can only take byte[] (not InputStream). 1414 - Similarly CodedOutputByteBufferNano can only write to byte[]. 1415 - Repeated fields are in arrays, not ArrayList or Vector. Null array 1416 elements are allowed and silently ignored. 1417 - Full support for serializing/deserializing repeated packed fields. 1418 - Support extensions (in proto2). 1419 - Unset messages/groups are null, not an immutable empty default 1420 instance. 1421 - toByteArray(...) and mergeFrom(...) are now static functions of 1422 MessageNano. 1423 - The 'bytes' type translates to the Java type byte[]. 1424 1425 See javanano/README.txt for details. 1426 14272014-12-01 version 3.0.0-alpha-1 (C++/Java): 1428 1429 General 1430 * Introduced Protocol Buffers language version 3 (aka proto3). 1431 1432 When protobuf was initially opensourced it implemented Protocol Buffers 1433 language version 2 (aka proto2), which is why the version number 1434 started from v2.0.0. From v3.0.0, a new language version (proto3) is 1435 introduced while the old version (proto2) will continue to be supported. 1436 1437 The main intent of introducing proto3 is to clean up protobuf before 1438 pushing the language as the foundation of Google's new API platform. 1439 In proto3, the language is simplified, both for ease of use and to 1440 make it available in a wider range of programming languages. At the 1441 same time a few features are added to better support common idioms 1442 found in APIs. 1443 1444 The following are the main new features in language version 3: 1445 1446 1. Removal of field presence logic for primitive value fields, removal 1447 of required fields, and removal of default values. This makes proto3 1448 significantly easier to implement with open struct representations, 1449 as in languages like Android Java, Objective C, or Go. 1450 2. Removal of unknown fields. 1451 3. Removal of extensions, which are instead replaced by a new standard 1452 type called Any. 1453 4. Fix semantics for unknown enum values. 1454 5. Addition of maps. 1455 6. Addition of a small set of standard types for representation of time, 1456 dynamic data, etc. 1457 7. A well-defined encoding in JSON as an alternative to binary proto 1458 encoding. 1459 1460 This release (v3.0.0-alpha-1) includes partial proto3 support for C++ and 1461 Java. Items 6 (well-known types) and 7 (JSON format) in the above feature 1462 list are not implemented. 1463 1464 A new notion "syntax" is introduced to specify whether a .proto file 1465 uses proto2 or proto3: 1466 1467 // foo.proto 1468 syntax = "proto3"; 1469 message Bar {...} 1470 1471 If omitted, the protocol compiler will generate a warning and "proto2" will 1472 be used as the default. This warning will be turned into an error in a 1473 future release. 1474 1475 We recommend that new Protocol Buffers users use proto3. However, we do not 1476 generally recommend that existing users migrate from proto2 from proto3 due 1477 to API incompatibility, and we will continue to support proto2 for a long 1478 time. 1479 1480 * Added support for map fields (implemented in C++/Java for both proto2 and 1481 proto3). 1482 1483 Map fields can be declared using the following syntax: 1484 1485 message Foo { 1486 map<string, string> values = 1; 1487 } 1488 1489 Data of a map field will be stored in memory as an unordered map and it 1490 can be accessed through generated accessors. 1491 1492 C++ 1493 * Added arena allocation support (for both proto2 and proto3). 1494 1495 Profiling shows memory allocation and deallocation constitutes a significant 1496 fraction of CPU-time spent in protobuf code and arena allocation is a 1497 technique introduced to reduce this cost. With arena allocation, new 1498 objects will be allocated from a large piece of preallocated memory and 1499 deallocation of these objects is almost free. Early adoption shows 20% to 1500 50% improvement in some Google binaries. 1501 1502 To enable arena support, add the following option to your .proto file: 1503 1504 option cc_enable_arenas = true; 1505 1506 Protocol compiler will generate additional code to make the generated 1507 message classes work with arenas. This does not change the existing API 1508 of protobuf messages and does not affect wire format. Your existing code 1509 should continue to work after adding this option. In the future we will 1510 make this option enabled by default. 1511 1512 To actually take advantage of arena allocation, you need to use the arena 1513 APIs when creating messages. A quick example of using the arena API: 1514 1515 { 1516 google::protobuf::Arena arena; 1517 // Allocate a protobuf message in the arena. 1518 MyMessage* message = Arena::CreateMessage<MyMessage>(&arena); 1519 // All submessages will be allocated in the same arena. 1520 if (!message->ParseFromString(data)) { 1521 // Deal with malformed input data. 1522 } 1523 // Must not delete the message here. It will be deleted automatically 1524 // when the arena is destroyed. 1525 } 1526 1527 Currently arena does not work with map fields. Enabling arena in a .proto 1528 file containing map fields will result in compile errors in the generated 1529 code. This will be addressed in a future release. 1530 15312014-10-20 version 2.6.1: 1532 1533 C++ 1534 * Added atomicops support for Solaris. 1535 * Released memory allocated by InitializeDefaultRepeatedFields() and 1536 GetEmptyString(). Some memory sanitizers reported them as memory leaks. 1537 1538 Java 1539 * Updated DynamicMessage.setField() to handle repeated enum values 1540 correctly. 1541 * Fixed a bug that caused NullPointerException to be thrown when 1542 converting manually constructed FileDescriptorProto to 1543 FileDescriptor. 1544 1545 Python 1546 * Fixed WhichOneof() to work with de-serialized protobuf messages. 1547 * Fixed a missing file problem of Python C++ implementation. 1548 15492014-08-15 version 2.6.0: 1550 1551 General 1552 * Added oneofs(unions) feature. Fields in the same oneof will share 1553 memory and at most one field can be set at the same time. Use the 1554 oneof keyword to define a oneof like: 1555 message SampleMessage { 1556 oneof test_oneof { 1557 string name = 4; 1558 YourMessage sub_message = 9; 1559 } 1560 } 1561 * Files, services, enums, messages, methods and enum values can be marked 1562 as deprecated now. 1563 * Added Support for list values, including lists of messages, when 1564 parsing text-formatted protos in C++ and Java. 1565 For example: foo: [1, 2, 3] 1566 1567 C++ 1568 * Enhanced customization on TestFormat printing. 1569 * Added SwapFields() in reflection API to swap a subset of fields. 1570 Added SetAllocatedMessage() in reflection API. 1571 * Repeated primitive extensions are now packable. The 1572 [packed=true] option only affects serializers. Therefore, it is 1573 possible to switch a repeated extension field to packed format 1574 without breaking backwards-compatibility. 1575 * Various speed optimizations. 1576 1577 Java 1578 * writeTo() method in ByteString can now write a substring to an 1579 output stream. Added endWith() method for ByteString. 1580 * ByteString and ByteBuffer are now supported in CodedInputStream 1581 and CodedOutputStream. 1582 * java_generate_equals_and_hash can now be used with the LITE_RUNTIME. 1583 1584 Python 1585 * A new C++-backed extension module (aka "cpp api v2") that replaces the 1586 old ("cpp api v1") one. Much faster than the pure Python code. This one 1587 resolves many bugs and is recommended for general use over the 1588 pure Python when possible. 1589 * Descriptors now have enum_types_by_name and extension_types_by_name dict 1590 attributes. 1591 * Support for Python 3. 1592 15932013-02-27 version 2.5.0: 1594 1595 General 1596 * New notion "import public" that allows a proto file to forward the content 1597 it imports to its importers. For example, 1598 // foo.proto 1599 import public "bar.proto"; 1600 import "baz.proto"; 1601 1602 // qux.proto 1603 import "foo.proto"; 1604 // Stuff defined in bar.proto may be used in this file, but stuff from 1605 // baz.proto may NOT be used without importing it explicitly. 1606 This is useful for moving proto files. To move a proto file, just leave 1607 a single "import public" in the old proto file. 1608 * New enum option "allow_alias" that specifies whether different symbols can 1609 be assigned the same numeric value. Default value is "true". Setting it to 1610 false causes the compiler to reject enum definitions where multiple symbols 1611 have the same numeric value. 1612 Note: We plan to flip the default value to "false" in a future release. 1613 Projects using enum aliases should set the option to "true" in their .proto 1614 files. 1615 1616 C++ 1617 * New generated method set_allocated_foo(Type* foo) for message and string 1618 fields. This method allows you to set the field to a pre-allocated object 1619 and the containing message takes the ownership of that object. 1620 * Added SetAllocatedExtension() and ReleaseExtension() to extensions API. 1621 * Custom options are now formatted correctly when descriptors are printed in 1622 text format. 1623 * Various speed optimizations. 1624 1625 Java 1626 * Comments in proto files are now collected and put into generated code as 1627 comments for corresponding classes and data members. 1628 * Added Parser to parse directly into messages without a Builder. For 1629 example, 1630 Foo foo = Foo.PARSER.ParseFrom(input); 1631 Using Parser is ~25% faster than using Builder to parse messages. 1632 * Added getters/setters to access the underlying ByteString of a string field 1633 directly. 1634 * ByteString now supports more operations: substring(), prepend(), and 1635 append(). The implementation of ByteString uses a binary tree structure 1636 to support these operations efficiently. 1637 * New method findInitializationErrors() that lists all missing required 1638 fields. 1639 * Various code size and speed optimizations. 1640 1641 Python 1642 * Added support for dynamic message creation. DescriptorDatabase, 1643 DescriptorPool, and MessageFactory work like their C++ counterparts to 1644 simplify Descriptor construction from *DescriptorProtos, and MessageFactory 1645 provides a message instance from a Descriptor. 1646 * Added pickle support for protobuf messages. 1647 * Unknown fields are now preserved after parsing. 1648 * Fixed bug where custom options were not correctly populated. Custom 1649 options can be accessed now. 1650 * Added EnumTypeWrapper that provides better accessibility to enum types. 1651 * Added ParseMessage(descriptor, bytes) to generate a new Message instance 1652 from a descriptor and a byte string. 1653 16542011-05-01 version 2.4.1: 1655 1656 C++ 1657 * Fixed the friendship problem for old compilers to make the library now gcc 3 1658 compatible again. 1659 * Fixed vcprojects/extract_includes.bat to extract compiler/plugin.h. 1660 1661 Java 1662 * Removed usages of JDK 1.6 only features to make the library now JDK 1.5 1663 compatible again. 1664 * Fixed a bug about negative enum values. 1665 * serialVersionUID is now defined in generated messages for java serializing. 1666 * Fixed protoc to use java.lang.Object, which makes "Object" now a valid 1667 message name again. 1668 1669 Python 1670 * Experimental C++ implementation now requires C++ protobuf library installed. 1671 See the README.txt in the python directory for details. 1672 16732011-02-02 version 2.4.0: 1674 1675 General 1676 * The RPC (cc|java|py)_generic_services default value is now false instead of 1677 true. 1678 * Custom options can have aggregate types. For example, 1679 message MyOption { 1680 optional string comment = 1; 1681 optional string author = 2; 1682 } 1683 extend google.protobuf.FieldOptions { 1684 optional MyOption myoption = 12345; 1685 } 1686 This option can now be set as follows: 1687 message SomeType { 1688 optional int32 field = 1 [(myoption) = { comment:'x' author:'y' }]; 1689 } 1690 1691 C++ 1692 * Various speed and code size optimizations. 1693 * Added a release_foo() method on string and message fields. 1694 * Fixed gzip_output_stream sub-stream handling. 1695 1696 Java 1697 * Builders now maintain sub-builders for sub-messages. Use getFooBuilder() to 1698 get the builder for the sub-message "foo". This allows you to repeatedly 1699 modify deeply-nested sub-messages without rebuilding them. 1700 * Builder.build() no longer invalidates the Builder for generated messages 1701 (You may continue to modify it and then build another message). 1702 * Code generator will generate efficient equals() and hashCode() 1703 implementations if new option java_generate_equals_and_hash is enabled. 1704 (Otherwise, reflection-based implementations are used.) 1705 * Generated messages now implement Serializable. 1706 * Fields with [deprecated=true] will be marked with @Deprecated in Java. 1707 * Added lazy conversion of UTF-8 encoded strings to String objects to improve 1708 performance. 1709 * Various optimizations. 1710 * Enum value can be accessed directly, instead of calling getNumber() on the 1711 enum member. 1712 * For each enum value, an integer constant is also generated with the suffix 1713 _VALUE. 1714 1715 Python 1716 * Added an experimental C++ implementation for Python messages via a Python 1717 extension. Implementation type is controlled by an environment variable 1718 PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION (valid values: "cpp" and "python") 1719 The default value is currently "python" but will be changed to "cpp" in 1720 future release. 1721 * Improved performance on message instantiation significantly. 1722 Most of the work on message instantiation is done just once per message 1723 class, instead of once per message instance. 1724 * Improved performance on text message parsing. 1725 * Allow add() to forward keyword arguments to the concrete class. 1726 E.g. instead of 1727 item = repeated_field.add() 1728 item.foo = bar 1729 item.baz = quux 1730 You can do: 1731 repeated_field.add(foo=bar, baz=quux) 1732 * Added a sort() interface to the BaseContainer. 1733 * Added an extend() method to repeated composite fields. 1734 * Added UTF8 debug string support. 1735 17362010-01-08 version 2.3.0: 1737 1738 General 1739 * Parsers for repeated numeric fields now always accept both packed and 1740 unpacked input. The [packed=true] option only affects serializers. 1741 Therefore, it is possible to switch a field to packed format without 1742 breaking backwards-compatibility -- as long as all parties are using 1743 protobuf 2.3.0 or above, at least. 1744 * The generic RPC service code generated by the C++, Java, and Python 1745 generators can be disabled via file options: 1746 option cc_generic_services = false; 1747 option java_generic_services = false; 1748 option py_generic_services = false; 1749 This allows plugins to generate alternative code, possibly specific to some 1750 particular RPC implementation. 1751 1752 protoc 1753 * Now supports a plugin system for code generators. Plugins can generate 1754 code for new languages or inject additional code into the output of other 1755 code generators. Plugins are just binaries which accept a protocol buffer 1756 on stdin and write a protocol buffer to stdout, so they may be written in 1757 any language. See src/google/protobuf/compiler/plugin.proto. 1758 **WARNING**: Plugins are experimental. The interface may change in a 1759 future version. 1760 * If the output location ends in .zip or .jar, protoc will write its output 1761 to a zip/jar archive instead of a directory. For example: 1762 protoc --java_out=myproto_srcs.jar --python_out=myproto.zip myproto.proto 1763 Currently the archive contents are not compressed, though this could change 1764 in the future. 1765 * inf, -inf, and nan can now be used as default values for float and double 1766 fields. 1767 1768 C++ 1769 * Various speed and code size optimizations. 1770 * DynamicMessageFactory is now fully thread-safe. 1771 * Message::Utf8DebugString() method is like DebugString() but avoids escaping 1772 UTF-8 bytes. 1773 * Compiled-in message types can now contain dynamic extensions, through use 1774 of CodedInputStream::SetExtensionRegistry(). 1775 * Now compiles shared libraries (DLLs) by default on Cygwin and MinGW, to 1776 match other platforms. Use --disable-shared to avoid this. 1777 1778 Java 1779 * parseDelimitedFrom() and mergeDelimitedFrom() now detect EOF and return 1780 false/null instead of throwing an exception. 1781 * Fixed some initialization ordering bugs. 1782 * Fixes for OpenJDK 7. 1783 1784 Python 1785 * 10-25 times faster than 2.2.0, still pure-Python. 1786 * Calling a mutating method on a sub-message always instantiates the message 1787 in its parent even if the mutating method doesn't actually mutate anything 1788 (e.g. parsing from an empty string). 1789 * Expanded descriptors a bit. 1790 17912009-08-11 version 2.2.0: 1792 1793 C++ 1794 * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler 1795 to generate code which only depends libprotobuf-lite, which is much smaller 1796 than libprotobuf but lacks descriptors, reflection, and some other features. 1797 * Fixed bug where Message.Swap(Message) was only implemented for 1798 optimize_for_speed. Swap now properly implemented in both modes 1799 (Issue 91). 1800 * Added RemoveLast and SwapElements(index1, index2) to Reflection 1801 interface for repeated elements. 1802 * Added Swap(Message) to Reflection interface. 1803 * Floating-point literals in generated code that are intended to be 1804 single-precision now explicitly have 'f' suffix to avoid pedantic warnings 1805 produced by some compilers. 1806 * The [deprecated=true] option now causes the C++ code generator to generate 1807 a GCC-style deprecation annotation (no-op on other compilers). 1808 * google::protobuf::GetEnumDescriptor<SomeGeneratedEnumType>() returns the 1809 EnumDescriptor for that type -- useful for templates which cannot call 1810 SomeGeneratedEnumType_descriptor(). 1811 * Various optimizations and obscure bug fixes. 1812 1813 Java 1814 * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler 1815 to generate code which only depends libprotobuf-lite, which is much smaller 1816 than libprotobuf but lacks descriptors, reflection, and some other features. 1817 * Lots of style cleanups. 1818 1819 Python 1820 * Fixed endianness bug with floats and doubles. 1821 * Text format parsing support. 1822 * Fix bug with parsing packed repeated fields in embedded messages. 1823 * Ability to initialize fields by passing keyword args to constructor. 1824 * Support iterators in extend and __setslice__ for containers. 1825 18262009-05-13 version 2.1.0: 1827 1828 General 1829 * Repeated fields of primitive types (types other that string, group, and 1830 nested messages) may now use the option [packed = true] to get a more 1831 efficient encoding. In the new encoding, the entire list is written 1832 as a single byte blob using the "length-delimited" wire type. Within 1833 this blob, the individual values are encoded the same way they would 1834 be normally except without a tag before each value (thus, they are 1835 tightly "packed"). 1836 * For each field, the generated code contains an integer constant assigned 1837 to the field number. For example, the .proto file: 1838 message Foo { optional int bar_baz = 123; } 1839 would generate the following constants, all with the integer value 123: 1840 C++: Foo::kBarBazFieldNumber 1841 Java: Foo.BAR_BAZ_FIELD_NUMBER 1842 Python: Foo.BAR_BAZ_FIELD_NUMBER 1843 Constants are also generated for extensions, with the same naming scheme. 1844 These constants may be used as switch cases. 1845 * Updated bundled Google Test to version 1.3.0. Google Test is now bundled 1846 in its verbatim form as a nested autoconf package, so you can drop in any 1847 other version of Google Test if needed. 1848 * optimize_for = SPEED is now the default, by popular demand. Use 1849 optimize_for = CODE_SIZE if code size is more important in your app. 1850 * It is now an error to define a default value for a repeated field. 1851 Previously, this was silently ignored (it had no effect on the generated 1852 code). 1853 * Fields can now be marked deprecated like: 1854 optional int32 foo = 1 [deprecated = true]; 1855 Currently this does not have any actual effect, but in the future the code 1856 generators may generate deprecation annotations in each language. 1857 * Cross-compiling should now be possible using the --with-protoc option to 1858 configure. See README.txt for more info. 1859 1860 protoc 1861 * --error_format=msvs option causes errors to be printed in Visual Studio 1862 format, which should allow them to be clicked on in the build log to go 1863 directly to the error location. 1864 * The type name resolver will no longer resolve type names to fields. For 1865 example, this now works: 1866 message Foo {} 1867 message Bar { 1868 optional int32 Foo = 1; 1869 optional Foo baz = 2; 1870 } 1871 Previously, the type of "baz" would resolve to "Bar.Foo", and you'd get 1872 an error because Bar.Foo is a field, not a type. Now the type of "baz" 1873 resolves to the message type Foo. This change is unlikely to make a 1874 difference to anyone who follows the Protocol Buffers style guide. 1875 1876 C++ 1877 * Several optimizations, including but not limited to: 1878 - Serialization, especially to flat arrays, is 10%-50% faster, possibly 1879 more for small objects. 1880 - Several descriptor operations which previously required locking no longer 1881 do. 1882 - Descriptors are now constructed lazily on first use, rather than at 1883 process startup time. This should save memory in programs which do not 1884 use descriptors or reflection. 1885 - UnknownFieldSet completely redesigned to be more efficient (especially in 1886 terms of memory usage). 1887 - Various optimizations to reduce code size (though the serialization speed 1888 optimizations increased code size). 1889 * Message interface has method ParseFromBoundedZeroCopyStream() which parses 1890 a limited number of bytes from an input stream rather than parsing until 1891 EOF. 1892 * GzipInputStream and GzipOutputStream support reading/writing gzip- or 1893 zlib-compressed streams if zlib is available. 1894 (google/protobuf/io/gzip_stream.h) 1895 * DescriptorPool::FindAllExtensions() and corresponding 1896 DescriptorDatabase::FindAllExtensions() can be used to enumerate all 1897 extensions of a given type. 1898 * For each enum type Foo, protoc will generate functions: 1899 const string& Foo_Name(Foo value); 1900 bool Foo_Parse(const string& name, Foo* result); 1901 The former returns the name of the enum constant corresponding to the given 1902 value while the latter finds the value corresponding to a name. 1903 * RepeatedField and RepeatedPtrField now have back-insertion iterators. 1904 * String fields now have setters that take a char* and a size, in addition 1905 to the existing ones that took char* or const string&. 1906 * DescriptorPool::AllowUnknownDependencies() may be used to tell 1907 DescriptorPool to create placeholder descriptors for unknown entities 1908 referenced in a FileDescriptorProto. This can allow you to parse a .proto 1909 file without having access to other .proto files that it imports, for 1910 example. 1911 * Updated gtest to latest version. The gtest package is now included as a 1912 nested autoconf package, so it should be able to drop new versions into the 1913 "gtest" subdirectory without modification. 1914 1915 Java 1916 * Fixed bug where Message.mergeFrom(Message) failed to merge extensions. 1917 * Message interface has new method toBuilder() which is equivalent to 1918 newBuilderForType().mergeFrom(this). 1919 * All enums now implement the ProtocolMessageEnum interface. 1920 * Setting a field to null now throws NullPointerException. 1921 * Fixed tendency for TextFormat's parsing to overflow the stack when 1922 parsing large string values. The underlying problem is with Java's 1923 regex implementation (which unfortunately uses recursive backtracking 1924 rather than building an NFA). Worked around by making use of possessive 1925 quantifiers. 1926 * Generated service classes now also generate pure interfaces. For a service 1927 Foo, Foo.Interface is a pure interface containing all of the service's 1928 defined methods. Foo.newReflectiveService() can be called to wrap an 1929 instance of this interface in a class that implements the generic 1930 RpcService interface, which provides reflection support that is usually 1931 needed by RPC server implementations. 1932 * RPC interfaces now support blocking operation in addition to non-blocking. 1933 The protocol compiler generates separate blocking and non-blocking stubs 1934 which operate against separate blocking and non-blocking RPC interfaces. 1935 RPC implementations will have to implement the new interfaces in order to 1936 support blocking mode. 1937 * New I/O methods parseDelimitedFrom(), mergeDelimitedFrom(), and 1938 writeDelimitedTo() read and write "delimited" messages from/to a stream, 1939 meaning that the message size precedes the data. This way, you can write 1940 multiple messages to a stream without having to worry about delimiting 1941 them yourself. 1942 * Throw a more descriptive exception when build() is double-called. 1943 * Add a method to query whether CodedInputStream is at the end of the input 1944 stream. 1945 * Add a method to reset a CodedInputStream's size counter; useful when 1946 reading many messages with the same stream. 1947 * equals() and hashCode() now account for unknown fields. 1948 1949 Python 1950 * Added slicing support for repeated scalar fields. Added slice retrieval and 1951 removal of repeated composite fields. 1952 * Updated RPC interfaces to allow for blocking operation. A client may 1953 now pass None for a callback when making an RPC, in which case the 1954 call will block until the response is received, and the response 1955 object will be returned directly to the caller. This interface change 1956 cannot be used in practice until RPC implementations are updated to 1957 implement it. 1958 * Changes to input_stream.py should make protobuf compatible with appengine. 1959 19602008-11-25 version 2.0.3: 1961 1962 protoc 1963 * Enum values may now have custom options, using syntax similar to field 1964 options. 1965 * Fixed bug where .proto files which use custom options but don't actually 1966 define them (i.e. they import another .proto file defining the options) 1967 had to explicitly import descriptor.proto. 1968 * Adjacent string literals in .proto files will now be concatenated, like in 1969 C. 1970 * If an input file is a Windows absolute path (e.g. "C:\foo\bar.proto") and 1971 the import path only contains "." (or contains "." but does not contain 1972 the file), protoc incorrectly thought that the file was under ".", because 1973 it thought that the path was relative (since it didn't start with a slash). 1974 This has been fixed. 1975 1976 C++ 1977 * Generated message classes now have a Swap() method which efficiently swaps 1978 the contents of two objects. 1979 * All message classes now have a SpaceUsed() method which returns an estimate 1980 of the number of bytes of allocated memory currently owned by the object. 1981 This is particularly useful when you are reusing a single message object 1982 to improve performance but want to make sure it doesn't bloat up too large. 1983 * New method Message::SerializeAsString() returns a string containing the 1984 serialized data. May be more convenient than calling 1985 SerializeToString(string*). 1986 * In debug mode, log error messages when string-type fields are found to 1987 contain bytes that are not valid UTF-8. 1988 * Fixed bug where a message with multiple extension ranges couldn't parse 1989 extensions. 1990 * Fixed bug where MergeFrom(const Message&) didn't do anything if invoked on 1991 a message that contained no fields (but possibly contained extensions). 1992 * Fixed ShortDebugString() to not be O(n^2). Durr. 1993 * Fixed crash in TextFormat parsing if the first token in the input caused a 1994 tokenization error. 1995 * Fixed obscure bugs in zero_copy_stream_impl.cc. 1996 * Added support for HP C++ on Tru64. 1997 * Only build tests on "make check", not "make". 1998 * Fixed alignment issue that caused crashes when using DynamicMessage on 1999 64-bit Sparc machines. 2000 * Simplify template usage to work with MSVC 2003. 2001 * Work around GCC 4.3.x x86_64 compiler bug that caused crashes on startup. 2002 (This affected Fedora 9 in particular.) 2003 * Now works on "Solaris 10 using recent Sun Studio". 2004 2005 Java 2006 * New overload of mergeFrom() which parses a slice of a byte array instead 2007 of the whole thing. 2008 * New method ByteString.asReadOnlyByteBuffer() does what it sounds like. 2009 * Improved performance of isInitialized() when optimizing for code size. 2010 2011 Python 2012 * Corrected ListFields() signature in Message base class to match what 2013 subclasses actually implement. 2014 * Some minor refactoring. 2015 * Don't pass self as first argument to superclass constructor (no longer 2016 allowed in Python 2.6). 2017 20182008-09-29 version 2.0.2: 2019 2020 General 2021 * License changed from Apache 2.0 to 3-Clause BSD. 2022 * It is now possible to define custom "options", which are basically 2023 annotations which may be placed on definitions in a .proto file. 2024 For example, you might define a field option called "foo" like so: 2025 import "google/protobuf/descriptor.proto" 2026 extend google.protobuf.FieldOptions { 2027 optional string foo = 12345; 2028 } 2029 Then you annotate a field using the "foo" option: 2030 message MyMessage { 2031 optional int32 some_field = 1 [(foo) = "bar"] 2032 } 2033 The value of this option is then visible via the message's 2034 Descriptor: 2035 const FieldDescriptor* field = 2036 MyMessage::descriptor()->FindFieldByName("some_field"); 2037 assert(field->options().GetExtension(foo) == "bar"); 2038 This feature has been implemented and tested in C++ and Java. 2039 Other languages may or may not need to do extra work to support 2040 custom options, depending on how they construct descriptors. 2041 2042 C++ 2043 * Fixed some GCC warnings that only occur when using -pedantic. 2044 * Improved static initialization code, making ordering more 2045 predictable among other things. 2046 * TextFormat will no longer accept messages which contain multiple 2047 instances of a singular field. Previously, the latter instance 2048 would overwrite the former. 2049 * Now works on systems that don't have hash_map. 2050 2051 Java 2052 * Print @Override annotation in generated code where appropriate. 2053 2054 Python 2055 * Strings now use the "unicode" type rather than the "str" type. 2056 String fields may still be assigned ASCII "str" values; they will 2057 automatically be converted. 2058 * Adding a property to an object representing a repeated field now 2059 raises an exception. For example: 2060 # No longer works (and never should have). 2061 message.some_repeated_field.foo = 1 2062 2063 Windows 2064 * We now build static libraries rather than DLLs by default on MSVC. 2065 See vsprojects/readme.txt for more information. 2066 20672008-08-15 version 2.0.1: 2068 2069 protoc 2070 * New flags --encode and --decode can be used to convert between protobuf text 2071 format and binary format from the command-line. 2072 * New flag --descriptor_set_out can be used to write FileDescriptorProtos for 2073 all parsed files directly into a single output file. This is particularly 2074 useful if you wish to parse .proto files from programs written in languages 2075 other than C++: just run protoc as a background process and have it output 2076 a FileDescriptorList, then parse that natively. 2077 * Improved error message when an enum value's name conflicts with another 2078 symbol defined in the enum type's scope, e.g. if two enum types declared 2079 in the same scope have values with the same name. This is disallowed for 2080 compatibility with C++, but this wasn't clear from the error. 2081 * Fixed absolute output paths on Windows. 2082 * Allow trailing slashes in --proto_path mappings. 2083 2084 C++ 2085 * Reflection objects are now per-class rather than per-instance. To make this 2086 possible, the Reflection interface had to be changed such that all methods 2087 take the Message instance as a parameter. This change improves performance 2088 significantly in memory-bandwidth-limited use cases, since it makes the 2089 message objects smaller. Note that source-incompatible interface changes 2090 like this will not be made again after the library leaves beta. 2091 * Heuristically detect sub-messages when printing unknown fields. 2092 * Fix static initialization ordering bug that caused crashes at startup when 2093 compiling on Mac with static linking. 2094 * Fixed TokenizerTest when compiling with -DNDEBUG on Linux. 2095 * Fixed incorrect definition of kint32min. 2096 * Fix bytes type setter to work with byte sequences with embedded NULLs. 2097 * Other irrelevant tweaks. 2098 2099 Java 2100 * Fixed UnknownFieldSet's parsing of varints larger than 32 bits. 2101 * Fixed TextFormat's parsing of "inf" and "nan". 2102 * Fixed TextFormat's parsing of comments. 2103 * Added info to Java POM that will be required when we upload the 2104 package to a Maven repo. 2105 2106 Python 2107 * MergeFrom(message) and CopyFrom(message) are now implemented. 2108 * SerializeToString() raises an exception if the message is missing required 2109 fields. 2110 * Code organization improvements. 2111 * Fixed doc comments for RpcController and RpcChannel, which had somehow been 2112 swapped. 2113 * Fixed text_format_test on Windows where floating-point exponents sometimes 2114 contain extra zeros. 2115 * Fix Python service CallMethod() implementation. 2116 2117 Other 2118 * Improved readmes. 2119 * VIM syntax highlighting improvements. 2120 21212008-07-07 version 2.0.0: 2122 2123 * First public release. 2124