CHANGES.txt 60 KB

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