CHANGES.txt 64 KB

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