blob: d3b78f744c39a83efc494a593d9f1cd62532e561 [file] [log] [blame]
Jisi Liue298ce52016-09-06 14:37:35 -070012016-09-06 version 3.0.2 (C++/Java/Python/Ruby/Objective-C/C#/JavaScript/Lite)
Jisi Liu4041ed42016-09-02 11:24:58 -07002 General
3 * Various bug fixes.
4
5 Objective C
6 * Fix for oneofs in proto3 syntax files where fields were set to the zero
7 value.
8 * Fix for embedded null character in strings.
9 * CocoaDocs support
10
11 Ruby
Jisi Liu0c9999f2016-09-02 11:40:58 -070012 * Fixed memory corruption bug in parsing that could occur under GC pressure.
Jisi Liu4041ed42016-09-02 11:24:58 -070013
14 Javascript
Jisi Liu0c9999f2016-09-02 11:40:58 -070015 * jspb.Map is now properly exported to CommonJS modules.
16
17 C#
18 * Removed legacy_enum_values flag.
19
Jisi Liu4041ed42016-09-02 11:24:58 -070020
Jisi Liue0d817e2016-07-27 12:08:01 -0700212016-07-27 version 3.0.0 (C++/Java/Python/Ruby/Objective-C/C#/JavaScript/Lite)
22 General
23 * This log only contains changes since the beta-4 release. Summarized change
24 log since the last stable release (v2.6.1) can be found in the github
25 release page.
26
27 Compatibility Notice
28 * v3.0.0 is the first API stable release of the v3.x series. We do not expect
29 any future API breaking changes.
30 * For C++, Java Lite and Objective-C, source level compatibility is
31 guaranteed. Upgrading from v3.0.0 to newer minor version releases will be
32 source compatible. For example, if your code compiles against protobuf
33 v3.0.0, it will continue to compile after you upgrade protobuf library to
34 v3.1.0.
35 * For other languages, both source level compatibility and binary level
36 compatibility are guaranteed. For example, if you have a Java binary built
37 against protobuf v3.0.0. After switching the protobuf runtime binary to
38 v3.1.0, your built binary should continue to work.
39 * Compatibility is only guaranteed for documented API and documented
40 behaviors. If you are using undocumented API (e.g., use anything in the C++
41 internal namespace), it can be broken by minor version releases in an
42 undetermined manner.
43
44 Ruby
45 * When you assign a string field `a.string_field = "X"`, we now call
46 #encode(UTF-8) on the string and freeze the copy. This saves you from
47 needing to ensure the string is already encoded as UTF-8. It also prevents
48 you from mutating the string after it has been assigned (this is how we
49 ensure it stays valid UTF-8).
50 * The generated file for `foo.proto` is now `foo_pb.rb` instead of just
51 `foo.rb`. This makes it easier to see which imports/requires are from
52 protobuf generated code, and also prevents conflicts with any `foo.rb` file
53 you might have written directly in Ruby. It is a backward-incompatible
54 change: you will need to update all of your `require` statements.
55 * For package names like `foo_bar`, we now translate this to the Ruby module
56 `FooBar`. This is more idiomatic Ruby than what we used to do (`Foo_bar`).
57
58 JavaScript
59 * Scalar fields like numbers and boolean now return defaults instead of
60 `undefined` or `null` when they are unset. You can test for presence
61 explicitly by calling `hasFoo()`, which we now generate for scalar fields.
62
63 Java Lite
64 * Java Lite is now implemented as a separate plugin, maintained in the
65 `javalite` branch. Both lite runtime and protoc artifacts will be available
66 in Maven.
67
68 C#
69 * Target platforms now .NET 4.5, selected portable subsets and .NET Core.
70 * legacy_enum_values option is no longer supported.
71
Feng Xiao1349fb82016-07-15 12:19:15 -0700722016-07-15 version 3.0.0-beta-4 (C++/Java/Python/Ruby/Objective-C/C#/JavaScript)
73 General
Feng Xiao82b43d12016-07-18 10:36:04 -070074 * Added a deterministic serialization API for C++. The deterministic
Feng Xiao1349fb82016-07-15 12:19:15 -070075 serialization guarantees that given a binary, equal messages will be
76 serialized to the same bytes. This allows applications like MapReduce to
77 group equal messages based on the serialized bytes. The deterministic
78 serialization is, however, NOT canonical across languages; it is also
79 unstable across different builds with schema changes due to unknown fields.
80 Users who need canonical serialization, e.g. persistent storage in a
81 canonical form, fingerprinting, etc, should define their own
82 canonicalization specification and implement the serializer using reflection
83 APIs rather than relying on this API.
84 * Added OneofOptions. You can now define custom options for oneof groups.
85 import "google/protobuf/descriptor.proto";
86 extend google.protobuf.OneofOptions {
87 optional int32 my_oneof_extension = 12345;
88 }
89 message Foo {
90 oneof oneof_group {
91 (my_oneof_extension) = 54321;
92 ...
93 }
94 }
95
96 C++ (beta)
97 * Introduced a deterministic serialization API in
98 CodedOutputStream::SetSerializationDeterministic(bool). See the notes about
99 deterministic serialization in the General section.
100 * Added google::protobuf::Map::swap() to swap two map fields.
101 * Fixed a memory leak when calling Reflection::ReleaseMessage() on a message
102 allocated on arena.
103 * Improved error reporting when parsing text format protos.
104 * JSON
105 - Added a new parser option to ignore unknown fields when parsing JSON.
106 - Added convenient methods for message to/from JSON conversion.
107 * Various performance optimizations.
108
109 Java (beta)
Feng Xiao1349fb82016-07-15 12:19:15 -0700110 * File option "java_generate_equals_and_hash" is now deprecated. equals() and
111 hashCode() methods are generated by default.
112 * Added a new JSON printer option "omittingInsignificantWhitespace" to produce
113 a more compact JSON output. The printer will pretty-print by default.
114 * Updated Java runtime to be compatible with 2.5.0/2.6.1 generated protos.
115
116 Python (beta)
117 * Added support to pretty print Any messages in text format.
118 * Added a flag to ignore unknown fields when parsing JSON.
119 * Bugfix: "@type" field of a JSON Any message is now correctly put before
120 other fields.
121
122 Objective-C (beta)
123 * Updated the code to support compiling with more compiler warnings
124 enabled. (Issue 1616)
125 * Exposing more detailed errors for parsing failures. (PR 1623)
126 * Small (breaking) change to the naming of some methods on the support classes
127 for map<>. There were collisions with the system provided KVO support, so
128 the names were changed to avoid those issues. (PR 1699)
129 * Fixed for proper Swift bridging of error handling during parsing. (PR 1712)
130 * Complete support for generating sources that will go into a Framework and
131 depend on generated sources from other Frameworks. (Issue 1457)
132
133 C# (beta)
134 * RepeatedField optimizations.
135 * Support for .NET Core.
136 * Minor bug fixes.
137 * Ability to format a single value in JsonFormatter (advanced usage only).
138 * Modifications to attributes applied to generated code.
139
140 Javascript (alpha)
141 * Maps now have a real map API instead of being treated as repeated fields.
142 * Well-known types are now provided in the google-protobuf package, and the
143 code generator knows to require() them from that package.
144 * Bugfix: non-canonical varints are correctly decoded.
145
146 Ruby (alpha)
147 * Accessors for oneof fields now return default values instead of nil.
148
Feng Xiao3d9726f2016-07-15 15:26:44 -0700149 Java Lite
150 * Java lite support is removed from protocol compiler. It will be supported
151 as a protocol compiler plugin in a separate code branch.
152
Jisi Liu0ec34bf2016-05-16 11:20:33 -07001532016-05-16 version 3.0.0-beta-3 (C++/Java/Python/Ruby/Nano/Objective-C/C#/JavaScript)
Jisi Liu0e4d1ea2016-05-10 17:32:35 -0700154 General
155 * Supported Proto3 lite-runtime in C++/Java for mobile platforms.
156 * Any type now supports APIs to specify prefixes other than
157 type.googleapis.com
Jisi Liu0ec34bf2016-05-16 11:20:33 -0700158 * Removed javanano_use_deprecated_package option; Nano will always has its own
159 ".nano" package.
Jisi Liu0e4d1ea2016-05-10 17:32:35 -0700160
161 C++ (Beta)
Jisi Liu034867f2016-05-13 16:16:14 -0700162 * Improved hash maps.
163 - Improved hash maps comments. In particular, please note that equal hash
164 maps will not necessarily have the same iteration order and
165 serialization.
166 - Added a new hash maps implementation that will become the default in a
167 later release.
Jisi Liu0e4d1ea2016-05-10 17:32:35 -0700168 * Arenas
169 - Several inlined methods in Arena were moved to out-of-line to improve
170 build performance and code size.
171 - Added SpaceAllocatedAndUsed() to report both space used and allocated
172 - Added convenient class UnsafeArenaAllocatedRepeatedPtrFieldBackInserter
173 * Any
Jisi Liuede9cc42016-05-11 15:30:21 -0700174 - Allow custom type URL prefixes in Any packing.
Jisi Liu0e4d1ea2016-05-10 17:32:35 -0700175 - TextFormat now expand the Any type rather than printing bytes.
176 * Performance optimizations and various bug fixes.
177
178 Java (Beta)
179 * Introduced an ExperimentalApi annotation. Annotated APIs are experimental
180 and are subject to change in a backward incompatible way in future releases.
Jisi Liuede9cc42016-05-11 15:30:21 -0700181 * Introduced zero-copy serialization as an ExperimentalApi
182 - Introduction of the `ByteOutput` interface. This is similar to
183 `OutputStream` but provides semantics for lazy writing (i.e. no
184 immediate copy required) of fields that are considered to be immutable.
185 - `ByteString` now supports writing to a `ByteOutput`, which will directly
186 expose the internals of the `ByteString` (i.e. `byte[]` or `ByteBuffer`)
187 to the `ByteOutput` without copying.
188 - `CodedOutputStream` now supports writing to a `ByteOutput`. `ByteString`
189 instances that are too large to fit in the internal buffer will be
190 (lazily) written to the `ByteOutput` directly.
191 - This allows applications using large `ByteString` fields to avoid
192 duplication of these fields entirely. Such an application can supply a
193 `ByteOutput` that chains together the chunks received from
194 `CodedOutputStream` before forwarding them onto the IO system.
195 * Other related changes to `CodedOutputStream`
196 - Additional use of `sun.misc.Unsafe` where possible to perform fast
197 access to `byte[]` and `ByteBuffer` values and avoiding unnecessary
198 range checking.
199 - `ByteBuffer`-backed `CodedOutputStream` now writes directly to the
200 `ByteBuffer` rather than to an intermediate array.
Jisi Liu0ec34bf2016-05-16 11:20:33 -0700201 * Improved lite-runtime.
202 - Lite protos now implement deep equals/hashCode/toString
203 - Significantly improved the performance of Builder#mergeFrom() and
204 Builder#mergeDelimitedFrom()
Jisi Liu0e4d1ea2016-05-10 17:32:35 -0700205 * Various bug fixes and small feature enhancement.
206 - Fixed stack overflow when in hashCode() for infinite recursive oneofs.
207 - Fixed the lazy field parsing in lite to merge rather than overwrite.
208 - TextFormat now supports reporting line/column numbers on errors.
Jisi Liu0ec34bf2016-05-16 11:20:33 -0700209 - Updated to add appropriate @Override for better compiler errors.
Jisi Liu0e4d1ea2016-05-10 17:32:35 -0700210
211 Python (Beta)
Jie Luoe4ca6942016-05-11 16:39:50 -0700212 * Added JSON format for Any, Struct, Value and ListValue
213 * [ ] is now accepted for both repeated scalar fields and repeated message
214 fields in text format parser.
215 * Numerical field name is now supported in text format.
216 * Added DiscardUnknownFields API for python protobuf message.
Jisi Liu0e4d1ea2016-05-10 17:32:35 -0700217
218 Objective-C (Beta)
Jisi Liuede9cc42016-05-11 15:30:21 -0700219 * Proto comments now come over as HeaderDoc comments in the generated sources
220 so Xcode can pick them up and display them.
221 * The library headers have been updated to use HeaderDoc comments so Xcode can
222 pick them up and display them.
223 * The per message and per field overhead in both generated code and runtime
224 object sizes was reduced.
225 * Generated code now include deprecated annotations when the proto file
226 included them.
Jisi Liu0e4d1ea2016-05-10 17:32:35 -0700227
228 C# (Beta)
Jisi Liuede9cc42016-05-11 15:30:21 -0700229 In general: some changes are breaking, which require regenerating messages.
230 Most user-written code will not be impacted *except* for the renaming of enum
231 values.
232
233 * Allow custom type URL prefixes in `Any` packing, and ignore them when
234 unpacking
235 * `protoc` is now in a separate NuGet package (Google.Protobuf.Tools)
236 * New option: `internal_access` to generate internal classes
237 * Enum values are now PascalCased, and if there's a prefix which matches the
238 name of the enum, that is removed (so an enum `COLOR` with a value
239 `COLOR_BLUE` would generate a value of just `Blue`). An option
240 (`legacy_enum_values`) is temporarily available to disable this, but the
241 option will be removed for GA.
242 * `json_name` option is now honored
243 * If group tags are encountered when parsing, they are validated more
244 thoroughly (although we don't support actual groups)
245 * NuGet dependencies are better specified
246 * Breaking: `Preconditions` is renamed to `ProtoPreconditions`
247 * Breaking: `GeneratedCodeInfo` is renamed to `GeneratedClrTypeInfo`
248 * `JsonFormatter` now allows writing to a `TextWriter`
249 * New interface, `ICustomDiagnosticMessage` to allow more compact
250 representations from `ToString`
251 * `CodedInputStream` and `CodedOutputStream` now implement `IDisposable`,
252 which simply disposes of the streams they were constructed with
253 * Map fields no longer support null values (in line with other languages)
254 * Improvements in JSON formatting and parsing
Jisi Liu0e4d1ea2016-05-10 17:32:35 -0700255
256 Javascript (Alpha)
Josh Habermand346f492016-05-12 17:55:56 -0700257 * Better support for "bytes" fields: bytes fields can be read as either a
258 base64 string or UInt8Array (in environments where TypedArray is supported).
259 * New support for CommonJS imports. This should make it easier to use the
260 JavaScript support in Node.js and tools like WebPack. See js/README.md for
261 more information.
262 * Some significant internal refactoring to simplify and modularize the code.
263
264 Ruby (Alpha)
265 * JSON serialization now properly uses camelCased names, with a runtime option
266 that will preserve original names from .proto files instead.
267 * Well-known types are now included in the distribution.
268 * Release now includes binary gems for Windows, Mac, and Linux instead of just
269 source gems.
270 * Bugfix for serializing oneofs.
Jisi Liu0e4d1ea2016-05-10 17:32:35 -0700271
272 C++/Java Lite (Alpha)
273 A new "lite" generator parameter was introduced in the protoc for C++ and
Jisi Liu5668e2e2016-05-11 14:57:06 -0700274 Java for Proto3 syntax messages. Example usage:
Jisi Liu0e4d1ea2016-05-10 17:32:35 -0700275
276 ./protoc --cpp_out=lite:$OUTPUT_PATH foo.proto
277
278 The protoc will treat the current input and all the transitive dependencies
279 as LITE. The same generator parameter must be used to generate the
280 dependencies.
281
282 In Proto3 syntax files, "optimized_for=LITE_RUNTIME" is no longer supported.
283
284
Josh Haberman81e75c12015-12-30 14:03:49 -08002852015-12-30 version 3.0.0-beta-2 (C++/Java/Python/Ruby/Nano/Objective-C/C#/JavaScript)
Feng Xiaod5fb4082015-12-21 14:36:30 -0800286 General
Dongjoon Hyun7b08d492016-01-11 14:52:01 -0800287 * Introduced a new language implementation: JavaScript.
Feng Xiaod5fb4082015-12-21 14:36:30 -0800288 * Added a new field option "json_name". By default proto field names are
289 converted to "lowerCamelCase" in proto3 JSON format. This option can be
290 used to override this behavior and specify a different JSON name for the
291 field.
292 * Added conformance tests to ensure implementations are following proto3 JSON
293 specification.
294
295 C++ (Beta)
296 * Various bug fixes and improvements to the JSON support utility:
297 - Duplicate map keys in JSON are now rejected (i.e., translation will
298 fail).
299 - Fixed wire-format for google.protobuf.Value/ListValue.
300 - Fixed precision loss when converting google.protobuf.Timestamp.
301 - Fixed a bug when parsing invalid UTF-8 code points.
302 - Fixed a memory leak.
303 - Reduced call stack usage.
304
305 Java (Beta)
306 * Cleaned up some unused methods on CodedOutputStream.
307 * Presized lists for packed fields during parsing in the lite runtime to
308 reduce allocations and improve performance.
309 * Improved the performance of unknown fields in the lite runtime.
310 * Introduced UnsafeByteStrings to support zero-copy ByteString creation.
311 * Various bug fixes and improvements to the JSON support utility:
312 - Fixed a thread-safety bug.
313 - Added a new option “preservingProtoFieldNames” to JsonFormat.
314 - Added a new option “includingDefaultValueFields” to JsonFormat.
315 - Updated the JSON utility to comply with proto3 JSON specification.
316
317 Python (Beta)
318 * Added proto3 JSON format utility. It includes support for all field types
319 and a few well-known types except for Any and Struct.
320 * Added runtime support for Any, Timestamp, Duration and FieldMask.
321 * [ ] is now accepted for repeated scalar fields in text format parser.
Josh Haberman81e75c12015-12-30 14:03:49 -0800322 * Map fields now have proper O(1) performance for lookup/insert/delete
323 when using the Python/C++ implementation. They were previously using O(n)
324 search-based algorithms because the C++ reflection interface didn't
325 support true map operations.
Feng Xiaod5fb4082015-12-21 14:36:30 -0800326
327 Objective-C (Beta)
328 * Various bug-fixes and code tweaks to pass more strict compiler warnings.
329 * Now has conformance test coverage and is passing all tests.
330
331 C# (Beta)
332 * Various bug-fixes.
333 * Code generation: Files generated in directories based on namespace.
334 * Code generation: Include comments from .proto files in XML doc
335 comments (naively)
336 * Code generation: Change organization/naming of "reflection class" (access
337 to file descriptor)
338 * Code generation and library: Add Parser property to MessageDescriptor,
339 and introduce a non-generic parser type.
340 * Library: Added TypeRegistry to support JSON parsing/formatting of Any.
341 * Library: Added Any.Pack/Unpack support.
342 * Library: Implemented JSON parsing.
343
344 Javascript (Alpha)
345 * Added proto3 support for JavaScript. The runtime is written in pure
346 JavaScript and works in browsers and in Node.js. To generate JavaScript
347 code for your proto, invoke protoc with "--js_out". See js/README.md
348 for more build instructions.
349
Feng Xiaocc607532015-08-26 16:31:30 -07003502015-08-26 version 3.0.0-beta-1 (C++/Java/Python/Ruby/Nano/Objective-C/C#)
351 About Beta
352 * This is the first beta release of protobuf v3.0.0. Not all languages
353 have reached beta stage. Languages not marked as beta are still in
354 alpha (i.e., be prepared for API breaking changes).
355
356 General
357 * Proto3 JSON is supported in several languages (fully supported in C++
358 and Java, partially supported in Ruby/C#). The JSON spec is defined in
359 the proto3 language guide:
360
361 https://developers.google.com/protocol-buffers/docs/proto3#json
362
363 We will publish a more detailed spec to define the exact behavior of
364 proto3-conformant JSON serializers and parsers. Until then, do not rely
365 on specific behaviors of the implementation if it’s not documented in
366 the above spec. More specifically, the behavior is not yet finalized for
367 the following:
368 - Parsing invalid JSON input (e.g., input with trailing commas).
369 - Non-camelCase names in JSON input.
370 - The same field appears multiple times in JSON input.
371 - JSON arrays contain “null” values.
372 - The message has unknown fields.
373
374 * Proto3 now enforces strict UTF-8 checking. Parsing will fail if a string
375 field contains non UTF-8 data.
376
377 C++ (Beta)
378 * Introduced new utility functions/classes in the google/protobuf/util
379 directory:
380 - MessageDifferencer: compare two proto messages and report their
381 differences.
382 - JsonUtil: support converting protobuf binary format to/from JSON.
383 - TimeUtil: utility functions to work with well-known types Timestamp
384 and Duration.
385 - FieldMaskUtil: utility functions to work with FieldMask.
386
387 * Performance optimization of arena construction and destruction.
388 * Bug fixes for arena and maps support.
389 * Changed to use cmake for Windows Visual Studio builds.
390 * Added Bazel support.
391
392 Java (Beta)
393 * Introduced a new util package that will be distributed as a separate
394 artifact in maven. It contains:
395 - JsonFormat: convert proto messages to/from JSON.
396 - TimeUtil: utility functions to work with Timestamp and Duration.
397 - FieldMaskUtil: utility functions to work with FieldMask.
398
399 * The static PARSER in each generated message is deprecated, and it will
400 be removed in a future release. A static parser() getter is generated
401 for each message type instead.
402 * Performance optimizations for String fields serialization.
403 * Performance optimizations for Lite runtime on Android:
404 - Reduced allocations
405 - Reduced method overhead after ProGuarding
406 - Reduced code size after ProGuarding
407
408 Python (Alpha)
409 * Removed legacy Python 2.5 support.
410 * Moved to a single Python 2.x/3.x-compatible codebase, instead of using 2to3.
411 * Fixed build/tests on Python 2.6, 2.7, 3.3, and 3.4.
412 - Pure-Python works on all four.
413 - Python/C++ implementation works on all but 3.4, due to changes in the
414 Python/C++ API in 3.4.
415 * Some preliminary work has been done to allow for multiple DescriptorPools
416 with Python/C++.
417
418 Ruby (Alpha)
419 * Many bugfixes:
420 - fixed parsing/serialization of bytes, sint, sfixed types
421 - other parser bugfixes
422 - fixed memory leak affecting Ruby 2.2
423
424 JavaNano (Alpha)
425 * JavaNano generated code now will be put in a nano package by default to
426 avoid conflicts with Java generated code.
427
428 Objective-C (Alpha)
429 * Added non-null markup to ObjC library. Requires SDK 8.4+ to build.
430 * Many bugfixes:
431 - Removed the class/enum filter.
432 - Renamed some internal types to avoid conflicts with the well-known types
433 protos.
434 - Added missing support for parsing repeated primitive fields in packed or
435 unpacked forms.
436 - Added *Count for repeated and map<> fields to avoid auto-create when
437 checking for them being set.
438
439 C# (Alpha)
440 * Namespace changed to Google.Protobuf (and NuGet package will be named
441 correspondingly).
442 * Target platforms now .NET 4.5 and selected portable subsets only.
443 * Removed lite runtime.
444 * Reimplementation to use mutable message types.
445 * Null references used to represent "no value" for message type fields.
446 * Proto3 semantics supported; proto2 files are prohibited for C# codegen.
447 Most proto3 features supported:
448 - JSON formatting (a.k.a. serialization to JSON), including well-known
449 types (except for Any).
450 - Wrapper types mapped to nullable value types (or string/ByteString
451 allowing nullability). JSON parsing is not supported yet.
452 - maps
453 - oneof
454 - enum unknown value preservation
455
Bo Yang8908cf12015-05-26 14:37:47 -07004562015-05-25 version 3.0.0-alpha-3 (Objective-C/C#):
457 General
458 * Introduced two new language implementations (Objective-C, C#) to proto3.
Bo Yang3e2c8a52015-05-28 14:52:44 -0700459 * Explicit "optional" keyword are disallowed in proto3 syntax, as fields are
460 optional by default.
461 * Group fields are no longer supported in proto3 syntax.
Bo Yang8908cf12015-05-26 14:37:47 -0700462 * Changed repeated primitive fields to use packed serialization by default in
463 proto3 (implemented for C++, Java, Python in this release). The user can
464 still disable packed serialization by setting packed to false for now.
465 * Added well-known type protos (any.proto, empty.proto, timestamp.proto,
466 duration.proto, etc.). Users can import and use these protos just like
Dongjoon Hyun7b08d492016-01-11 14:52:01 -0800467 regular proto files. Additional runtime support will be added for them in
Bo Yang8908cf12015-05-26 14:37:47 -0700468 future releases (in the form of utility helper functions, or having them
469 replaced by language specific types in generated code).
470 * Added a "reserved" keyword in both proto2 and proto3 syntax. User can use
471 this keyword to declare reserved field numbers and names to prevent them
472 from being reused by other fields in the same message.
473
474 To reserve field numbers, add a reserved declaration in your message:
475
476 message TestMessage {
477 reserved 2, 15, 9 to 11, 3;
478 }
479
480 This reserves field numbers 2, 3, 9, 10, 11 and 15. If a user uses any of
481 these as field numbers, the protocol buffer compiler will report an error.
482
483 Field names can also be reserved:
484
485 message TestMessage {
486 reserved "foo", "bar";
487 }
488
489 * Various bug fixes since 3.0.0-alpha-2
490
491 Objective-C
492 Objective-C includes a code generator and a native objective-c runtime
493 library. By adding “--objc_out” to protoc, the code generator will generate
494 a header(*.pbobjc.h) and an implementation file(*.pbobjc.m) for each proto
495 file.
496
497 In this first release, the generated interface provides: enums, messages,
498 field support(single, repeated, map, oneof), proto2 and proto3 syntax
499 support, parsing and serialization. It’s compatible with ARC and non-ARC
500 usage. Besides, user can also access it via the swift bridging header.
501
502 See objectivec/README.md for details.
503
504 C#
505 * C# protobufs are based on project
506 https://github.com/jskeet/protobuf-csharp-port. The original project was
507 frozen and all the new development will happen here.
508 * Codegen plugin for C# was completely rewritten to C++ and is now an
Dongjoon Hyun7b08d492016-01-11 14:52:01 -0800509 integral part of protoc.
Bo Yang8908cf12015-05-26 14:37:47 -0700510 * Some refactorings and cleanup has been applied to the C# runtime library.
511 * Only proto2 is supported in C# at the moment, proto3 support is in
512 progress and will likely bring significant breaking changes to the API.
513
514 See csharp/README.md for details.
515
516 C++
517 * Added runtime support for Any type. To use Any in your proto file, first
518 import the definition of Any:
519
520 // foo.proto
521 import "google/protobuf/any.proto";
522 message Foo {
523 google.protobuf.Any any_field = 1;
524 }
525 message Bar {
526 int32 value = 1;
527 }
528
529 Then in C++ you can access the Any field using PackFrom()/UnpackTo()
530 methods:
531
532 Foo foo;
533 Bar bar = ...;
534 foo.mutable_any_field()->PackFrom(bar);
535 ...
536 if (foo.any_field().IsType<Bar>()) {
537 foo.any_field().UnpackTo(&bar);
538 ...
539 }
540 * In text format, entries of a map field will be sorted by key.
541
542 Java
543 * Continued optimizations on the lite runtime to improve performance for
544 Android.
545
546 Python
547 * Added map support.
548 - maps now have a dict-like interface (msg.map_field[key] = value)
549 - existing code that modifies maps via the repeated field interface
550 will need to be updated.
551
552 Ruby
553 * Improvements to RepeatedField's emulation of the Ruby Array API.
554 * Various speedups and internal cleanups.
555
Josh Haberman7d5cf8d2015-02-25 23:47:09 -08005562015-02-26 version 3.0.0-alpha-2 (Python/Ruby/JavaNano):
Jisi Liu32f5d012015-02-20 14:45:45 -0800557 General
Josh Haberman7d5cf8d2015-02-25 23:47:09 -0800558 * Introduced three new language implementations (Ruby, JavaNano, and
559 Python) to proto3.
Jisi Liu32f5d012015-02-20 14:45:45 -0800560 * Various bug fixes since 3.0.0-alpha-1
561
Josh Haberman31e8c202015-02-25 23:06:35 -0800562 Python:
563 Python has received several updates, most notably support for proto3
564 semantics in any .proto file that declares syntax="proto3".
565 Messages declared in proto3 files no longer represent field presence
566 for scalar fields (number, enums, booleans, or strings). You can
567 no longer call HasField() for such fields, and they are serialized
568 based on whether they have a non-zero/empty/false value.
569
570 One other notable change is in the C++-accelerated implementation.
571 Descriptor objects (which describe the protobuf schema and allow
572 reflection over it) are no longer duplicated between the Python
573 and C++ layers. The Python descriptors are now simple wrappers
574 around the C++ descriptors. This change should significantly
575 reduce the memory usage of programs that use a lot of message
576 types.
577
Jisi Liu32f5d012015-02-20 14:45:45 -0800578 Ruby:
Chris Fallin1d4f3212015-02-20 17:32:06 -0800579 We have added proto3 support for Ruby via a native C extension.
580
581 The Ruby extension itself is included in the ruby/ directory, and details on
582 building and installing the extension are in ruby/README.md. The extension
583 will also be published as a Ruby gem. Code generator support is included as
584 part of `protoc` with the `--ruby_out` flag.
585
586 The Ruby extension implements a user-friendly DSL to define message types
587 (also generated by the code generator from `.proto` files). Once a message
588 type is defined, the user may create instances of the message that behave in
589 ways idiomatic to Ruby. For example:
590
591 - Message fields are present as ordinary Ruby properties (getter method
592 `foo` and setter method `foo=`).
593 - Repeated field elements are stored in a container that acts like a native
594 Ruby array, and map elements are stored in a container that acts like a
595 native Ruby hashmap.
596 - The usual well-known methods, such as `#to_s`, `#dup`, and the like, are
597 present.
598
599 Unlike several existing third-party Ruby extensions for protobuf, this
600 extension is built on a "strongly-typed" philosophy: message fields and
601 array/map containers will throw exceptions eagerly when values of the
602 incorrect type are inserted.
603
604 See ruby/README.md for details.
Jisi Liu32f5d012015-02-20 14:45:45 -0800605
606 JavaNano:
607 JavaNano is a special code generator and runtime library designed especially
608 for resource-restricted systems, like Android. It is very resource-friendly
609 in both the amount of code and the runtime overhead. Here is an an overview
610 of JavaNano features compared with the official Java protobuf:
611
612 - No descriptors or message builders.
613 - All messages are mutable; fields are public Java fields.
614 - For optional fields only, encapsulation behind setter/getter/hazzer/
615 clearer functions is opt-in, which provide proper 'has' state support.
616 - For proto2, if not opted in, has state (field presence) is not available.
617 Serialization outputs all fields not equal to their defaults.
618 The behavior is consistent with proto3 semantics.
619 - Required fields (proto2 only) are always serialized.
620 - Enum constants are integers; protection against invalid values only
621 when parsing from the wire.
622 - Enum constants can be generated into container interfaces bearing
623 the enum's name (so the referencing code is in Java style).
624 - CodedInputByteBufferNano can only take byte[] (not InputStream).
625 - Similarly CodedOutputByteBufferNano can only write to byte[].
626 - Repeated fields are in arrays, not ArrayList or Vector. Null array
627 elements are allowed and silently ignored.
628 - Full support for serializing/deserializing repeated packed fields.
629 - Support extensions (in proto2).
630 - Unset messages/groups are null, not an immutable empty default
631 instance.
632 - toByteArray(...) and mergeFrom(...) are now static functions of
633 MessageNano.
634 - The 'bytes' type translates to the Java type byte[].
635
636 See javanano/README.txt for details.
637
Feng Xiao9104da32014-12-09 11:57:52 -08006382014-12-01 version 3.0.0-alpha-1 (C++/Java):
639
640 General
641 * Introduced Protocol Buffers language version 3 (aka proto3).
642
643 When protobuf was initially opensourced it implemented Protocol Buffers
644 language version 2 (aka proto2), which is why the version number
645 started from v2.0.0. From v3.0.0, a new language version (proto3) is
646 introduced while the old version (proto2) will continue to be supported.
647
648 The main intent of introducing proto3 is to clean up protobuf before
649 pushing the language as the foundation of Google's new API platform.
650 In proto3, the language is simplified, both for ease of use and to
651 make it available in a wider range of programming languages. At the
652 same time a few features are added to better support common idioms
653 found in APIs.
654
655 The following are the main new features in language version 3:
656
657 1. Removal of field presence logic for primitive value fields, removal
658 of required fields, and removal of default values. This makes proto3
659 significantly easier to implement with open struct representations,
660 as in languages like Android Java, Objective C, or Go.
661 2. Removal of unknown fields.
662 3. Removal of extensions, which are instead replaced by a new standard
663 type called Any.
664 4. Fix semantics for unknown enum values.
665 5. Addition of maps.
666 6. Addition of a small set of standard types for representation of time,
667 dynamic data, etc.
668 7. A well-defined encoding in JSON as an alternative to binary proto
669 encoding.
670
671 This release (v3.0.0-alpha-1) includes partial proto3 support for C++ and
672 Java. Items 6 (well-known types) and 7 (JSON format) in the above feature
Dongjoon Hyun7b08d492016-01-11 14:52:01 -0800673 list are not implemented.
Feng Xiao9104da32014-12-09 11:57:52 -0800674
675 A new notion "syntax" is introduced to specify whether a .proto file
676 uses proto2 or proto3:
677
678 // foo.proto
679 syntax = "proto3";
680 message Bar {...}
681
682 If omitted, the protocol compiler will generate a warning and "proto2" will
683 be used as the default. This warning will be turned into an error in a
684 future release.
685
686 We recommend that new Protocol Buffers users use proto3. However, we do not
687 generally recommend that existing users migrate from proto2 from proto3 due
688 to API incompatibility, and we will continue to support proto2 for a long
689 time.
690
691 * Added support for map fields (implemented in C++/Java for both proto2 and
692 proto3).
693
694 Map fields can be declared using the following syntax:
695
696 message Foo {
697 map<string, string> values = 1;
698 }
699
700 Data of a map field will be stored in memory as an unordered map and it
701 can be accessed through generated accessors.
702
703 C++
704 * Added arena allocation support (for both proto2 and proto3).
705
706 Profiling shows memory allocation and deallocation constitutes a significant
707 fraction of CPU-time spent in protobuf code and arena allocation is a
708 technique introduced to reduce this cost. With arena allocation, new
709 objects will be allocated from a large piece of preallocated memory and
710 deallocation of these objects is almost free. Early adoption shows 20% to
711 50% improvement in some Google binaries.
712
713 To enable arena support, add the following option to your .proto file:
714
715 option cc_enable_arenas = true;
716
717 Protocol compiler will generate additional code to make the generated
718 message classes work with arenas. This does not change the existing API
719 of protobuf messages and does not affect wire format. Your existing code
720 should continue to work after adding this option. In the future we will
721 make this option enabled by default.
722
723 To actually take advantage of arena allocation, you need to use the arena
724 APIs when creating messages. A quick example of using the arena API:
725
726 {
727 google::protobuf::Arena arena;
728 // Allocate a protobuf message in the arena.
729 MyMessage* message = Arena::CreateMessage<MyMessage>(&arena);
730 // All submessages will be allocated in the same arena.
731 if (!message->ParseFromString(data)) {
732 // Deal with malformed input data.
733 }
734 // Must not delete the message here. It will be deleted automatically
735 // when the arena is destroyed.
736 }
737
738 Currently arena does not work with map fields. Enabling arena in a .proto
739 file containing map fields will result in compile errors in the generated
740 code. This will be addressed in a future release.
741
Feng Xiaobba83652014-10-20 17:06:06 -07007422014-10-20 version 2.6.1:
Feng Xiao57b86722014-10-09 11:20:08 -0700743
744 C++
745 * Added atomicops support for Solaris.
746 * Released memory allocated by InitializeDefaultRepeatedFields() and
747 GetEmptyString(). Some memory sanitizers reported them as memory leaks.
748
749 Java
750 * Updated DynamicMessage.setField() to handle repeated enum values
751 correctly.
752 * Fixed a bug that caused NullPointerException to be thrown when
753 converting manually constructed FileDescriptorProto to
754 FileDescriptor.
755
756 Python
Feng Xiao419c94b2014-10-09 11:40:02 -0700757 * Fixed WhichOneof() to work with de-serialized protobuf messages.
Feng Xiao57b86722014-10-09 11:20:08 -0700758 * Fixed a missing file problem of Python C++ implementation.
759
jieluo@google.com1eba9d92014-08-25 20:17:53 +00007602014-08-15 version 2.6.0:
761
762 General
763 * Added oneofs(unions) feature. Fields in the same oneof will share
764 memory and at most one field can be set at the same time. Use the
765 oneof keyword to define a oneof like:
766 message SampleMessage {
767 oneof test_oneof {
768 string name = 4;
769 YourMessage sub_message = 9;
770 }
771 }
772 * Files, services, enums, messages, methods and enum values can be marked
773 as deprecated now.
Dongjoon Hyun7b08d492016-01-11 14:52:01 -0800774 * Added Support for list values, including lists of messages, when
jieluo@google.com1eba9d92014-08-25 20:17:53 +0000775 parsing text-formatted protos in C++ and Java.
776 For example: foo: [1, 2, 3]
777
778 C++
779 * Enhanced customization on TestFormat printing.
780 * Added SwapFields() in reflection API to swap a subset of fields.
781 Added SetAllocatedMessage() in reflection API.
782 * Repeated primitive extensions are now packable. The
783 [packed=true] option only affects serializers. Therefore, it is
784 possible to switch a repeated extension field to packed format
785 without breaking backwards-compatibility.
786 * Various speed optimizations.
787
788 Java
789 * writeTo() method in ByteString can now write a substring to an
790 output stream. Added endWith() method for ByteString.
791 * ByteString and ByteBuffer are now supported in CodedInputStream
792 and CodedOutputStream.
793 * java_generate_equals_and_hash can now be used with the LITE_RUNTIME.
794
795 Python
796 * A new C++-backed extension module (aka "cpp api v2") that replaces the
797 old ("cpp api v1") one. Much faster than the pure Python code. This one
798 resolves many bugs and is recommended for general use over the
799 pure Python when possible.
800 * Descriptors now have enum_types_by_name and extension_types_by_name dict
801 attributes.
802 * Support for Python 3.
803
xiaofeng@google.com2c9392f2013-02-28 06:12:28 +00008042013-02-27 version 2.5.0:
xiaofeng@google.comb55a20f2012-09-22 02:40:50 +0000805
806 General
807 * New notion "import public" that allows a proto file to forward the content
808 it imports to its importers. For example,
809 // foo.proto
810 import public "bar.proto";
811 import "baz.proto";
812
813 // qux.proto
814 import "foo.proto";
815 // Stuff defined in bar.proto may be used in this file, but stuff from
816 // baz.proto may NOT be used without importing it explicitly.
817 This is useful for moving proto files. To move a proto file, just leave
818 a single "import public" in the old proto file.
819 * New enum option "allow_alias" that specifies whether different symbols can
820 be assigned the same numeric value. Default value is "true". Setting it to
821 false causes the compiler to reject enum definitions where multiple symbols
822 have the same numeric value.
xiaofeng@google.com7f4c9e82013-03-05 01:51:21 +0000823 Note: We plan to flip the default value to "false" in a future release.
824 Projects using enum aliases should set the option to "true" in their .proto
825 files.
xiaofeng@google.comb55a20f2012-09-22 02:40:50 +0000826
827 C++
828 * New generated method set_allocated_foo(Type* foo) for message and string
829 fields. This method allows you to set the field to a pre-allocated object
830 and the containing message takes the ownership of that object.
831 * Added SetAllocatedExtension() and ReleaseExtension() to extensions API.
832 * Custom options are now formatted correctly when descriptors are printed in
833 text format.
834 * Various speed optimizations.
835
836 Java
837 * Comments in proto files are now collected and put into generated code as
838 comments for corresponding classes and data members.
839 * Added Parser to parse directly into messages without a Builder. For
840 example,
xiaofeng@google.com2c9392f2013-02-28 06:12:28 +0000841 Foo foo = Foo.PARSER.ParseFrom(input);
xiaofeng@google.comb55a20f2012-09-22 02:40:50 +0000842 Using Parser is ~25% faster than using Builder to parse messages.
843 * Added getters/setters to access the underlying ByteString of a string field
844 directly.
845 * ByteString now supports more operations: substring(), prepend(), and
846 append(). The implementation of ByteString uses a binary tree structure
847 to support these operations efficiently.
848 * New method findInitializationErrors() that lists all missing required
849 fields.
850 * Various code size and speed optimizations.
851
852 Python
853 * Added support for dynamic message creation. DescriptorDatabase,
Dongjoon Hyun7b08d492016-01-11 14:52:01 -0800854 DescriptorPool, and MessageFactory work like their C++ counterparts to
xiaofeng@google.comb55a20f2012-09-22 02:40:50 +0000855 simplify Descriptor construction from *DescriptorProtos, and MessageFactory
856 provides a message instance from a Descriptor.
857 * Added pickle support for protobuf messages.
858 * Unknown fields are now preserved after parsing.
859 * Fixed bug where custom options were not correctly populated. Custom
860 options can be accessed now.
861 * Added EnumTypeWrapper that provides better accessibility to enum types.
862 * Added ParseMessage(descriptor, bytes) to generate a new Message instance
863 from a descriptor and a byte string.
864
liujisi@google.com5d996322011-04-30 15:29:09 +00008652011-05-01 version 2.4.1:
866
867 C++
Dongjoon Hyun7b08d492016-01-11 14:52:01 -0800868 * Fixed the friendship problem for old compilers to make the library now gcc 3
liujisi@google.com5d996322011-04-30 15:29:09 +0000869 compatible again.
870 * Fixed vcprojects/extract_includes.bat to extract compiler/plugin.h.
871
872 Java
873 * Removed usages of JDK 1.6 only features to make the library now JDK 1.5
874 compatible again.
875 * Fixed a bug about negative enum values.
876 * serialVersionUID is now defined in generated messages for java serializing.
877 * Fixed protoc to use java.lang.Object, which makes "Object" now a valid
878 message name again.
879
880 Python
881 * Experimental C++ implementation now requires C++ protobuf library installed.
882 See the README.txt in the python directory for details.
883
liujisi@google.com7a261472011-02-02 14:04:22 +00008842011-02-02 version 2.4.0:
liujisi@google.com33165fe2010-11-02 13:14:58 +0000885
886 General
887 * The RPC (cc|java|py)_generic_services default value is now false instead of
888 true.
889 * Custom options can have aggregate types. For example,
890 message MyOption {
891 optional string comment = 1;
892 optional string author = 2;
893 }
894 extend google.protobuf.FieldOptions {
895 optional MyOption myoption = 12345;
896 }
897 This option can now be set as follows:
898 message SomeType {
899 optional int32 field = 1 [(myoption) = { comment:'x' author:'y' }];
900 }
901
902 C++
903 * Various speed and code size optimizations.
904 * Added a release_foo() method on string and message fields.
905 * Fixed gzip_output_stream sub-stream handling.
906
907 Java
908 * Builders now maintain sub-builders for sub-messages. Use getFooBuilder() to
909 get the builder for the sub-message "foo". This allows you to repeatedly
910 modify deeply-nested sub-messages without rebuilding them.
911 * Builder.build() no longer invalidates the Builder for generated messages
912 (You may continue to modify it and then build another message).
913 * Code generator will generate efficient equals() and hashCode()
914 implementations if new option java_generate_equals_and_hash is enabled.
915 (Otherwise, reflection-based implementations are used.)
916 * Generated messages now implement Serializable.
917 * Fields with [deprecated=true] will be marked with @Deprecated in Java.
918 * Added lazy conversion of UTF-8 encoded strings to String objects to improve
919 performance.
920 * Various optimizations.
921 * Enum value can be accessed directly, instead of calling getNumber() on the
922 enum member.
923 * For each enum value, an integer constant is also generated with the suffix
924 _VALUE.
925
926 Python
927 * Added an experimental C++ implementation for Python messages via a Python
928 extension. Implementation type is controlled by an environment variable
929 PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION (valid values: "cpp" and "python")
930 The default value is currently "python" but will be changed to "cpp" in
931 future release.
932 * Improved performance on message instantiation significantly.
933 Most of the work on message instantiation is done just once per message
934 class, instead of once per message instance.
935 * Improved performance on text message parsing.
936 * Allow add() to forward keyword arguments to the concrete class.
937 E.g. instead of
938 item = repeated_field.add()
939 item.foo = bar
940 item.baz = quux
941 You can do:
942 repeated_field.add(foo=bar, baz=quux)
943 * Added a sort() interface to the BaseContainer.
944 * Added an extend() method to repeated composite fields.
945 * Added UTF8 debug string support.
946
temporald4e38c72010-01-09 07:35:50 +00009472010-01-08 version 2.3.0:
kenton@google.comfccb1462009-12-18 02:11:36 +0000948
949 General
950 * Parsers for repeated numeric fields now always accept both packed and
951 unpacked input. The [packed=true] option only affects serializers.
952 Therefore, it is possible to switch a field to packed format without
953 breaking backwards-compatibility -- as long as all parties are using
954 protobuf 2.3.0 or above, at least.
955 * The generic RPC service code generated by the C++, Java, and Python
956 generators can be disabled via file options:
957 option cc_generic_services = false;
958 option java_generic_services = false;
959 option py_generic_services = false;
960 This allows plugins to generate alternative code, possibly specific to some
961 particular RPC implementation.
962
963 protoc
964 * Now supports a plugin system for code generators. Plugins can generate
965 code for new languages or inject additional code into the output of other
966 code generators. Plugins are just binaries which accept a protocol buffer
967 on stdin and write a protocol buffer to stdout, so they may be written in
968 any language. See src/google/protobuf/compiler/plugin.proto.
kenton@google.com7f4938b2009-12-22 22:57:39 +0000969 **WARNING**: Plugins are experimental. The interface may change in a
970 future version.
kenton@google.com0225b352010-01-04 22:07:09 +0000971 * If the output location ends in .zip or .jar, protoc will write its output
972 to a zip/jar archive instead of a directory. For example:
973 protoc --java_out=myproto_srcs.jar --python_out=myproto.zip myproto.proto
974 Currently the archive contents are not compressed, though this could change
975 in the future.
kenton@google.comfccb1462009-12-18 02:11:36 +0000976 * inf, -inf, and nan can now be used as default values for float and double
977 fields.
978
979 C++
980 * Various speed and code size optimizations.
981 * DynamicMessageFactory is now fully thread-safe.
982 * Message::Utf8DebugString() method is like DebugString() but avoids escaping
983 UTF-8 bytes.
984 * Compiled-in message types can now contain dynamic extensions, through use
985 of CodedInputStream::SetExtensionRegistry().
kenton@google.comc0ee4d22009-12-22 02:05:33 +0000986 * Now compiles shared libraries (DLLs) by default on Cygwin and MinGW, to
987 match other platforms. Use --disable-shared to avoid this.
kenton@google.comfccb1462009-12-18 02:11:36 +0000988
989 Java
990 * parseDelimitedFrom() and mergeDelimitedFrom() now detect EOF and return
991 false/null instead of throwing an exception.
992 * Fixed some initialization ordering bugs.
993 * Fixes for OpenJDK 7.
994
995 Python
996 * 10-25 times faster than 2.2.0, still pure-Python.
997 * Calling a mutating method on a sub-message always instantiates the message
998 in its parent even if the mutating method doesn't actually mutate anything
999 (e.g. parsing from an empty string).
1000 * Expanded descriptors a bit.
1001
kenton@google.com201b9be2009-08-12 00:23:05 +000010022009-08-11 version 2.2.0:
kenton@google.comceb561d2009-06-25 19:05:36 +00001003
1004 C++
kenton@google.com80b1d622009-07-29 01:13:20 +00001005 * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler
1006 to generate code which only depends libprotobuf-lite, which is much smaller
1007 than libprotobuf but lacks descriptors, reflection, and some other features.
kenton@google.comceb561d2009-06-25 19:05:36 +00001008 * Fixed bug where Message.Swap(Message) was only implemented for
1009 optimize_for_speed. Swap now properly implemented in both modes
1010 (Issue 91).
1011 * Added RemoveLast and SwapElements(index1, index2) to Reflection
1012 interface for repeated elements.
1013 * Added Swap(Message) to Reflection interface.
kenton@google.comd2fd0632009-07-24 01:00:35 +00001014 * Floating-point literals in generated code that are intended to be
1015 single-precision now explicitly have 'f' suffix to avoid pedantic warnings
1016 produced by some compilers.
kenton@google.com80b1d622009-07-29 01:13:20 +00001017 * The [deprecated=true] option now causes the C++ code generator to generate
1018 a GCC-style deprecation annotation (no-op on other compilers).
1019 * google::protobuf::GetEnumDescriptor<SomeGeneratedEnumType>() returns the
1020 EnumDescriptor for that type -- useful for templates which cannot call
1021 SomeGeneratedEnumType_descriptor().
1022 * Various optimizations and obscure bug fixes.
1023
1024 Java
1025 * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler
1026 to generate code which only depends libprotobuf-lite, which is much smaller
1027 than libprotobuf but lacks descriptors, reflection, and some other features.
kenton@google.com80b1d622009-07-29 01:13:20 +00001028 * Lots of style cleanups.
1029
1030 Python
1031 * Fixed endianness bug with floats and doubles.
1032 * Text format parsing support.
1033 * Fix bug with parsing packed repeated fields in embedded messages.
1034 * Ability to initialize fields by passing keyword args to constructor.
1035 * Support iterators in extend and __setslice__ for containers.
kenton@google.comceb561d2009-06-25 19:05:36 +00001036
kenton@google.com1fb3d392009-05-13 23:20:03 +000010372009-05-13 version 2.1.0:
kenton@google.com2d6daa72009-01-22 01:27:00 +00001038
1039 General
1040 * Repeated fields of primitive types (types other that string, group, and
1041 nested messages) may now use the option [packed = true] to get a more
1042 efficient encoding. In the new encoding, the entire list is written
1043 as a single byte blob using the "length-delimited" wire type. Within
1044 this blob, the individual values are encoded the same way they would
1045 be normally except without a tag before each value (thus, they are
1046 tightly "packed").
kenton@google.comcfa2d8a2009-04-18 00:02:12 +00001047 * For each field, the generated code contains an integer constant assigned
1048 to the field number. For example, the .proto file:
1049 message Foo { optional int bar_baz = 123; }
1050 would generate the following constants, all with the integer value 123:
1051 C++: Foo::kBarBazFieldNumber
1052 Java: Foo.BAR_BAZ_FIELD_NUMBER
1053 Python: Foo.BAR_BAZ_FIELD_NUMBER
1054 Constants are also generated for extensions, with the same naming scheme.
1055 These constants may be used as switch cases.
kenton@google.com37ad00d2009-04-21 21:00:39 +00001056 * Updated bundled Google Test to version 1.3.0. Google Test is now bundled
1057 in its verbatim form as a nested autoconf package, so you can drop in any
1058 other version of Google Test if needed.
kenton@google.comd37d46d2009-04-25 02:53:47 +00001059 * optimize_for = SPEED is now the default, by popular demand. Use
1060 optimize_for = CODE_SIZE if code size is more important in your app.
1061 * It is now an error to define a default value for a repeated field.
1062 Previously, this was silently ignored (it had no effect on the generated
1063 code).
1064 * Fields can now be marked deprecated like:
1065 optional int32 foo = 1 [deprecated = true];
1066 Currently this does not have any actual effect, but in the future the code
1067 generators may generate deprecation annotations in each language.
kenton@google.com9824eda2009-05-06 17:49:37 +00001068 * Cross-compiling should now be possible using the --with-protoc option to
1069 configure. See README.txt for more info.
kenton@google.com2d6daa72009-01-22 01:27:00 +00001070
kenton@google.comf663b162009-04-15 19:50:54 +00001071 protoc
1072 * --error_format=msvs option causes errors to be printed in Visual Studio
1073 format, which should allow them to be clicked on in the build log to go
kenton@google.comd37d46d2009-04-25 02:53:47 +00001074 directly to the error location.
1075 * The type name resolver will no longer resolve type names to fields. For
1076 example, this now works:
1077 message Foo {}
1078 message Bar {
1079 optional int32 Foo = 1;
1080 optional Foo baz = 2;
1081 }
1082 Previously, the type of "baz" would resolve to "Bar.Foo", and you'd get
1083 an error because Bar.Foo is a field, not a type. Now the type of "baz"
1084 resolves to the message type Foo. This change is unlikely to make a
1085 difference to anyone who follows the Protocol Buffers style guide.
kenton@google.comf663b162009-04-15 19:50:54 +00001086
kenton@google.com2d6daa72009-01-22 01:27:00 +00001087 C++
kenton@google.comd37d46d2009-04-25 02:53:47 +00001088 * Several optimizations, including but not limited to:
1089 - Serialization, especially to flat arrays, is 10%-50% faster, possibly
1090 more for small objects.
1091 - Several descriptor operations which previously required locking no longer
1092 do.
1093 - Descriptors are now constructed lazily on first use, rather than at
1094 process startup time. This should save memory in programs which do not
1095 use descriptors or reflection.
1096 - UnknownFieldSet completely redesigned to be more efficient (especially in
1097 terms of memory usage).
1098 - Various optimizations to reduce code size (though the serialization speed
1099 optimizations increased code size).
kenton@google.com2d6daa72009-01-22 01:27:00 +00001100 * Message interface has method ParseFromBoundedZeroCopyStream() which parses
1101 a limited number of bytes from an input stream rather than parsing until
1102 EOF.
kenton@google.come59427a2009-04-16 22:30:56 +00001103 * GzipInputStream and GzipOutputStream support reading/writing gzip- or
1104 zlib-compressed streams if zlib is available.
1105 (google/protobuf/io/gzip_stream.h)
kenton@google.comd37d46d2009-04-25 02:53:47 +00001106 * DescriptorPool::FindAllExtensions() and corresponding
1107 DescriptorDatabase::FindAllExtensions() can be used to enumerate all
1108 extensions of a given type.
1109 * For each enum type Foo, protoc will generate functions:
1110 const string& Foo_Name(Foo value);
1111 bool Foo_Parse(const string& name, Foo* result);
1112 The former returns the name of the enum constant corresponding to the given
1113 value while the latter finds the value corresponding to a name.
1114 * RepeatedField and RepeatedPtrField now have back-insertion iterators.
1115 * String fields now have setters that take a char* and a size, in addition
1116 to the existing ones that took char* or const string&.
1117 * DescriptorPool::AllowUnknownDependencies() may be used to tell
1118 DescriptorPool to create placeholder descriptors for unknown entities
1119 referenced in a FileDescriptorProto. This can allow you to parse a .proto
1120 file without having access to other .proto files that it imports, for
1121 example.
1122 * Updated gtest to latest version. The gtest package is now included as a
1123 nested autoconf package, so it should be able to drop new versions into the
1124 "gtest" subdirectory without modification.
kenton@google.com2d6daa72009-01-22 01:27:00 +00001125
1126 Java
1127 * Fixed bug where Message.mergeFrom(Message) failed to merge extensions.
1128 * Message interface has new method toBuilder() which is equivalent to
1129 newBuilderForType().mergeFrom(this).
1130 * All enums now implement the ProtocolMessageEnum interface.
1131 * Setting a field to null now throws NullPointerException.
1132 * Fixed tendency for TextFormat's parsing to overflow the stack when
1133 parsing large string values. The underlying problem is with Java's
1134 regex implementation (which unfortunately uses recursive backtracking
Dongjoon Hyun7b08d492016-01-11 14:52:01 -08001135 rather than building an NFA). Worked around by making use of possessive
kenton@google.com2d6daa72009-01-22 01:27:00 +00001136 quantifiers.
kenton@google.comd37d46d2009-04-25 02:53:47 +00001137 * Generated service classes now also generate pure interfaces. For a service
1138 Foo, Foo.Interface is a pure interface containing all of the service's
1139 defined methods. Foo.newReflectiveService() can be called to wrap an
1140 instance of this interface in a class that implements the generic
1141 RpcService interface, which provides reflection support that is usually
1142 needed by RPC server implementations.
1143 * RPC interfaces now support blocking operation in addition to non-blocking.
1144 The protocol compiler generates separate blocking and non-blocking stubs
1145 which operate against separate blocking and non-blocking RPC interfaces.
1146 RPC implementations will have to implement the new interfaces in order to
1147 support blocking mode.
1148 * New I/O methods parseDelimitedFrom(), mergeDelimitedFrom(), and
Dongjoon Hyun7b08d492016-01-11 14:52:01 -08001149 writeDelimitedTo() read and write "delimited" messages from/to a stream,
kenton@google.comd37d46d2009-04-25 02:53:47 +00001150 meaning that the message size precedes the data. This way, you can write
1151 multiple messages to a stream without having to worry about delimiting
1152 them yourself.
1153 * Throw a more descriptive exception when build() is double-called.
1154 * Add a method to query whether CodedInputStream is at the end of the input
1155 stream.
1156 * Add a method to reset a CodedInputStream's size counter; useful when
1157 reading many messages with the same stream.
1158 * equals() and hashCode() now account for unknown fields.
pesho.petrov87e64e12008-12-24 01:07:22 +00001159
1160 Python
1161 * Added slicing support for repeated scalar fields. Added slice retrieval and
1162 removal of repeated composite fields.
kenton@google.com2d6daa72009-01-22 01:27:00 +00001163 * Updated RPC interfaces to allow for blocking operation. A client may
1164 now pass None for a callback when making an RPC, in which case the
1165 call will block until the response is received, and the response
1166 object will be returned directly to the caller. This interface change
1167 cannot be used in practice until RPC implementations are updated to
1168 implement it.
kenton@google.comd37d46d2009-04-25 02:53:47 +00001169 * Changes to input_stream.py should make protobuf compatible with appengine.
pesho.petrov87e64e12008-12-24 01:07:22 +00001170
kenton@google.com9f175282008-11-25 19:37:10 +000011712008-11-25 version 2.0.3:
1172
1173 protoc
1174 * Enum values may now have custom options, using syntax similar to field
1175 options.
1176 * Fixed bug where .proto files which use custom options but don't actually
1177 define them (i.e. they import another .proto file defining the options)
1178 had to explicitly import descriptor.proto.
1179 * Adjacent string literals in .proto files will now be concatenated, like in
1180 C.
kenton@google.com2f669cb2008-12-02 05:59:15 +00001181 * If an input file is a Windows absolute path (e.g. "C:\foo\bar.proto") and
1182 the import path only contains "." (or contains "." but does not contain
1183 the file), protoc incorrectly thought that the file was under ".", because
1184 it thought that the path was relative (since it didn't start with a slash).
1185 This has been fixed.
kenton@google.com9f175282008-11-25 19:37:10 +00001186
1187 C++
1188 * Generated message classes now have a Swap() method which efficiently swaps
1189 the contents of two objects.
1190 * All message classes now have a SpaceUsed() method which returns an estimate
1191 of the number of bytes of allocated memory currently owned by the object.
1192 This is particularly useful when you are reusing a single message object
1193 to improve performance but want to make sure it doesn't bloat up too large.
1194 * New method Message::SerializeAsString() returns a string containing the
1195 serialized data. May be more convenient than calling
1196 SerializeToString(string*).
1197 * In debug mode, log error messages when string-type fields are found to
1198 contain bytes that are not valid UTF-8.
1199 * Fixed bug where a message with multiple extension ranges couldn't parse
1200 extensions.
1201 * Fixed bug where MergeFrom(const Message&) didn't do anything if invoked on
1202 a message that contained no fields (but possibly contained extensions).
1203 * Fixed ShortDebugString() to not be O(n^2). Durr.
1204 * Fixed crash in TextFormat parsing if the first token in the input caused a
1205 tokenization error.
1206 * Fixed obscure bugs in zero_copy_stream_impl.cc.
1207 * Added support for HP C++ on Tru64.
1208 * Only build tests on "make check", not "make".
1209 * Fixed alignment issue that caused crashes when using DynamicMessage on
1210 64-bit Sparc machines.
1211 * Simplify template usage to work with MSVC 2003.
1212 * Work around GCC 4.3.x x86_64 compiler bug that caused crashes on startup.
1213 (This affected Fedora 9 in particular.)
kenton@google.com25bc5cd2008-12-04 20:34:50 +00001214 * Now works on "Solaris 10 using recent Sun Studio".
kenton@google.com9f175282008-11-25 19:37:10 +00001215
1216 Java
1217 * New overload of mergeFrom() which parses a slice of a byte array instead
1218 of the whole thing.
1219 * New method ByteString.asReadOnlyByteBuffer() does what it sounds like.
1220 * Improved performance of isInitialized() when optimizing for code size.
1221
1222 Python
1223 * Corrected ListFields() signature in Message base class to match what
1224 subclasses actually implement.
1225 * Some minor refactoring.
kenton@google.com2f669cb2008-12-02 05:59:15 +00001226 * Don't pass self as first argument to superclass constructor (no longer
1227 allowed in Python 2.6).
kenton@google.com9f175282008-11-25 19:37:10 +00001228
kenton@google.com9b10f582008-09-30 00:09:40 +000012292008-09-29 version 2.0.2:
1230
kenton@google.com24bf56f2008-09-24 20:31:01 +00001231 General
1232 * License changed from Apache 2.0 to New BSD.
1233 * It is now possible to define custom "options", which are basically
1234 annotations which may be placed on definitions in a .proto file.
1235 For example, you might define a field option called "foo" like so:
1236 import "google/protobuf/descriptor.proto"
1237 extend google.protobuf.FieldOptions {
1238 optional string foo = 12345;
1239 }
1240 Then you annotate a field using the "foo" option:
1241 message MyMessage {
1242 optional int32 some_field = 1 [(foo) = "bar"]
1243 }
1244 The value of this option is then visible via the message's
1245 Descriptor:
1246 const FieldDescriptor* field =
1247 MyMessage::descriptor()->FindFieldByName("some_field");
1248 assert(field->options().GetExtension(foo) == "bar");
1249 This feature has been implemented and tested in C++ and Java.
1250 Other languages may or may not need to do extra work to support
1251 custom options, depending on how they construct descriptors.
1252
1253 C++
1254 * Fixed some GCC warnings that only occur when using -pedantic.
1255 * Improved static initialization code, making ordering more
1256 predictable among other things.
1257 * TextFormat will no longer accept messages which contain multiple
1258 instances of a singular field. Previously, the latter instance
kenton@google.com9b10f582008-09-30 00:09:40 +00001259 would overwrite the former.
kenton@google.com24bf56f2008-09-24 20:31:01 +00001260 * Now works on systems that don't have hash_map.
1261
kenton@google.com9b10f582008-09-30 00:09:40 +00001262 Java
1263 * Print @Override annotation in generated code where appropriate.
1264
kenton@google.com24bf56f2008-09-24 20:31:01 +00001265 Python
1266 * Strings now use the "unicode" type rather than the "str" type.
1267 String fields may still be assigned ASCII "str" values; they will
1268 automatically be converted.
1269 * Adding a property to an object representing a repeated field now
1270 raises an exception. For example:
1271 # No longer works (and never should have).
1272 message.some_repeated_field.foo = 1
kenton@google.com9b10f582008-09-30 00:09:40 +00001273
1274 Windows
1275 * We now build static libraries rather than DLLs by default on MSVC.
1276 See vsprojects/readme.txt for more information.
1277
temporala44f3c32008-08-15 18:32:02 +000012782008-08-15 version 2.0.1:
kenton@google.com9b10f582008-09-30 00:09:40 +00001279
1280 protoc
1281 * New flags --encode and --decode can be used to convert between protobuf text
1282 format and binary format from the command-line.
1283 * New flag --descriptor_set_out can be used to write FileDescriptorProtos for
1284 all parsed files directly into a single output file. This is particularly
1285 useful if you wish to parse .proto files from programs written in languages
1286 other than C++: just run protoc as a background process and have it output
1287 a FileDescriptorList, then parse that natively.
1288 * Improved error message when an enum value's name conflicts with another
1289 symbol defined in the enum type's scope, e.g. if two enum types declared
1290 in the same scope have values with the same name. This is disallowed for
temporala44f3c32008-08-15 18:32:02 +00001291 compatibility with C++, but this wasn't clear from the error.
kenton@google.com9b10f582008-09-30 00:09:40 +00001292 * Fixed absolute output paths on Windows.
temporala44f3c32008-08-15 18:32:02 +00001293 * Allow trailing slashes in --proto_path mappings.
kenton@google.com9b10f582008-09-30 00:09:40 +00001294
1295 C++
1296 * Reflection objects are now per-class rather than per-instance. To make this
1297 possible, the Reflection interface had to be changed such that all methods
1298 take the Message instance as a parameter. This change improves performance
1299 significantly in memory-bandwidth-limited use cases, since it makes the
1300 message objects smaller. Note that source-incompatible interface changes
1301 like this will not be made again after the library leaves beta.
temporala44f3c32008-08-15 18:32:02 +00001302 * Heuristically detect sub-messages when printing unknown fields.
kenton@google.com9b10f582008-09-30 00:09:40 +00001303 * Fix static initialization ordering bug that caused crashes at startup when
temporala44f3c32008-08-15 18:32:02 +00001304 compiling on Mac with static linking.
kenton@google.com9b10f582008-09-30 00:09:40 +00001305 * Fixed TokenizerTest when compiling with -DNDEBUG on Linux.
1306 * Fixed incorrect definition of kint32min.
temporala44f3c32008-08-15 18:32:02 +00001307 * Fix bytes type setter to work with byte sequences with embedded NULLs.
1308 * Other irrelevant tweaks.
1309
kenton@google.com9b10f582008-09-30 00:09:40 +00001310 Java
1311 * Fixed UnknownFieldSet's parsing of varints larger than 32 bits.
1312 * Fixed TextFormat's parsing of "inf" and "nan".
1313 * Fixed TextFormat's parsing of comments.
1314 * Added info to Java POM that will be required when we upload the
temporala44f3c32008-08-15 18:32:02 +00001315 package to a Maven repo.
1316
kenton@google.com9b10f582008-09-30 00:09:40 +00001317 Python
1318 * MergeFrom(message) and CopyFrom(message) are now implemented.
1319 * SerializeToString() raises an exception if the message is missing required
1320 fields.
1321 * Code organization improvements.
1322 * Fixed doc comments for RpcController and RpcChannel, which had somehow been
temporala44f3c32008-08-15 18:32:02 +00001323 swapped.
kenton@google.com9b10f582008-09-30 00:09:40 +00001324 * Fixed text_format_test on Windows where floating-point exponents sometimes
1325 contain extra zeros.
temporala44f3c32008-08-15 18:32:02 +00001326 * Fix Python service CallMethod() implementation.
1327
1328 Other
1329 * Improved readmes.
1330 * VIM syntax highlighting improvements.
1331
temporal40ee5512008-07-10 02:12:20 +000013322008-07-07 version 2.0.0:
1333
1334 * First public release.