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