blob: 02ce55cd49ba12b21770d6f7a3190b6e92923c69 [file] [log] [blame]
kenton@google.comfccb1462009-12-18 02:11:36 +000012009-12-17 version 2.3.0:
2
3 General
4 * Parsers for repeated numeric fields now always accept both packed and
5 unpacked input. The [packed=true] option only affects serializers.
6 Therefore, it is possible to switch a field to packed format without
7 breaking backwards-compatibility -- as long as all parties are using
8 protobuf 2.3.0 or above, at least.
9 * The generic RPC service code generated by the C++, Java, and Python
10 generators can be disabled via file options:
11 option cc_generic_services = false;
12 option java_generic_services = false;
13 option py_generic_services = false;
14 This allows plugins to generate alternative code, possibly specific to some
15 particular RPC implementation.
16
17 protoc
18 * Now supports a plugin system for code generators. Plugins can generate
19 code for new languages or inject additional code into the output of other
20 code generators. Plugins are just binaries which accept a protocol buffer
21 on stdin and write a protocol buffer to stdout, so they may be written in
22 any language. See src/google/protobuf/compiler/plugin.proto.
23 * inf, -inf, and nan can now be used as default values for float and double
24 fields.
25
26 C++
27 * Various speed and code size optimizations.
28 * DynamicMessageFactory is now fully thread-safe.
29 * Message::Utf8DebugString() method is like DebugString() but avoids escaping
30 UTF-8 bytes.
31 * Compiled-in message types can now contain dynamic extensions, through use
32 of CodedInputStream::SetExtensionRegistry().
33
34 Java
35 * parseDelimitedFrom() and mergeDelimitedFrom() now detect EOF and return
36 false/null instead of throwing an exception.
37 * Fixed some initialization ordering bugs.
38 * Fixes for OpenJDK 7.
39
40 Python
41 * 10-25 times faster than 2.2.0, still pure-Python.
42 * Calling a mutating method on a sub-message always instantiates the message
43 in its parent even if the mutating method doesn't actually mutate anything
44 (e.g. parsing from an empty string).
45 * Expanded descriptors a bit.
46
kenton@google.com201b9be2009-08-12 00:23:05 +0000472009-08-11 version 2.2.0:
kenton@google.comceb561d2009-06-25 19:05:36 +000048
49 C++
kenton@google.com80b1d622009-07-29 01:13:20 +000050 * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler
51 to generate code which only depends libprotobuf-lite, which is much smaller
52 than libprotobuf but lacks descriptors, reflection, and some other features.
kenton@google.comceb561d2009-06-25 19:05:36 +000053 * Fixed bug where Message.Swap(Message) was only implemented for
54 optimize_for_speed. Swap now properly implemented in both modes
55 (Issue 91).
56 * Added RemoveLast and SwapElements(index1, index2) to Reflection
57 interface for repeated elements.
58 * Added Swap(Message) to Reflection interface.
kenton@google.comd2fd0632009-07-24 01:00:35 +000059 * Floating-point literals in generated code that are intended to be
60 single-precision now explicitly have 'f' suffix to avoid pedantic warnings
61 produced by some compilers.
kenton@google.com80b1d622009-07-29 01:13:20 +000062 * The [deprecated=true] option now causes the C++ code generator to generate
63 a GCC-style deprecation annotation (no-op on other compilers).
64 * google::protobuf::GetEnumDescriptor<SomeGeneratedEnumType>() returns the
65 EnumDescriptor for that type -- useful for templates which cannot call
66 SomeGeneratedEnumType_descriptor().
67 * Various optimizations and obscure bug fixes.
68
69 Java
70 * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler
71 to generate code which only depends libprotobuf-lite, which is much smaller
72 than libprotobuf but lacks descriptors, reflection, and some other features.
kenton@google.com80b1d622009-07-29 01:13:20 +000073 * Lots of style cleanups.
74
75 Python
76 * Fixed endianness bug with floats and doubles.
77 * Text format parsing support.
78 * Fix bug with parsing packed repeated fields in embedded messages.
79 * Ability to initialize fields by passing keyword args to constructor.
80 * Support iterators in extend and __setslice__ for containers.
kenton@google.comceb561d2009-06-25 19:05:36 +000081
kenton@google.com1fb3d392009-05-13 23:20:03 +0000822009-05-13 version 2.1.0:
kenton@google.com2d6daa72009-01-22 01:27:00 +000083
84 General
85 * Repeated fields of primitive types (types other that string, group, and
86 nested messages) may now use the option [packed = true] to get a more
87 efficient encoding. In the new encoding, the entire list is written
88 as a single byte blob using the "length-delimited" wire type. Within
89 this blob, the individual values are encoded the same way they would
90 be normally except without a tag before each value (thus, they are
91 tightly "packed").
kenton@google.comcfa2d8a2009-04-18 00:02:12 +000092 * For each field, the generated code contains an integer constant assigned
93 to the field number. For example, the .proto file:
94 message Foo { optional int bar_baz = 123; }
95 would generate the following constants, all with the integer value 123:
96 C++: Foo::kBarBazFieldNumber
97 Java: Foo.BAR_BAZ_FIELD_NUMBER
98 Python: Foo.BAR_BAZ_FIELD_NUMBER
99 Constants are also generated for extensions, with the same naming scheme.
100 These constants may be used as switch cases.
kenton@google.com37ad00d2009-04-21 21:00:39 +0000101 * Updated bundled Google Test to version 1.3.0. Google Test is now bundled
102 in its verbatim form as a nested autoconf package, so you can drop in any
103 other version of Google Test if needed.
kenton@google.comd37d46d2009-04-25 02:53:47 +0000104 * optimize_for = SPEED is now the default, by popular demand. Use
105 optimize_for = CODE_SIZE if code size is more important in your app.
106 * It is now an error to define a default value for a repeated field.
107 Previously, this was silently ignored (it had no effect on the generated
108 code).
109 * Fields can now be marked deprecated like:
110 optional int32 foo = 1 [deprecated = true];
111 Currently this does not have any actual effect, but in the future the code
112 generators may generate deprecation annotations in each language.
kenton@google.com9824eda2009-05-06 17:49:37 +0000113 * Cross-compiling should now be possible using the --with-protoc option to
114 configure. See README.txt for more info.
kenton@google.com2d6daa72009-01-22 01:27:00 +0000115
kenton@google.comf663b162009-04-15 19:50:54 +0000116 protoc
117 * --error_format=msvs option causes errors to be printed in Visual Studio
118 format, which should allow them to be clicked on in the build log to go
kenton@google.comd37d46d2009-04-25 02:53:47 +0000119 directly to the error location.
120 * The type name resolver will no longer resolve type names to fields. For
121 example, this now works:
122 message Foo {}
123 message Bar {
124 optional int32 Foo = 1;
125 optional Foo baz = 2;
126 }
127 Previously, the type of "baz" would resolve to "Bar.Foo", and you'd get
128 an error because Bar.Foo is a field, not a type. Now the type of "baz"
129 resolves to the message type Foo. This change is unlikely to make a
130 difference to anyone who follows the Protocol Buffers style guide.
kenton@google.comf663b162009-04-15 19:50:54 +0000131
kenton@google.com2d6daa72009-01-22 01:27:00 +0000132 C++
kenton@google.comd37d46d2009-04-25 02:53:47 +0000133 * Several optimizations, including but not limited to:
134 - Serialization, especially to flat arrays, is 10%-50% faster, possibly
135 more for small objects.
136 - Several descriptor operations which previously required locking no longer
137 do.
138 - Descriptors are now constructed lazily on first use, rather than at
139 process startup time. This should save memory in programs which do not
140 use descriptors or reflection.
141 - UnknownFieldSet completely redesigned to be more efficient (especially in
142 terms of memory usage).
143 - Various optimizations to reduce code size (though the serialization speed
144 optimizations increased code size).
kenton@google.com2d6daa72009-01-22 01:27:00 +0000145 * Message interface has method ParseFromBoundedZeroCopyStream() which parses
146 a limited number of bytes from an input stream rather than parsing until
147 EOF.
kenton@google.come59427a2009-04-16 22:30:56 +0000148 * GzipInputStream and GzipOutputStream support reading/writing gzip- or
149 zlib-compressed streams if zlib is available.
150 (google/protobuf/io/gzip_stream.h)
kenton@google.comd37d46d2009-04-25 02:53:47 +0000151 * DescriptorPool::FindAllExtensions() and corresponding
152 DescriptorDatabase::FindAllExtensions() can be used to enumerate all
153 extensions of a given type.
154 * For each enum type Foo, protoc will generate functions:
155 const string& Foo_Name(Foo value);
156 bool Foo_Parse(const string& name, Foo* result);
157 The former returns the name of the enum constant corresponding to the given
158 value while the latter finds the value corresponding to a name.
159 * RepeatedField and RepeatedPtrField now have back-insertion iterators.
160 * String fields now have setters that take a char* and a size, in addition
161 to the existing ones that took char* or const string&.
162 * DescriptorPool::AllowUnknownDependencies() may be used to tell
163 DescriptorPool to create placeholder descriptors for unknown entities
164 referenced in a FileDescriptorProto. This can allow you to parse a .proto
165 file without having access to other .proto files that it imports, for
166 example.
167 * Updated gtest to latest version. The gtest package is now included as a
168 nested autoconf package, so it should be able to drop new versions into the
169 "gtest" subdirectory without modification.
kenton@google.com2d6daa72009-01-22 01:27:00 +0000170
171 Java
172 * Fixed bug where Message.mergeFrom(Message) failed to merge extensions.
173 * Message interface has new method toBuilder() which is equivalent to
174 newBuilderForType().mergeFrom(this).
175 * All enums now implement the ProtocolMessageEnum interface.
176 * Setting a field to null now throws NullPointerException.
177 * Fixed tendency for TextFormat's parsing to overflow the stack when
178 parsing large string values. The underlying problem is with Java's
179 regex implementation (which unfortunately uses recursive backtracking
180 rather than building an NFA). Worked around by making use of possesive
181 quantifiers.
kenton@google.comd37d46d2009-04-25 02:53:47 +0000182 * Generated service classes now also generate pure interfaces. For a service
183 Foo, Foo.Interface is a pure interface containing all of the service's
184 defined methods. Foo.newReflectiveService() can be called to wrap an
185 instance of this interface in a class that implements the generic
186 RpcService interface, which provides reflection support that is usually
187 needed by RPC server implementations.
188 * RPC interfaces now support blocking operation in addition to non-blocking.
189 The protocol compiler generates separate blocking and non-blocking stubs
190 which operate against separate blocking and non-blocking RPC interfaces.
191 RPC implementations will have to implement the new interfaces in order to
192 support blocking mode.
193 * New I/O methods parseDelimitedFrom(), mergeDelimitedFrom(), and
194 writeDelimitedTo() read and write "delemited" messages from/to a stream,
195 meaning that the message size precedes the data. This way, you can write
196 multiple messages to a stream without having to worry about delimiting
197 them yourself.
198 * Throw a more descriptive exception when build() is double-called.
199 * Add a method to query whether CodedInputStream is at the end of the input
200 stream.
201 * Add a method to reset a CodedInputStream's size counter; useful when
202 reading many messages with the same stream.
203 * equals() and hashCode() now account for unknown fields.
pesho.petrov87e64e12008-12-24 01:07:22 +0000204
205 Python
206 * Added slicing support for repeated scalar fields. Added slice retrieval and
207 removal of repeated composite fields.
kenton@google.com2d6daa72009-01-22 01:27:00 +0000208 * Updated RPC interfaces to allow for blocking operation. A client may
209 now pass None for a callback when making an RPC, in which case the
210 call will block until the response is received, and the response
211 object will be returned directly to the caller. This interface change
212 cannot be used in practice until RPC implementations are updated to
213 implement it.
kenton@google.comd37d46d2009-04-25 02:53:47 +0000214 * Changes to input_stream.py should make protobuf compatible with appengine.
pesho.petrov87e64e12008-12-24 01:07:22 +0000215
kenton@google.com9f175282008-11-25 19:37:10 +00002162008-11-25 version 2.0.3:
217
218 protoc
219 * Enum values may now have custom options, using syntax similar to field
220 options.
221 * Fixed bug where .proto files which use custom options but don't actually
222 define them (i.e. they import another .proto file defining the options)
223 had to explicitly import descriptor.proto.
224 * Adjacent string literals in .proto files will now be concatenated, like in
225 C.
kenton@google.com2f669cb2008-12-02 05:59:15 +0000226 * If an input file is a Windows absolute path (e.g. "C:\foo\bar.proto") and
227 the import path only contains "." (or contains "." but does not contain
228 the file), protoc incorrectly thought that the file was under ".", because
229 it thought that the path was relative (since it didn't start with a slash).
230 This has been fixed.
kenton@google.com9f175282008-11-25 19:37:10 +0000231
232 C++
233 * Generated message classes now have a Swap() method which efficiently swaps
234 the contents of two objects.
235 * All message classes now have a SpaceUsed() method which returns an estimate
236 of the number of bytes of allocated memory currently owned by the object.
237 This is particularly useful when you are reusing a single message object
238 to improve performance but want to make sure it doesn't bloat up too large.
239 * New method Message::SerializeAsString() returns a string containing the
240 serialized data. May be more convenient than calling
241 SerializeToString(string*).
242 * In debug mode, log error messages when string-type fields are found to
243 contain bytes that are not valid UTF-8.
244 * Fixed bug where a message with multiple extension ranges couldn't parse
245 extensions.
246 * Fixed bug where MergeFrom(const Message&) didn't do anything if invoked on
247 a message that contained no fields (but possibly contained extensions).
248 * Fixed ShortDebugString() to not be O(n^2). Durr.
249 * Fixed crash in TextFormat parsing if the first token in the input caused a
250 tokenization error.
251 * Fixed obscure bugs in zero_copy_stream_impl.cc.
252 * Added support for HP C++ on Tru64.
253 * Only build tests on "make check", not "make".
254 * Fixed alignment issue that caused crashes when using DynamicMessage on
255 64-bit Sparc machines.
256 * Simplify template usage to work with MSVC 2003.
257 * Work around GCC 4.3.x x86_64 compiler bug that caused crashes on startup.
258 (This affected Fedora 9 in particular.)
kenton@google.com25bc5cd2008-12-04 20:34:50 +0000259 * Now works on "Solaris 10 using recent Sun Studio".
kenton@google.com9f175282008-11-25 19:37:10 +0000260
261 Java
262 * New overload of mergeFrom() which parses a slice of a byte array instead
263 of the whole thing.
264 * New method ByteString.asReadOnlyByteBuffer() does what it sounds like.
265 * Improved performance of isInitialized() when optimizing for code size.
266
267 Python
268 * Corrected ListFields() signature in Message base class to match what
269 subclasses actually implement.
270 * Some minor refactoring.
kenton@google.com2f669cb2008-12-02 05:59:15 +0000271 * Don't pass self as first argument to superclass constructor (no longer
272 allowed in Python 2.6).
kenton@google.com9f175282008-11-25 19:37:10 +0000273
kenton@google.com9b10f582008-09-30 00:09:40 +00002742008-09-29 version 2.0.2:
275
kenton@google.com24bf56f2008-09-24 20:31:01 +0000276 General
277 * License changed from Apache 2.0 to New BSD.
278 * It is now possible to define custom "options", which are basically
279 annotations which may be placed on definitions in a .proto file.
280 For example, you might define a field option called "foo" like so:
281 import "google/protobuf/descriptor.proto"
282 extend google.protobuf.FieldOptions {
283 optional string foo = 12345;
284 }
285 Then you annotate a field using the "foo" option:
286 message MyMessage {
287 optional int32 some_field = 1 [(foo) = "bar"]
288 }
289 The value of this option is then visible via the message's
290 Descriptor:
291 const FieldDescriptor* field =
292 MyMessage::descriptor()->FindFieldByName("some_field");
293 assert(field->options().GetExtension(foo) == "bar");
294 This feature has been implemented and tested in C++ and Java.
295 Other languages may or may not need to do extra work to support
296 custom options, depending on how they construct descriptors.
297
298 C++
299 * Fixed some GCC warnings that only occur when using -pedantic.
300 * Improved static initialization code, making ordering more
301 predictable among other things.
302 * TextFormat will no longer accept messages which contain multiple
303 instances of a singular field. Previously, the latter instance
kenton@google.com9b10f582008-09-30 00:09:40 +0000304 would overwrite the former.
kenton@google.com24bf56f2008-09-24 20:31:01 +0000305 * Now works on systems that don't have hash_map.
306
kenton@google.com9b10f582008-09-30 00:09:40 +0000307 Java
308 * Print @Override annotation in generated code where appropriate.
309
kenton@google.com24bf56f2008-09-24 20:31:01 +0000310 Python
311 * Strings now use the "unicode" type rather than the "str" type.
312 String fields may still be assigned ASCII "str" values; they will
313 automatically be converted.
314 * Adding a property to an object representing a repeated field now
315 raises an exception. For example:
316 # No longer works (and never should have).
317 message.some_repeated_field.foo = 1
kenton@google.com9b10f582008-09-30 00:09:40 +0000318
319 Windows
320 * We now build static libraries rather than DLLs by default on MSVC.
321 See vsprojects/readme.txt for more information.
322
temporala44f3c32008-08-15 18:32:02 +00003232008-08-15 version 2.0.1:
kenton@google.com9b10f582008-09-30 00:09:40 +0000324
325 protoc
326 * New flags --encode and --decode can be used to convert between protobuf text
327 format and binary format from the command-line.
328 * New flag --descriptor_set_out can be used to write FileDescriptorProtos for
329 all parsed files directly into a single output file. This is particularly
330 useful if you wish to parse .proto files from programs written in languages
331 other than C++: just run protoc as a background process and have it output
332 a FileDescriptorList, then parse that natively.
333 * Improved error message when an enum value's name conflicts with another
334 symbol defined in the enum type's scope, e.g. if two enum types declared
335 in the same scope have values with the same name. This is disallowed for
temporala44f3c32008-08-15 18:32:02 +0000336 compatibility with C++, but this wasn't clear from the error.
kenton@google.com9b10f582008-09-30 00:09:40 +0000337 * Fixed absolute output paths on Windows.
temporala44f3c32008-08-15 18:32:02 +0000338 * Allow trailing slashes in --proto_path mappings.
kenton@google.com9b10f582008-09-30 00:09:40 +0000339
340 C++
341 * Reflection objects are now per-class rather than per-instance. To make this
342 possible, the Reflection interface had to be changed such that all methods
343 take the Message instance as a parameter. This change improves performance
344 significantly in memory-bandwidth-limited use cases, since it makes the
345 message objects smaller. Note that source-incompatible interface changes
346 like this will not be made again after the library leaves beta.
temporala44f3c32008-08-15 18:32:02 +0000347 * Heuristically detect sub-messages when printing unknown fields.
kenton@google.com9b10f582008-09-30 00:09:40 +0000348 * Fix static initialization ordering bug that caused crashes at startup when
temporala44f3c32008-08-15 18:32:02 +0000349 compiling on Mac with static linking.
kenton@google.com9b10f582008-09-30 00:09:40 +0000350 * Fixed TokenizerTest when compiling with -DNDEBUG on Linux.
351 * Fixed incorrect definition of kint32min.
temporala44f3c32008-08-15 18:32:02 +0000352 * Fix bytes type setter to work with byte sequences with embedded NULLs.
353 * Other irrelevant tweaks.
354
kenton@google.com9b10f582008-09-30 00:09:40 +0000355 Java
356 * Fixed UnknownFieldSet's parsing of varints larger than 32 bits.
357 * Fixed TextFormat's parsing of "inf" and "nan".
358 * Fixed TextFormat's parsing of comments.
359 * Added info to Java POM that will be required when we upload the
temporala44f3c32008-08-15 18:32:02 +0000360 package to a Maven repo.
361
kenton@google.com9b10f582008-09-30 00:09:40 +0000362 Python
363 * MergeFrom(message) and CopyFrom(message) are now implemented.
364 * SerializeToString() raises an exception if the message is missing required
365 fields.
366 * Code organization improvements.
367 * Fixed doc comments for RpcController and RpcChannel, which had somehow been
temporala44f3c32008-08-15 18:32:02 +0000368 swapped.
kenton@google.com9b10f582008-09-30 00:09:40 +0000369 * Fixed text_format_test on Windows where floating-point exponents sometimes
370 contain extra zeros.
temporala44f3c32008-08-15 18:32:02 +0000371 * Fix Python service CallMethod() implementation.
372
373 Other
374 * Improved readmes.
375 * VIM syntax highlighting improvements.
376
temporal40ee5512008-07-10 02:12:20 +00003772008-07-07 version 2.0.0:
378
379 * First public release.