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