blob: 6d1932be9a00ef53ba180152d0c8552a6058dda8 [file] [log] [blame]
liujisi@google.com33165fe2010-11-02 13:14:58 +000012010-11-01 version 2.4.0:
2
3 General
4 * The RPC (cc|java|py)_generic_services default value is now false instead of
5 true.
6 * Custom options can have aggregate types. For example,
7 message MyOption {
8 optional string comment = 1;
9 optional string author = 2;
10 }
11 extend google.protobuf.FieldOptions {
12 optional MyOption myoption = 12345;
13 }
14 This option can now be set as follows:
15 message SomeType {
16 optional int32 field = 1 [(myoption) = { comment:'x' author:'y' }];
17 }
18
19 C++
20 * Various speed and code size optimizations.
21 * Added a release_foo() method on string and message fields.
22 * Fixed gzip_output_stream sub-stream handling.
23
24 Java
25 * Builders now maintain sub-builders for sub-messages. Use getFooBuilder() to
26 get the builder for the sub-message "foo". This allows you to repeatedly
27 modify deeply-nested sub-messages without rebuilding them.
28 * Builder.build() no longer invalidates the Builder for generated messages
29 (You may continue to modify it and then build another message).
30 * Code generator will generate efficient equals() and hashCode()
31 implementations if new option java_generate_equals_and_hash is enabled.
32 (Otherwise, reflection-based implementations are used.)
33 * Generated messages now implement Serializable.
34 * Fields with [deprecated=true] will be marked with @Deprecated in Java.
35 * Added lazy conversion of UTF-8 encoded strings to String objects to improve
36 performance.
37 * Various optimizations.
38 * Enum value can be accessed directly, instead of calling getNumber() on the
39 enum member.
40 * For each enum value, an integer constant is also generated with the suffix
41 _VALUE.
42
43 Python
44 * Added an experimental C++ implementation for Python messages via a Python
45 extension. Implementation type is controlled by an environment variable
46 PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION (valid values: "cpp" and "python")
47 The default value is currently "python" but will be changed to "cpp" in
48 future release.
49 * Improved performance on message instantiation significantly.
50 Most of the work on message instantiation is done just once per message
51 class, instead of once per message instance.
52 * Improved performance on text message parsing.
53 * Allow add() to forward keyword arguments to the concrete class.
54 E.g. instead of
55 item = repeated_field.add()
56 item.foo = bar
57 item.baz = quux
58 You can do:
59 repeated_field.add(foo=bar, baz=quux)
60 * Added a sort() interface to the BaseContainer.
61 * Added an extend() method to repeated composite fields.
62 * Added UTF8 debug string support.
63
temporald4e38c72010-01-09 07:35:50 +0000642010-01-08 version 2.3.0:
kenton@google.comfccb1462009-12-18 02:11:36 +000065
66 General
67 * Parsers for repeated numeric fields now always accept both packed and
68 unpacked input. The [packed=true] option only affects serializers.
69 Therefore, it is possible to switch a field to packed format without
70 breaking backwards-compatibility -- as long as all parties are using
71 protobuf 2.3.0 or above, at least.
72 * The generic RPC service code generated by the C++, Java, and Python
73 generators can be disabled via file options:
74 option cc_generic_services = false;
75 option java_generic_services = false;
76 option py_generic_services = false;
77 This allows plugins to generate alternative code, possibly specific to some
78 particular RPC implementation.
79
80 protoc
81 * Now supports a plugin system for code generators. Plugins can generate
82 code for new languages or inject additional code into the output of other
83 code generators. Plugins are just binaries which accept a protocol buffer
84 on stdin and write a protocol buffer to stdout, so they may be written in
85 any language. See src/google/protobuf/compiler/plugin.proto.
kenton@google.com7f4938b2009-12-22 22:57:39 +000086 **WARNING**: Plugins are experimental. The interface may change in a
87 future version.
kenton@google.com0225b352010-01-04 22:07:09 +000088 * If the output location ends in .zip or .jar, protoc will write its output
89 to a zip/jar archive instead of a directory. For example:
90 protoc --java_out=myproto_srcs.jar --python_out=myproto.zip myproto.proto
91 Currently the archive contents are not compressed, though this could change
92 in the future.
kenton@google.comfccb1462009-12-18 02:11:36 +000093 * inf, -inf, and nan can now be used as default values for float and double
94 fields.
95
96 C++
97 * Various speed and code size optimizations.
98 * DynamicMessageFactory is now fully thread-safe.
99 * Message::Utf8DebugString() method is like DebugString() but avoids escaping
100 UTF-8 bytes.
101 * Compiled-in message types can now contain dynamic extensions, through use
102 of CodedInputStream::SetExtensionRegistry().
kenton@google.comc0ee4d22009-12-22 02:05:33 +0000103 * Now compiles shared libraries (DLLs) by default on Cygwin and MinGW, to
104 match other platforms. Use --disable-shared to avoid this.
kenton@google.comfccb1462009-12-18 02:11:36 +0000105
106 Java
107 * parseDelimitedFrom() and mergeDelimitedFrom() now detect EOF and return
108 false/null instead of throwing an exception.
109 * Fixed some initialization ordering bugs.
110 * Fixes for OpenJDK 7.
111
112 Python
113 * 10-25 times faster than 2.2.0, still pure-Python.
114 * Calling a mutating method on a sub-message always instantiates the message
115 in its parent even if the mutating method doesn't actually mutate anything
116 (e.g. parsing from an empty string).
117 * Expanded descriptors a bit.
118
kenton@google.com201b9be2009-08-12 00:23:05 +00001192009-08-11 version 2.2.0:
kenton@google.comceb561d2009-06-25 19:05:36 +0000120
121 C++
kenton@google.com80b1d622009-07-29 01:13:20 +0000122 * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler
123 to generate code which only depends libprotobuf-lite, which is much smaller
124 than libprotobuf but lacks descriptors, reflection, and some other features.
kenton@google.comceb561d2009-06-25 19:05:36 +0000125 * Fixed bug where Message.Swap(Message) was only implemented for
126 optimize_for_speed. Swap now properly implemented in both modes
127 (Issue 91).
128 * Added RemoveLast and SwapElements(index1, index2) to Reflection
129 interface for repeated elements.
130 * Added Swap(Message) to Reflection interface.
kenton@google.comd2fd0632009-07-24 01:00:35 +0000131 * Floating-point literals in generated code that are intended to be
132 single-precision now explicitly have 'f' suffix to avoid pedantic warnings
133 produced by some compilers.
kenton@google.com80b1d622009-07-29 01:13:20 +0000134 * The [deprecated=true] option now causes the C++ code generator to generate
135 a GCC-style deprecation annotation (no-op on other compilers).
136 * google::protobuf::GetEnumDescriptor<SomeGeneratedEnumType>() returns the
137 EnumDescriptor for that type -- useful for templates which cannot call
138 SomeGeneratedEnumType_descriptor().
139 * Various optimizations and obscure bug fixes.
140
141 Java
142 * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler
143 to generate code which only depends libprotobuf-lite, which is much smaller
144 than libprotobuf but lacks descriptors, reflection, and some other features.
kenton@google.com80b1d622009-07-29 01:13:20 +0000145 * Lots of style cleanups.
146
147 Python
148 * Fixed endianness bug with floats and doubles.
149 * Text format parsing support.
150 * Fix bug with parsing packed repeated fields in embedded messages.
151 * Ability to initialize fields by passing keyword args to constructor.
152 * Support iterators in extend and __setslice__ for containers.
kenton@google.comceb561d2009-06-25 19:05:36 +0000153
kenton@google.com1fb3d392009-05-13 23:20:03 +00001542009-05-13 version 2.1.0:
kenton@google.com2d6daa72009-01-22 01:27:00 +0000155
156 General
157 * Repeated fields of primitive types (types other that string, group, and
158 nested messages) may now use the option [packed = true] to get a more
159 efficient encoding. In the new encoding, the entire list is written
160 as a single byte blob using the "length-delimited" wire type. Within
161 this blob, the individual values are encoded the same way they would
162 be normally except without a tag before each value (thus, they are
163 tightly "packed").
kenton@google.comcfa2d8a2009-04-18 00:02:12 +0000164 * For each field, the generated code contains an integer constant assigned
165 to the field number. For example, the .proto file:
166 message Foo { optional int bar_baz = 123; }
167 would generate the following constants, all with the integer value 123:
168 C++: Foo::kBarBazFieldNumber
169 Java: Foo.BAR_BAZ_FIELD_NUMBER
170 Python: Foo.BAR_BAZ_FIELD_NUMBER
171 Constants are also generated for extensions, with the same naming scheme.
172 These constants may be used as switch cases.
kenton@google.com37ad00d2009-04-21 21:00:39 +0000173 * Updated bundled Google Test to version 1.3.0. Google Test is now bundled
174 in its verbatim form as a nested autoconf package, so you can drop in any
175 other version of Google Test if needed.
kenton@google.comd37d46d2009-04-25 02:53:47 +0000176 * optimize_for = SPEED is now the default, by popular demand. Use
177 optimize_for = CODE_SIZE if code size is more important in your app.
178 * It is now an error to define a default value for a repeated field.
179 Previously, this was silently ignored (it had no effect on the generated
180 code).
181 * Fields can now be marked deprecated like:
182 optional int32 foo = 1 [deprecated = true];
183 Currently this does not have any actual effect, but in the future the code
184 generators may generate deprecation annotations in each language.
kenton@google.com9824eda2009-05-06 17:49:37 +0000185 * Cross-compiling should now be possible using the --with-protoc option to
186 configure. See README.txt for more info.
kenton@google.com2d6daa72009-01-22 01:27:00 +0000187
kenton@google.comf663b162009-04-15 19:50:54 +0000188 protoc
189 * --error_format=msvs option causes errors to be printed in Visual Studio
190 format, which should allow them to be clicked on in the build log to go
kenton@google.comd37d46d2009-04-25 02:53:47 +0000191 directly to the error location.
192 * The type name resolver will no longer resolve type names to fields. For
193 example, this now works:
194 message Foo {}
195 message Bar {
196 optional int32 Foo = 1;
197 optional Foo baz = 2;
198 }
199 Previously, the type of "baz" would resolve to "Bar.Foo", and you'd get
200 an error because Bar.Foo is a field, not a type. Now the type of "baz"
201 resolves to the message type Foo. This change is unlikely to make a
202 difference to anyone who follows the Protocol Buffers style guide.
kenton@google.comf663b162009-04-15 19:50:54 +0000203
kenton@google.com2d6daa72009-01-22 01:27:00 +0000204 C++
kenton@google.comd37d46d2009-04-25 02:53:47 +0000205 * Several optimizations, including but not limited to:
206 - Serialization, especially to flat arrays, is 10%-50% faster, possibly
207 more for small objects.
208 - Several descriptor operations which previously required locking no longer
209 do.
210 - Descriptors are now constructed lazily on first use, rather than at
211 process startup time. This should save memory in programs which do not
212 use descriptors or reflection.
213 - UnknownFieldSet completely redesigned to be more efficient (especially in
214 terms of memory usage).
215 - Various optimizations to reduce code size (though the serialization speed
216 optimizations increased code size).
kenton@google.com2d6daa72009-01-22 01:27:00 +0000217 * Message interface has method ParseFromBoundedZeroCopyStream() which parses
218 a limited number of bytes from an input stream rather than parsing until
219 EOF.
kenton@google.come59427a2009-04-16 22:30:56 +0000220 * GzipInputStream and GzipOutputStream support reading/writing gzip- or
221 zlib-compressed streams if zlib is available.
222 (google/protobuf/io/gzip_stream.h)
kenton@google.comd37d46d2009-04-25 02:53:47 +0000223 * DescriptorPool::FindAllExtensions() and corresponding
224 DescriptorDatabase::FindAllExtensions() can be used to enumerate all
225 extensions of a given type.
226 * For each enum type Foo, protoc will generate functions:
227 const string& Foo_Name(Foo value);
228 bool Foo_Parse(const string& name, Foo* result);
229 The former returns the name of the enum constant corresponding to the given
230 value while the latter finds the value corresponding to a name.
231 * RepeatedField and RepeatedPtrField now have back-insertion iterators.
232 * String fields now have setters that take a char* and a size, in addition
233 to the existing ones that took char* or const string&.
234 * DescriptorPool::AllowUnknownDependencies() may be used to tell
235 DescriptorPool to create placeholder descriptors for unknown entities
236 referenced in a FileDescriptorProto. This can allow you to parse a .proto
237 file without having access to other .proto files that it imports, for
238 example.
239 * Updated gtest to latest version. The gtest package is now included as a
240 nested autoconf package, so it should be able to drop new versions into the
241 "gtest" subdirectory without modification.
kenton@google.com2d6daa72009-01-22 01:27:00 +0000242
243 Java
244 * Fixed bug where Message.mergeFrom(Message) failed to merge extensions.
245 * Message interface has new method toBuilder() which is equivalent to
246 newBuilderForType().mergeFrom(this).
247 * All enums now implement the ProtocolMessageEnum interface.
248 * Setting a field to null now throws NullPointerException.
249 * Fixed tendency for TextFormat's parsing to overflow the stack when
250 parsing large string values. The underlying problem is with Java's
251 regex implementation (which unfortunately uses recursive backtracking
252 rather than building an NFA). Worked around by making use of possesive
253 quantifiers.
kenton@google.comd37d46d2009-04-25 02:53:47 +0000254 * Generated service classes now also generate pure interfaces. For a service
255 Foo, Foo.Interface is a pure interface containing all of the service's
256 defined methods. Foo.newReflectiveService() can be called to wrap an
257 instance of this interface in a class that implements the generic
258 RpcService interface, which provides reflection support that is usually
259 needed by RPC server implementations.
260 * RPC interfaces now support blocking operation in addition to non-blocking.
261 The protocol compiler generates separate blocking and non-blocking stubs
262 which operate against separate blocking and non-blocking RPC interfaces.
263 RPC implementations will have to implement the new interfaces in order to
264 support blocking mode.
265 * New I/O methods parseDelimitedFrom(), mergeDelimitedFrom(), and
266 writeDelimitedTo() read and write "delemited" messages from/to a stream,
267 meaning that the message size precedes the data. This way, you can write
268 multiple messages to a stream without having to worry about delimiting
269 them yourself.
270 * Throw a more descriptive exception when build() is double-called.
271 * Add a method to query whether CodedInputStream is at the end of the input
272 stream.
273 * Add a method to reset a CodedInputStream's size counter; useful when
274 reading many messages with the same stream.
275 * equals() and hashCode() now account for unknown fields.
pesho.petrov87e64e12008-12-24 01:07:22 +0000276
277 Python
278 * Added slicing support for repeated scalar fields. Added slice retrieval and
279 removal of repeated composite fields.
kenton@google.com2d6daa72009-01-22 01:27:00 +0000280 * Updated RPC interfaces to allow for blocking operation. A client may
281 now pass None for a callback when making an RPC, in which case the
282 call will block until the response is received, and the response
283 object will be returned directly to the caller. This interface change
284 cannot be used in practice until RPC implementations are updated to
285 implement it.
kenton@google.comd37d46d2009-04-25 02:53:47 +0000286 * Changes to input_stream.py should make protobuf compatible with appengine.
pesho.petrov87e64e12008-12-24 01:07:22 +0000287
kenton@google.com9f175282008-11-25 19:37:10 +00002882008-11-25 version 2.0.3:
289
290 protoc
291 * Enum values may now have custom options, using syntax similar to field
292 options.
293 * Fixed bug where .proto files which use custom options but don't actually
294 define them (i.e. they import another .proto file defining the options)
295 had to explicitly import descriptor.proto.
296 * Adjacent string literals in .proto files will now be concatenated, like in
297 C.
kenton@google.com2f669cb2008-12-02 05:59:15 +0000298 * If an input file is a Windows absolute path (e.g. "C:\foo\bar.proto") and
299 the import path only contains "." (or contains "." but does not contain
300 the file), protoc incorrectly thought that the file was under ".", because
301 it thought that the path was relative (since it didn't start with a slash).
302 This has been fixed.
kenton@google.com9f175282008-11-25 19:37:10 +0000303
304 C++
305 * Generated message classes now have a Swap() method which efficiently swaps
306 the contents of two objects.
307 * All message classes now have a SpaceUsed() method which returns an estimate
308 of the number of bytes of allocated memory currently owned by the object.
309 This is particularly useful when you are reusing a single message object
310 to improve performance but want to make sure it doesn't bloat up too large.
311 * New method Message::SerializeAsString() returns a string containing the
312 serialized data. May be more convenient than calling
313 SerializeToString(string*).
314 * In debug mode, log error messages when string-type fields are found to
315 contain bytes that are not valid UTF-8.
316 * Fixed bug where a message with multiple extension ranges couldn't parse
317 extensions.
318 * Fixed bug where MergeFrom(const Message&) didn't do anything if invoked on
319 a message that contained no fields (but possibly contained extensions).
320 * Fixed ShortDebugString() to not be O(n^2). Durr.
321 * Fixed crash in TextFormat parsing if the first token in the input caused a
322 tokenization error.
323 * Fixed obscure bugs in zero_copy_stream_impl.cc.
324 * Added support for HP C++ on Tru64.
325 * Only build tests on "make check", not "make".
326 * Fixed alignment issue that caused crashes when using DynamicMessage on
327 64-bit Sparc machines.
328 * Simplify template usage to work with MSVC 2003.
329 * Work around GCC 4.3.x x86_64 compiler bug that caused crashes on startup.
330 (This affected Fedora 9 in particular.)
kenton@google.com25bc5cd2008-12-04 20:34:50 +0000331 * Now works on "Solaris 10 using recent Sun Studio".
kenton@google.com9f175282008-11-25 19:37:10 +0000332
333 Java
334 * New overload of mergeFrom() which parses a slice of a byte array instead
335 of the whole thing.
336 * New method ByteString.asReadOnlyByteBuffer() does what it sounds like.
337 * Improved performance of isInitialized() when optimizing for code size.
338
339 Python
340 * Corrected ListFields() signature in Message base class to match what
341 subclasses actually implement.
342 * Some minor refactoring.
kenton@google.com2f669cb2008-12-02 05:59:15 +0000343 * Don't pass self as first argument to superclass constructor (no longer
344 allowed in Python 2.6).
kenton@google.com9f175282008-11-25 19:37:10 +0000345
kenton@google.com9b10f582008-09-30 00:09:40 +00003462008-09-29 version 2.0.2:
347
kenton@google.com24bf56f2008-09-24 20:31:01 +0000348 General
349 * License changed from Apache 2.0 to New BSD.
350 * It is now possible to define custom "options", which are basically
351 annotations which may be placed on definitions in a .proto file.
352 For example, you might define a field option called "foo" like so:
353 import "google/protobuf/descriptor.proto"
354 extend google.protobuf.FieldOptions {
355 optional string foo = 12345;
356 }
357 Then you annotate a field using the "foo" option:
358 message MyMessage {
359 optional int32 some_field = 1 [(foo) = "bar"]
360 }
361 The value of this option is then visible via the message's
362 Descriptor:
363 const FieldDescriptor* field =
364 MyMessage::descriptor()->FindFieldByName("some_field");
365 assert(field->options().GetExtension(foo) == "bar");
366 This feature has been implemented and tested in C++ and Java.
367 Other languages may or may not need to do extra work to support
368 custom options, depending on how they construct descriptors.
369
370 C++
371 * Fixed some GCC warnings that only occur when using -pedantic.
372 * Improved static initialization code, making ordering more
373 predictable among other things.
374 * TextFormat will no longer accept messages which contain multiple
375 instances of a singular field. Previously, the latter instance
kenton@google.com9b10f582008-09-30 00:09:40 +0000376 would overwrite the former.
kenton@google.com24bf56f2008-09-24 20:31:01 +0000377 * Now works on systems that don't have hash_map.
378
kenton@google.com9b10f582008-09-30 00:09:40 +0000379 Java
380 * Print @Override annotation in generated code where appropriate.
381
kenton@google.com24bf56f2008-09-24 20:31:01 +0000382 Python
383 * Strings now use the "unicode" type rather than the "str" type.
384 String fields may still be assigned ASCII "str" values; they will
385 automatically be converted.
386 * Adding a property to an object representing a repeated field now
387 raises an exception. For example:
388 # No longer works (and never should have).
389 message.some_repeated_field.foo = 1
kenton@google.com9b10f582008-09-30 00:09:40 +0000390
391 Windows
392 * We now build static libraries rather than DLLs by default on MSVC.
393 See vsprojects/readme.txt for more information.
394
temporala44f3c32008-08-15 18:32:02 +00003952008-08-15 version 2.0.1:
kenton@google.com9b10f582008-09-30 00:09:40 +0000396
397 protoc
398 * New flags --encode and --decode can be used to convert between protobuf text
399 format and binary format from the command-line.
400 * New flag --descriptor_set_out can be used to write FileDescriptorProtos for
401 all parsed files directly into a single output file. This is particularly
402 useful if you wish to parse .proto files from programs written in languages
403 other than C++: just run protoc as a background process and have it output
404 a FileDescriptorList, then parse that natively.
405 * Improved error message when an enum value's name conflicts with another
406 symbol defined in the enum type's scope, e.g. if two enum types declared
407 in the same scope have values with the same name. This is disallowed for
temporala44f3c32008-08-15 18:32:02 +0000408 compatibility with C++, but this wasn't clear from the error.
kenton@google.com9b10f582008-09-30 00:09:40 +0000409 * Fixed absolute output paths on Windows.
temporala44f3c32008-08-15 18:32:02 +0000410 * Allow trailing slashes in --proto_path mappings.
kenton@google.com9b10f582008-09-30 00:09:40 +0000411
412 C++
413 * Reflection objects are now per-class rather than per-instance. To make this
414 possible, the Reflection interface had to be changed such that all methods
415 take the Message instance as a parameter. This change improves performance
416 significantly in memory-bandwidth-limited use cases, since it makes the
417 message objects smaller. Note that source-incompatible interface changes
418 like this will not be made again after the library leaves beta.
temporala44f3c32008-08-15 18:32:02 +0000419 * Heuristically detect sub-messages when printing unknown fields.
kenton@google.com9b10f582008-09-30 00:09:40 +0000420 * Fix static initialization ordering bug that caused crashes at startup when
temporala44f3c32008-08-15 18:32:02 +0000421 compiling on Mac with static linking.
kenton@google.com9b10f582008-09-30 00:09:40 +0000422 * Fixed TokenizerTest when compiling with -DNDEBUG on Linux.
423 * Fixed incorrect definition of kint32min.
temporala44f3c32008-08-15 18:32:02 +0000424 * Fix bytes type setter to work with byte sequences with embedded NULLs.
425 * Other irrelevant tweaks.
426
kenton@google.com9b10f582008-09-30 00:09:40 +0000427 Java
428 * Fixed UnknownFieldSet's parsing of varints larger than 32 bits.
429 * Fixed TextFormat's parsing of "inf" and "nan".
430 * Fixed TextFormat's parsing of comments.
431 * Added info to Java POM that will be required when we upload the
temporala44f3c32008-08-15 18:32:02 +0000432 package to a Maven repo.
433
kenton@google.com9b10f582008-09-30 00:09:40 +0000434 Python
435 * MergeFrom(message) and CopyFrom(message) are now implemented.
436 * SerializeToString() raises an exception if the message is missing required
437 fields.
438 * Code organization improvements.
439 * Fixed doc comments for RpcController and RpcChannel, which had somehow been
temporala44f3c32008-08-15 18:32:02 +0000440 swapped.
kenton@google.com9b10f582008-09-30 00:09:40 +0000441 * Fixed text_format_test on Windows where floating-point exponents sometimes
442 contain extra zeros.
temporala44f3c32008-08-15 18:32:02 +0000443 * Fix Python service CallMethod() implementation.
444
445 Other
446 * Improved readmes.
447 * VIM syntax highlighting improvements.
448
temporal40ee5512008-07-10 02:12:20 +00004492008-07-07 version 2.0.0:
450
451 * First public release.