blob: 7d73201c7859dae138f5f4193721b12a1a4ecbca [file] [log] [blame]
Bo Yang8908cf12015-05-26 14:37:47 -070012015-05-25 version 3.0.0-alpha-3 (Objective-C/C#):
2 General
3 * Introduced two new language implementations (Objective-C, C#) to proto3.
4 * Disallowed "optional" keyword in proto3 syntax.
5 * Removed groups fields in proto3 syntax.
6 * Changed repeated primitive fields to use packed serialization by default in
7 proto3 (implemented for C++, Java, Python in this release). The user can
8 still disable packed serialization by setting packed to false for now.
9 * Added well-known type protos (any.proto, empty.proto, timestamp.proto,
10 duration.proto, etc.). Users can import and use these protos just like
11 regular proto files. Addtional runtime support will be added for them in
12 future releases (in the form of utility helper functions, or having them
13 replaced by language specific types in generated code).
14 * Added a "reserved" keyword in both proto2 and proto3 syntax. User can use
15 this keyword to declare reserved field numbers and names to prevent them
16 from being reused by other fields in the same message.
17
18 To reserve field numbers, add a reserved declaration in your message:
19
20 message TestMessage {
21 reserved 2, 15, 9 to 11, 3;
22 }
23
24 This reserves field numbers 2, 3, 9, 10, 11 and 15. If a user uses any of
25 these as field numbers, the protocol buffer compiler will report an error.
26
27 Field names can also be reserved:
28
29 message TestMessage {
30 reserved "foo", "bar";
31 }
32
33 * Various bug fixes since 3.0.0-alpha-2
34
35 Objective-C
36 Objective-C includes a code generator and a native objective-c runtime
37 library. By adding “--objc_out” to protoc, the code generator will generate
38 a header(*.pbobjc.h) and an implementation file(*.pbobjc.m) for each proto
39 file.
40
41 In this first release, the generated interface provides: enums, messages,
42 field support(single, repeated, map, oneof), proto2 and proto3 syntax
43 support, parsing and serialization. It’s compatible with ARC and non-ARC
44 usage. Besides, user can also access it via the swift bridging header.
45
46 See objectivec/README.md for details.
47
48 C#
49 * C# protobufs are based on project
50 https://github.com/jskeet/protobuf-csharp-port. The original project was
51 frozen and all the new development will happen here.
52 * Codegen plugin for C# was completely rewritten to C++ and is now an
53 intergral part of protoc.
54 * Some refactorings and cleanup has been applied to the C# runtime library.
55 * Only proto2 is supported in C# at the moment, proto3 support is in
56 progress and will likely bring significant breaking changes to the API.
57
58 See csharp/README.md for details.
59
60 C++
61 * Added runtime support for Any type. To use Any in your proto file, first
62 import the definition of Any:
63
64 // foo.proto
65 import "google/protobuf/any.proto";
66 message Foo {
67 google.protobuf.Any any_field = 1;
68 }
69 message Bar {
70 int32 value = 1;
71 }
72
73 Then in C++ you can access the Any field using PackFrom()/UnpackTo()
74 methods:
75
76 Foo foo;
77 Bar bar = ...;
78 foo.mutable_any_field()->PackFrom(bar);
79 ...
80 if (foo.any_field().IsType<Bar>()) {
81 foo.any_field().UnpackTo(&bar);
82 ...
83 }
84 * In text format, entries of a map field will be sorted by key.
85
86 Java
87 * Continued optimizations on the lite runtime to improve performance for
88 Android.
89
90 Python
91 * Added map support.
92 - maps now have a dict-like interface (msg.map_field[key] = value)
93 - existing code that modifies maps via the repeated field interface
94 will need to be updated.
95
96 Ruby
97 * Improvements to RepeatedField's emulation of the Ruby Array API.
98 * Various speedups and internal cleanups.
99
Josh Haberman7d5cf8d2015-02-25 23:47:09 -08001002015-02-26 version 3.0.0-alpha-2 (Python/Ruby/JavaNano):
Jisi Liu32f5d012015-02-20 14:45:45 -0800101 General
Josh Haberman7d5cf8d2015-02-25 23:47:09 -0800102 * Introduced three new language implementations (Ruby, JavaNano, and
103 Python) to proto3.
Jisi Liu32f5d012015-02-20 14:45:45 -0800104 * Various bug fixes since 3.0.0-alpha-1
105
Josh Haberman31e8c202015-02-25 23:06:35 -0800106 Python:
107 Python has received several updates, most notably support for proto3
108 semantics in any .proto file that declares syntax="proto3".
109 Messages declared in proto3 files no longer represent field presence
110 for scalar fields (number, enums, booleans, or strings). You can
111 no longer call HasField() for such fields, and they are serialized
112 based on whether they have a non-zero/empty/false value.
113
114 One other notable change is in the C++-accelerated implementation.
115 Descriptor objects (which describe the protobuf schema and allow
116 reflection over it) are no longer duplicated between the Python
117 and C++ layers. The Python descriptors are now simple wrappers
118 around the C++ descriptors. This change should significantly
119 reduce the memory usage of programs that use a lot of message
120 types.
121
Jisi Liu32f5d012015-02-20 14:45:45 -0800122 Ruby:
Chris Fallin1d4f3212015-02-20 17:32:06 -0800123 We have added proto3 support for Ruby via a native C extension.
124
125 The Ruby extension itself is included in the ruby/ directory, and details on
126 building and installing the extension are in ruby/README.md. The extension
127 will also be published as a Ruby gem. Code generator support is included as
128 part of `protoc` with the `--ruby_out` flag.
129
130 The Ruby extension implements a user-friendly DSL to define message types
131 (also generated by the code generator from `.proto` files). Once a message
132 type is defined, the user may create instances of the message that behave in
133 ways idiomatic to Ruby. For example:
134
135 - Message fields are present as ordinary Ruby properties (getter method
136 `foo` and setter method `foo=`).
137 - Repeated field elements are stored in a container that acts like a native
138 Ruby array, and map elements are stored in a container that acts like a
139 native Ruby hashmap.
140 - The usual well-known methods, such as `#to_s`, `#dup`, and the like, are
141 present.
142
143 Unlike several existing third-party Ruby extensions for protobuf, this
144 extension is built on a "strongly-typed" philosophy: message fields and
145 array/map containers will throw exceptions eagerly when values of the
146 incorrect type are inserted.
147
148 See ruby/README.md for details.
Jisi Liu32f5d012015-02-20 14:45:45 -0800149
150 JavaNano:
151 JavaNano is a special code generator and runtime library designed especially
152 for resource-restricted systems, like Android. It is very resource-friendly
153 in both the amount of code and the runtime overhead. Here is an an overview
154 of JavaNano features compared with the official Java protobuf:
155
156 - No descriptors or message builders.
157 - All messages are mutable; fields are public Java fields.
158 - For optional fields only, encapsulation behind setter/getter/hazzer/
159 clearer functions is opt-in, which provide proper 'has' state support.
160 - For proto2, if not opted in, has state (field presence) is not available.
161 Serialization outputs all fields not equal to their defaults.
162 The behavior is consistent with proto3 semantics.
163 - Required fields (proto2 only) are always serialized.
164 - Enum constants are integers; protection against invalid values only
165 when parsing from the wire.
166 - Enum constants can be generated into container interfaces bearing
167 the enum's name (so the referencing code is in Java style).
168 - CodedInputByteBufferNano can only take byte[] (not InputStream).
169 - Similarly CodedOutputByteBufferNano can only write to byte[].
170 - Repeated fields are in arrays, not ArrayList or Vector. Null array
171 elements are allowed and silently ignored.
172 - Full support for serializing/deserializing repeated packed fields.
173 - Support extensions (in proto2).
174 - Unset messages/groups are null, not an immutable empty default
175 instance.
176 - toByteArray(...) and mergeFrom(...) are now static functions of
177 MessageNano.
178 - The 'bytes' type translates to the Java type byte[].
179
180 See javanano/README.txt for details.
181
Feng Xiao9104da32014-12-09 11:57:52 -08001822014-12-01 version 3.0.0-alpha-1 (C++/Java):
183
184 General
185 * Introduced Protocol Buffers language version 3 (aka proto3).
186
187 When protobuf was initially opensourced it implemented Protocol Buffers
188 language version 2 (aka proto2), which is why the version number
189 started from v2.0.0. From v3.0.0, a new language version (proto3) is
190 introduced while the old version (proto2) will continue to be supported.
191
192 The main intent of introducing proto3 is to clean up protobuf before
193 pushing the language as the foundation of Google's new API platform.
194 In proto3, the language is simplified, both for ease of use and to
195 make it available in a wider range of programming languages. At the
196 same time a few features are added to better support common idioms
197 found in APIs.
198
199 The following are the main new features in language version 3:
200
201 1. Removal of field presence logic for primitive value fields, removal
202 of required fields, and removal of default values. This makes proto3
203 significantly easier to implement with open struct representations,
204 as in languages like Android Java, Objective C, or Go.
205 2. Removal of unknown fields.
206 3. Removal of extensions, which are instead replaced by a new standard
207 type called Any.
208 4. Fix semantics for unknown enum values.
209 5. Addition of maps.
210 6. Addition of a small set of standard types for representation of time,
211 dynamic data, etc.
212 7. A well-defined encoding in JSON as an alternative to binary proto
213 encoding.
214
215 This release (v3.0.0-alpha-1) includes partial proto3 support for C++ and
216 Java. Items 6 (well-known types) and 7 (JSON format) in the above feature
217 list are not impelmented.
218
219 A new notion "syntax" is introduced to specify whether a .proto file
220 uses proto2 or proto3:
221
222 // foo.proto
223 syntax = "proto3";
224 message Bar {...}
225
226 If omitted, the protocol compiler will generate a warning and "proto2" will
227 be used as the default. This warning will be turned into an error in a
228 future release.
229
230 We recommend that new Protocol Buffers users use proto3. However, we do not
231 generally recommend that existing users migrate from proto2 from proto3 due
232 to API incompatibility, and we will continue to support proto2 for a long
233 time.
234
235 * Added support for map fields (implemented in C++/Java for both proto2 and
236 proto3).
237
238 Map fields can be declared using the following syntax:
239
240 message Foo {
241 map<string, string> values = 1;
242 }
243
244 Data of a map field will be stored in memory as an unordered map and it
245 can be accessed through generated accessors.
246
247 C++
248 * Added arena allocation support (for both proto2 and proto3).
249
250 Profiling shows memory allocation and deallocation constitutes a significant
251 fraction of CPU-time spent in protobuf code and arena allocation is a
252 technique introduced to reduce this cost. With arena allocation, new
253 objects will be allocated from a large piece of preallocated memory and
254 deallocation of these objects is almost free. Early adoption shows 20% to
255 50% improvement in some Google binaries.
256
257 To enable arena support, add the following option to your .proto file:
258
259 option cc_enable_arenas = true;
260
261 Protocol compiler will generate additional code to make the generated
262 message classes work with arenas. This does not change the existing API
263 of protobuf messages and does not affect wire format. Your existing code
264 should continue to work after adding this option. In the future we will
265 make this option enabled by default.
266
267 To actually take advantage of arena allocation, you need to use the arena
268 APIs when creating messages. A quick example of using the arena API:
269
270 {
271 google::protobuf::Arena arena;
272 // Allocate a protobuf message in the arena.
273 MyMessage* message = Arena::CreateMessage<MyMessage>(&arena);
274 // All submessages will be allocated in the same arena.
275 if (!message->ParseFromString(data)) {
276 // Deal with malformed input data.
277 }
278 // Must not delete the message here. It will be deleted automatically
279 // when the arena is destroyed.
280 }
281
282 Currently arena does not work with map fields. Enabling arena in a .proto
283 file containing map fields will result in compile errors in the generated
284 code. This will be addressed in a future release.
285
Feng Xiaobba83652014-10-20 17:06:06 -07002862014-10-20 version 2.6.1:
Feng Xiao57b86722014-10-09 11:20:08 -0700287
288 C++
289 * Added atomicops support for Solaris.
290 * Released memory allocated by InitializeDefaultRepeatedFields() and
291 GetEmptyString(). Some memory sanitizers reported them as memory leaks.
292
293 Java
294 * Updated DynamicMessage.setField() to handle repeated enum values
295 correctly.
296 * Fixed a bug that caused NullPointerException to be thrown when
297 converting manually constructed FileDescriptorProto to
298 FileDescriptor.
299
300 Python
Feng Xiao419c94b2014-10-09 11:40:02 -0700301 * Fixed WhichOneof() to work with de-serialized protobuf messages.
Feng Xiao57b86722014-10-09 11:20:08 -0700302 * Fixed a missing file problem of Python C++ implementation.
303
jieluo@google.com1eba9d92014-08-25 20:17:53 +00003042014-08-15 version 2.6.0:
305
306 General
307 * Added oneofs(unions) feature. Fields in the same oneof will share
308 memory and at most one field can be set at the same time. Use the
309 oneof keyword to define a oneof like:
310 message SampleMessage {
311 oneof test_oneof {
312 string name = 4;
313 YourMessage sub_message = 9;
314 }
315 }
316 * Files, services, enums, messages, methods and enum values can be marked
317 as deprecated now.
318 * Added Support for list values, including lists of mesaages, when
319 parsing text-formatted protos in C++ and Java.
320 For example: foo: [1, 2, 3]
321
322 C++
323 * Enhanced customization on TestFormat printing.
324 * Added SwapFields() in reflection API to swap a subset of fields.
325 Added SetAllocatedMessage() in reflection API.
326 * Repeated primitive extensions are now packable. The
327 [packed=true] option only affects serializers. Therefore, it is
328 possible to switch a repeated extension field to packed format
329 without breaking backwards-compatibility.
330 * Various speed optimizations.
331
332 Java
333 * writeTo() method in ByteString can now write a substring to an
334 output stream. Added endWith() method for ByteString.
335 * ByteString and ByteBuffer are now supported in CodedInputStream
336 and CodedOutputStream.
337 * java_generate_equals_and_hash can now be used with the LITE_RUNTIME.
338
339 Python
340 * A new C++-backed extension module (aka "cpp api v2") that replaces the
341 old ("cpp api v1") one. Much faster than the pure Python code. This one
342 resolves many bugs and is recommended for general use over the
343 pure Python when possible.
344 * Descriptors now have enum_types_by_name and extension_types_by_name dict
345 attributes.
346 * Support for Python 3.
347
xiaofeng@google.com2c9392f2013-02-28 06:12:28 +00003482013-02-27 version 2.5.0:
xiaofeng@google.comb55a20f2012-09-22 02:40:50 +0000349
350 General
351 * New notion "import public" that allows a proto file to forward the content
352 it imports to its importers. For example,
353 // foo.proto
354 import public "bar.proto";
355 import "baz.proto";
356
357 // qux.proto
358 import "foo.proto";
359 // Stuff defined in bar.proto may be used in this file, but stuff from
360 // baz.proto may NOT be used without importing it explicitly.
361 This is useful for moving proto files. To move a proto file, just leave
362 a single "import public" in the old proto file.
363 * New enum option "allow_alias" that specifies whether different symbols can
364 be assigned the same numeric value. Default value is "true". Setting it to
365 false causes the compiler to reject enum definitions where multiple symbols
366 have the same numeric value.
xiaofeng@google.com7f4c9e82013-03-05 01:51:21 +0000367 Note: We plan to flip the default value to "false" in a future release.
368 Projects using enum aliases should set the option to "true" in their .proto
369 files.
xiaofeng@google.comb55a20f2012-09-22 02:40:50 +0000370
371 C++
372 * New generated method set_allocated_foo(Type* foo) for message and string
373 fields. This method allows you to set the field to a pre-allocated object
374 and the containing message takes the ownership of that object.
375 * Added SetAllocatedExtension() and ReleaseExtension() to extensions API.
376 * Custom options are now formatted correctly when descriptors are printed in
377 text format.
378 * Various speed optimizations.
379
380 Java
381 * Comments in proto files are now collected and put into generated code as
382 comments for corresponding classes and data members.
383 * Added Parser to parse directly into messages without a Builder. For
384 example,
xiaofeng@google.com2c9392f2013-02-28 06:12:28 +0000385 Foo foo = Foo.PARSER.ParseFrom(input);
xiaofeng@google.comb55a20f2012-09-22 02:40:50 +0000386 Using Parser is ~25% faster than using Builder to parse messages.
387 * Added getters/setters to access the underlying ByteString of a string field
388 directly.
389 * ByteString now supports more operations: substring(), prepend(), and
390 append(). The implementation of ByteString uses a binary tree structure
391 to support these operations efficiently.
392 * New method findInitializationErrors() that lists all missing required
393 fields.
394 * Various code size and speed optimizations.
395
396 Python
397 * Added support for dynamic message creation. DescriptorDatabase,
398 DescriptorPool, and MessageFactory work like their C++ couterparts to
399 simplify Descriptor construction from *DescriptorProtos, and MessageFactory
400 provides a message instance from a Descriptor.
401 * Added pickle support for protobuf messages.
402 * Unknown fields are now preserved after parsing.
403 * Fixed bug where custom options were not correctly populated. Custom
404 options can be accessed now.
405 * Added EnumTypeWrapper that provides better accessibility to enum types.
406 * Added ParseMessage(descriptor, bytes) to generate a new Message instance
407 from a descriptor and a byte string.
408
liujisi@google.com5d996322011-04-30 15:29:09 +00004092011-05-01 version 2.4.1:
410
411 C++
412 * Fixed the frendship problem for old compilers to make the library now gcc 3
413 compatible again.
414 * Fixed vcprojects/extract_includes.bat to extract compiler/plugin.h.
415
416 Java
417 * Removed usages of JDK 1.6 only features to make the library now JDK 1.5
418 compatible again.
419 * Fixed a bug about negative enum values.
420 * serialVersionUID is now defined in generated messages for java serializing.
421 * Fixed protoc to use java.lang.Object, which makes "Object" now a valid
422 message name again.
423
424 Python
425 * Experimental C++ implementation now requires C++ protobuf library installed.
426 See the README.txt in the python directory for details.
427
liujisi@google.com7a261472011-02-02 14:04:22 +00004282011-02-02 version 2.4.0:
liujisi@google.com33165fe2010-11-02 13:14:58 +0000429
430 General
431 * The RPC (cc|java|py)_generic_services default value is now false instead of
432 true.
433 * Custom options can have aggregate types. For example,
434 message MyOption {
435 optional string comment = 1;
436 optional string author = 2;
437 }
438 extend google.protobuf.FieldOptions {
439 optional MyOption myoption = 12345;
440 }
441 This option can now be set as follows:
442 message SomeType {
443 optional int32 field = 1 [(myoption) = { comment:'x' author:'y' }];
444 }
445
446 C++
447 * Various speed and code size optimizations.
448 * Added a release_foo() method on string and message fields.
449 * Fixed gzip_output_stream sub-stream handling.
450
451 Java
452 * Builders now maintain sub-builders for sub-messages. Use getFooBuilder() to
453 get the builder for the sub-message "foo". This allows you to repeatedly
454 modify deeply-nested sub-messages without rebuilding them.
455 * Builder.build() no longer invalidates the Builder for generated messages
456 (You may continue to modify it and then build another message).
457 * Code generator will generate efficient equals() and hashCode()
458 implementations if new option java_generate_equals_and_hash is enabled.
459 (Otherwise, reflection-based implementations are used.)
460 * Generated messages now implement Serializable.
461 * Fields with [deprecated=true] will be marked with @Deprecated in Java.
462 * Added lazy conversion of UTF-8 encoded strings to String objects to improve
463 performance.
464 * Various optimizations.
465 * Enum value can be accessed directly, instead of calling getNumber() on the
466 enum member.
467 * For each enum value, an integer constant is also generated with the suffix
468 _VALUE.
469
470 Python
471 * Added an experimental C++ implementation for Python messages via a Python
472 extension. Implementation type is controlled by an environment variable
473 PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION (valid values: "cpp" and "python")
474 The default value is currently "python" but will be changed to "cpp" in
475 future release.
476 * Improved performance on message instantiation significantly.
477 Most of the work on message instantiation is done just once per message
478 class, instead of once per message instance.
479 * Improved performance on text message parsing.
480 * Allow add() to forward keyword arguments to the concrete class.
481 E.g. instead of
482 item = repeated_field.add()
483 item.foo = bar
484 item.baz = quux
485 You can do:
486 repeated_field.add(foo=bar, baz=quux)
487 * Added a sort() interface to the BaseContainer.
488 * Added an extend() method to repeated composite fields.
489 * Added UTF8 debug string support.
490
temporald4e38c72010-01-09 07:35:50 +00004912010-01-08 version 2.3.0:
kenton@google.comfccb1462009-12-18 02:11:36 +0000492
493 General
494 * Parsers for repeated numeric fields now always accept both packed and
495 unpacked input. The [packed=true] option only affects serializers.
496 Therefore, it is possible to switch a field to packed format without
497 breaking backwards-compatibility -- as long as all parties are using
498 protobuf 2.3.0 or above, at least.
499 * The generic RPC service code generated by the C++, Java, and Python
500 generators can be disabled via file options:
501 option cc_generic_services = false;
502 option java_generic_services = false;
503 option py_generic_services = false;
504 This allows plugins to generate alternative code, possibly specific to some
505 particular RPC implementation.
506
507 protoc
508 * Now supports a plugin system for code generators. Plugins can generate
509 code for new languages or inject additional code into the output of other
510 code generators. Plugins are just binaries which accept a protocol buffer
511 on stdin and write a protocol buffer to stdout, so they may be written in
512 any language. See src/google/protobuf/compiler/plugin.proto.
kenton@google.com7f4938b2009-12-22 22:57:39 +0000513 **WARNING**: Plugins are experimental. The interface may change in a
514 future version.
kenton@google.com0225b352010-01-04 22:07:09 +0000515 * If the output location ends in .zip or .jar, protoc will write its output
516 to a zip/jar archive instead of a directory. For example:
517 protoc --java_out=myproto_srcs.jar --python_out=myproto.zip myproto.proto
518 Currently the archive contents are not compressed, though this could change
519 in the future.
kenton@google.comfccb1462009-12-18 02:11:36 +0000520 * inf, -inf, and nan can now be used as default values for float and double
521 fields.
522
523 C++
524 * Various speed and code size optimizations.
525 * DynamicMessageFactory is now fully thread-safe.
526 * Message::Utf8DebugString() method is like DebugString() but avoids escaping
527 UTF-8 bytes.
528 * Compiled-in message types can now contain dynamic extensions, through use
529 of CodedInputStream::SetExtensionRegistry().
kenton@google.comc0ee4d22009-12-22 02:05:33 +0000530 * Now compiles shared libraries (DLLs) by default on Cygwin and MinGW, to
531 match other platforms. Use --disable-shared to avoid this.
kenton@google.comfccb1462009-12-18 02:11:36 +0000532
533 Java
534 * parseDelimitedFrom() and mergeDelimitedFrom() now detect EOF and return
535 false/null instead of throwing an exception.
536 * Fixed some initialization ordering bugs.
537 * Fixes for OpenJDK 7.
538
539 Python
540 * 10-25 times faster than 2.2.0, still pure-Python.
541 * Calling a mutating method on a sub-message always instantiates the message
542 in its parent even if the mutating method doesn't actually mutate anything
543 (e.g. parsing from an empty string).
544 * Expanded descriptors a bit.
545
kenton@google.com201b9be2009-08-12 00:23:05 +00005462009-08-11 version 2.2.0:
kenton@google.comceb561d2009-06-25 19:05:36 +0000547
548 C++
kenton@google.com80b1d622009-07-29 01:13:20 +0000549 * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler
550 to generate code which only depends libprotobuf-lite, which is much smaller
551 than libprotobuf but lacks descriptors, reflection, and some other features.
kenton@google.comceb561d2009-06-25 19:05:36 +0000552 * Fixed bug where Message.Swap(Message) was only implemented for
553 optimize_for_speed. Swap now properly implemented in both modes
554 (Issue 91).
555 * Added RemoveLast and SwapElements(index1, index2) to Reflection
556 interface for repeated elements.
557 * Added Swap(Message) to Reflection interface.
kenton@google.comd2fd0632009-07-24 01:00:35 +0000558 * Floating-point literals in generated code that are intended to be
559 single-precision now explicitly have 'f' suffix to avoid pedantic warnings
560 produced by some compilers.
kenton@google.com80b1d622009-07-29 01:13:20 +0000561 * The [deprecated=true] option now causes the C++ code generator to generate
562 a GCC-style deprecation annotation (no-op on other compilers).
563 * google::protobuf::GetEnumDescriptor<SomeGeneratedEnumType>() returns the
564 EnumDescriptor for that type -- useful for templates which cannot call
565 SomeGeneratedEnumType_descriptor().
566 * Various optimizations and obscure bug fixes.
567
568 Java
569 * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler
570 to generate code which only depends libprotobuf-lite, which is much smaller
571 than libprotobuf but lacks descriptors, reflection, and some other features.
kenton@google.com80b1d622009-07-29 01:13:20 +0000572 * Lots of style cleanups.
573
574 Python
575 * Fixed endianness bug with floats and doubles.
576 * Text format parsing support.
577 * Fix bug with parsing packed repeated fields in embedded messages.
578 * Ability to initialize fields by passing keyword args to constructor.
579 * Support iterators in extend and __setslice__ for containers.
kenton@google.comceb561d2009-06-25 19:05:36 +0000580
kenton@google.com1fb3d392009-05-13 23:20:03 +00005812009-05-13 version 2.1.0:
kenton@google.com2d6daa72009-01-22 01:27:00 +0000582
583 General
584 * Repeated fields of primitive types (types other that string, group, and
585 nested messages) may now use the option [packed = true] to get a more
586 efficient encoding. In the new encoding, the entire list is written
587 as a single byte blob using the "length-delimited" wire type. Within
588 this blob, the individual values are encoded the same way they would
589 be normally except without a tag before each value (thus, they are
590 tightly "packed").
kenton@google.comcfa2d8a2009-04-18 00:02:12 +0000591 * For each field, the generated code contains an integer constant assigned
592 to the field number. For example, the .proto file:
593 message Foo { optional int bar_baz = 123; }
594 would generate the following constants, all with the integer value 123:
595 C++: Foo::kBarBazFieldNumber
596 Java: Foo.BAR_BAZ_FIELD_NUMBER
597 Python: Foo.BAR_BAZ_FIELD_NUMBER
598 Constants are also generated for extensions, with the same naming scheme.
599 These constants may be used as switch cases.
kenton@google.com37ad00d2009-04-21 21:00:39 +0000600 * Updated bundled Google Test to version 1.3.0. Google Test is now bundled
601 in its verbatim form as a nested autoconf package, so you can drop in any
602 other version of Google Test if needed.
kenton@google.comd37d46d2009-04-25 02:53:47 +0000603 * optimize_for = SPEED is now the default, by popular demand. Use
604 optimize_for = CODE_SIZE if code size is more important in your app.
605 * It is now an error to define a default value for a repeated field.
606 Previously, this was silently ignored (it had no effect on the generated
607 code).
608 * Fields can now be marked deprecated like:
609 optional int32 foo = 1 [deprecated = true];
610 Currently this does not have any actual effect, but in the future the code
611 generators may generate deprecation annotations in each language.
kenton@google.com9824eda2009-05-06 17:49:37 +0000612 * Cross-compiling should now be possible using the --with-protoc option to
613 configure. See README.txt for more info.
kenton@google.com2d6daa72009-01-22 01:27:00 +0000614
kenton@google.comf663b162009-04-15 19:50:54 +0000615 protoc
616 * --error_format=msvs option causes errors to be printed in Visual Studio
617 format, which should allow them to be clicked on in the build log to go
kenton@google.comd37d46d2009-04-25 02:53:47 +0000618 directly to the error location.
619 * The type name resolver will no longer resolve type names to fields. For
620 example, this now works:
621 message Foo {}
622 message Bar {
623 optional int32 Foo = 1;
624 optional Foo baz = 2;
625 }
626 Previously, the type of "baz" would resolve to "Bar.Foo", and you'd get
627 an error because Bar.Foo is a field, not a type. Now the type of "baz"
628 resolves to the message type Foo. This change is unlikely to make a
629 difference to anyone who follows the Protocol Buffers style guide.
kenton@google.comf663b162009-04-15 19:50:54 +0000630
kenton@google.com2d6daa72009-01-22 01:27:00 +0000631 C++
kenton@google.comd37d46d2009-04-25 02:53:47 +0000632 * Several optimizations, including but not limited to:
633 - Serialization, especially to flat arrays, is 10%-50% faster, possibly
634 more for small objects.
635 - Several descriptor operations which previously required locking no longer
636 do.
637 - Descriptors are now constructed lazily on first use, rather than at
638 process startup time. This should save memory in programs which do not
639 use descriptors or reflection.
640 - UnknownFieldSet completely redesigned to be more efficient (especially in
641 terms of memory usage).
642 - Various optimizations to reduce code size (though the serialization speed
643 optimizations increased code size).
kenton@google.com2d6daa72009-01-22 01:27:00 +0000644 * Message interface has method ParseFromBoundedZeroCopyStream() which parses
645 a limited number of bytes from an input stream rather than parsing until
646 EOF.
kenton@google.come59427a2009-04-16 22:30:56 +0000647 * GzipInputStream and GzipOutputStream support reading/writing gzip- or
648 zlib-compressed streams if zlib is available.
649 (google/protobuf/io/gzip_stream.h)
kenton@google.comd37d46d2009-04-25 02:53:47 +0000650 * DescriptorPool::FindAllExtensions() and corresponding
651 DescriptorDatabase::FindAllExtensions() can be used to enumerate all
652 extensions of a given type.
653 * For each enum type Foo, protoc will generate functions:
654 const string& Foo_Name(Foo value);
655 bool Foo_Parse(const string& name, Foo* result);
656 The former returns the name of the enum constant corresponding to the given
657 value while the latter finds the value corresponding to a name.
658 * RepeatedField and RepeatedPtrField now have back-insertion iterators.
659 * String fields now have setters that take a char* and a size, in addition
660 to the existing ones that took char* or const string&.
661 * DescriptorPool::AllowUnknownDependencies() may be used to tell
662 DescriptorPool to create placeholder descriptors for unknown entities
663 referenced in a FileDescriptorProto. This can allow you to parse a .proto
664 file without having access to other .proto files that it imports, for
665 example.
666 * Updated gtest to latest version. The gtest package is now included as a
667 nested autoconf package, so it should be able to drop new versions into the
668 "gtest" subdirectory without modification.
kenton@google.com2d6daa72009-01-22 01:27:00 +0000669
670 Java
671 * Fixed bug where Message.mergeFrom(Message) failed to merge extensions.
672 * Message interface has new method toBuilder() which is equivalent to
673 newBuilderForType().mergeFrom(this).
674 * All enums now implement the ProtocolMessageEnum interface.
675 * Setting a field to null now throws NullPointerException.
676 * Fixed tendency for TextFormat's parsing to overflow the stack when
677 parsing large string values. The underlying problem is with Java's
678 regex implementation (which unfortunately uses recursive backtracking
679 rather than building an NFA). Worked around by making use of possesive
680 quantifiers.
kenton@google.comd37d46d2009-04-25 02:53:47 +0000681 * Generated service classes now also generate pure interfaces. For a service
682 Foo, Foo.Interface is a pure interface containing all of the service's
683 defined methods. Foo.newReflectiveService() can be called to wrap an
684 instance of this interface in a class that implements the generic
685 RpcService interface, which provides reflection support that is usually
686 needed by RPC server implementations.
687 * RPC interfaces now support blocking operation in addition to non-blocking.
688 The protocol compiler generates separate blocking and non-blocking stubs
689 which operate against separate blocking and non-blocking RPC interfaces.
690 RPC implementations will have to implement the new interfaces in order to
691 support blocking mode.
692 * New I/O methods parseDelimitedFrom(), mergeDelimitedFrom(), and
693 writeDelimitedTo() read and write "delemited" messages from/to a stream,
694 meaning that the message size precedes the data. This way, you can write
695 multiple messages to a stream without having to worry about delimiting
696 them yourself.
697 * Throw a more descriptive exception when build() is double-called.
698 * Add a method to query whether CodedInputStream is at the end of the input
699 stream.
700 * Add a method to reset a CodedInputStream's size counter; useful when
701 reading many messages with the same stream.
702 * equals() and hashCode() now account for unknown fields.
pesho.petrov87e64e12008-12-24 01:07:22 +0000703
704 Python
705 * Added slicing support for repeated scalar fields. Added slice retrieval and
706 removal of repeated composite fields.
kenton@google.com2d6daa72009-01-22 01:27:00 +0000707 * Updated RPC interfaces to allow for blocking operation. A client may
708 now pass None for a callback when making an RPC, in which case the
709 call will block until the response is received, and the response
710 object will be returned directly to the caller. This interface change
711 cannot be used in practice until RPC implementations are updated to
712 implement it.
kenton@google.comd37d46d2009-04-25 02:53:47 +0000713 * Changes to input_stream.py should make protobuf compatible with appengine.
pesho.petrov87e64e12008-12-24 01:07:22 +0000714
kenton@google.com9f175282008-11-25 19:37:10 +00007152008-11-25 version 2.0.3:
716
717 protoc
718 * Enum values may now have custom options, using syntax similar to field
719 options.
720 * Fixed bug where .proto files which use custom options but don't actually
721 define them (i.e. they import another .proto file defining the options)
722 had to explicitly import descriptor.proto.
723 * Adjacent string literals in .proto files will now be concatenated, like in
724 C.
kenton@google.com2f669cb2008-12-02 05:59:15 +0000725 * If an input file is a Windows absolute path (e.g. "C:\foo\bar.proto") and
726 the import path only contains "." (or contains "." but does not contain
727 the file), protoc incorrectly thought that the file was under ".", because
728 it thought that the path was relative (since it didn't start with a slash).
729 This has been fixed.
kenton@google.com9f175282008-11-25 19:37:10 +0000730
731 C++
732 * Generated message classes now have a Swap() method which efficiently swaps
733 the contents of two objects.
734 * All message classes now have a SpaceUsed() method which returns an estimate
735 of the number of bytes of allocated memory currently owned by the object.
736 This is particularly useful when you are reusing a single message object
737 to improve performance but want to make sure it doesn't bloat up too large.
738 * New method Message::SerializeAsString() returns a string containing the
739 serialized data. May be more convenient than calling
740 SerializeToString(string*).
741 * In debug mode, log error messages when string-type fields are found to
742 contain bytes that are not valid UTF-8.
743 * Fixed bug where a message with multiple extension ranges couldn't parse
744 extensions.
745 * Fixed bug where MergeFrom(const Message&) didn't do anything if invoked on
746 a message that contained no fields (but possibly contained extensions).
747 * Fixed ShortDebugString() to not be O(n^2). Durr.
748 * Fixed crash in TextFormat parsing if the first token in the input caused a
749 tokenization error.
750 * Fixed obscure bugs in zero_copy_stream_impl.cc.
751 * Added support for HP C++ on Tru64.
752 * Only build tests on "make check", not "make".
753 * Fixed alignment issue that caused crashes when using DynamicMessage on
754 64-bit Sparc machines.
755 * Simplify template usage to work with MSVC 2003.
756 * Work around GCC 4.3.x x86_64 compiler bug that caused crashes on startup.
757 (This affected Fedora 9 in particular.)
kenton@google.com25bc5cd2008-12-04 20:34:50 +0000758 * Now works on "Solaris 10 using recent Sun Studio".
kenton@google.com9f175282008-11-25 19:37:10 +0000759
760 Java
761 * New overload of mergeFrom() which parses a slice of a byte array instead
762 of the whole thing.
763 * New method ByteString.asReadOnlyByteBuffer() does what it sounds like.
764 * Improved performance of isInitialized() when optimizing for code size.
765
766 Python
767 * Corrected ListFields() signature in Message base class to match what
768 subclasses actually implement.
769 * Some minor refactoring.
kenton@google.com2f669cb2008-12-02 05:59:15 +0000770 * Don't pass self as first argument to superclass constructor (no longer
771 allowed in Python 2.6).
kenton@google.com9f175282008-11-25 19:37:10 +0000772
kenton@google.com9b10f582008-09-30 00:09:40 +00007732008-09-29 version 2.0.2:
774
kenton@google.com24bf56f2008-09-24 20:31:01 +0000775 General
776 * License changed from Apache 2.0 to New BSD.
777 * It is now possible to define custom "options", which are basically
778 annotations which may be placed on definitions in a .proto file.
779 For example, you might define a field option called "foo" like so:
780 import "google/protobuf/descriptor.proto"
781 extend google.protobuf.FieldOptions {
782 optional string foo = 12345;
783 }
784 Then you annotate a field using the "foo" option:
785 message MyMessage {
786 optional int32 some_field = 1 [(foo) = "bar"]
787 }
788 The value of this option is then visible via the message's
789 Descriptor:
790 const FieldDescriptor* field =
791 MyMessage::descriptor()->FindFieldByName("some_field");
792 assert(field->options().GetExtension(foo) == "bar");
793 This feature has been implemented and tested in C++ and Java.
794 Other languages may or may not need to do extra work to support
795 custom options, depending on how they construct descriptors.
796
797 C++
798 * Fixed some GCC warnings that only occur when using -pedantic.
799 * Improved static initialization code, making ordering more
800 predictable among other things.
801 * TextFormat will no longer accept messages which contain multiple
802 instances of a singular field. Previously, the latter instance
kenton@google.com9b10f582008-09-30 00:09:40 +0000803 would overwrite the former.
kenton@google.com24bf56f2008-09-24 20:31:01 +0000804 * Now works on systems that don't have hash_map.
805
kenton@google.com9b10f582008-09-30 00:09:40 +0000806 Java
807 * Print @Override annotation in generated code where appropriate.
808
kenton@google.com24bf56f2008-09-24 20:31:01 +0000809 Python
810 * Strings now use the "unicode" type rather than the "str" type.
811 String fields may still be assigned ASCII "str" values; they will
812 automatically be converted.
813 * Adding a property to an object representing a repeated field now
814 raises an exception. For example:
815 # No longer works (and never should have).
816 message.some_repeated_field.foo = 1
kenton@google.com9b10f582008-09-30 00:09:40 +0000817
818 Windows
819 * We now build static libraries rather than DLLs by default on MSVC.
820 See vsprojects/readme.txt for more information.
821
temporala44f3c32008-08-15 18:32:02 +00008222008-08-15 version 2.0.1:
kenton@google.com9b10f582008-09-30 00:09:40 +0000823
824 protoc
825 * New flags --encode and --decode can be used to convert between protobuf text
826 format and binary format from the command-line.
827 * New flag --descriptor_set_out can be used to write FileDescriptorProtos for
828 all parsed files directly into a single output file. This is particularly
829 useful if you wish to parse .proto files from programs written in languages
830 other than C++: just run protoc as a background process and have it output
831 a FileDescriptorList, then parse that natively.
832 * Improved error message when an enum value's name conflicts with another
833 symbol defined in the enum type's scope, e.g. if two enum types declared
834 in the same scope have values with the same name. This is disallowed for
temporala44f3c32008-08-15 18:32:02 +0000835 compatibility with C++, but this wasn't clear from the error.
kenton@google.com9b10f582008-09-30 00:09:40 +0000836 * Fixed absolute output paths on Windows.
temporala44f3c32008-08-15 18:32:02 +0000837 * Allow trailing slashes in --proto_path mappings.
kenton@google.com9b10f582008-09-30 00:09:40 +0000838
839 C++
840 * Reflection objects are now per-class rather than per-instance. To make this
841 possible, the Reflection interface had to be changed such that all methods
842 take the Message instance as a parameter. This change improves performance
843 significantly in memory-bandwidth-limited use cases, since it makes the
844 message objects smaller. Note that source-incompatible interface changes
845 like this will not be made again after the library leaves beta.
temporala44f3c32008-08-15 18:32:02 +0000846 * Heuristically detect sub-messages when printing unknown fields.
kenton@google.com9b10f582008-09-30 00:09:40 +0000847 * Fix static initialization ordering bug that caused crashes at startup when
temporala44f3c32008-08-15 18:32:02 +0000848 compiling on Mac with static linking.
kenton@google.com9b10f582008-09-30 00:09:40 +0000849 * Fixed TokenizerTest when compiling with -DNDEBUG on Linux.
850 * Fixed incorrect definition of kint32min.
temporala44f3c32008-08-15 18:32:02 +0000851 * Fix bytes type setter to work with byte sequences with embedded NULLs.
852 * Other irrelevant tweaks.
853
kenton@google.com9b10f582008-09-30 00:09:40 +0000854 Java
855 * Fixed UnknownFieldSet's parsing of varints larger than 32 bits.
856 * Fixed TextFormat's parsing of "inf" and "nan".
857 * Fixed TextFormat's parsing of comments.
858 * Added info to Java POM that will be required when we upload the
temporala44f3c32008-08-15 18:32:02 +0000859 package to a Maven repo.
860
kenton@google.com9b10f582008-09-30 00:09:40 +0000861 Python
862 * MergeFrom(message) and CopyFrom(message) are now implemented.
863 * SerializeToString() raises an exception if the message is missing required
864 fields.
865 * Code organization improvements.
866 * Fixed doc comments for RpcController and RpcChannel, which had somehow been
temporala44f3c32008-08-15 18:32:02 +0000867 swapped.
kenton@google.com9b10f582008-09-30 00:09:40 +0000868 * Fixed text_format_test on Windows where floating-point exponents sometimes
869 contain extra zeros.
temporala44f3c32008-08-15 18:32:02 +0000870 * Fix Python service CallMethod() implementation.
871
872 Other
873 * Improved readmes.
874 * VIM syntax highlighting improvements.
875
temporal40ee5512008-07-10 02:12:20 +00008762008-07-07 version 2.0.0:
877
878 * First public release.