Permalink
Browse files

Breaking: Dropped IE8 support; New: Converters use code generation an…

…d support custom implementations; CLI: Generated static code now supports asJSON/from
  • Loading branch information...
dcodeIO committed Jan 2, 2017
1 parent 39bc103 commit a017bf8a2dbdb7f9e7ce4c026bb6845174feb3b1
Showing with 10,682 additions and 5,263 deletions.
  1. +1 −1 .zuul.yml
  2. +19 −1 CHANGELOG.md
  3. +1 −1 README.md
  4. +13 −7 cli/pbjs.js
  5. +156 −66 cli/targets/static.js
  6. +1 −1 cli/util.js
  7. +2 −1 cli/wrappers/amd.js
  8. +2 −1 cli/wrappers/commonjs.js
  9. +4 −5 cli/wrappers/default.js
  10. +1 −0 cli/wrappers/es6.js
  11. +484 −399 dist/noparse/protobuf.js
  12. +1 −1 dist/noparse/protobuf.js.map
  13. +4 −4 dist/noparse/protobuf.min.js
  14. BIN dist/noparse/protobuf.min.js.gz
  15. +1 −1 dist/noparse/protobuf.min.js.map
  16. +489 −405 dist/protobuf.js
  17. +1 −1 dist/protobuf.js.map
  18. +4 −4 dist/protobuf.min.js
  19. BIN dist/protobuf.min.js.gz
  20. +1 −1 dist/protobuf.min.js.map
  21. +159 −42 dist/runtime/protobuf.js
  22. +1 −1 dist/runtime/protobuf.js.map
  23. +3 −3 dist/runtime/protobuf.min.js
  24. BIN dist/runtime/protobuf.min.js.gz
  25. +1 −1 dist/runtime/protobuf.min.js.map
  26. +94 −43 index.d.ts
  27. +1 −0 package.json
  28. +1 −0 runtime/index.js
  29. +6 −7 src/class.js
  30. +0 −167 src/convert.js
  31. +125 −0 src/converter.js
  32. +131 −0 src/converters.js
  33. +8 −7 src/decoder.js
  34. +11 −9 src/encoder.js
  35. +27 −46 src/enum.js
  36. +6 −11 src/field.js
  37. +1 −0 src/index.js
  38. +14 −3 src/message.js
  39. +7 −7 src/namespace.js
  40. +8 −9 src/object.js
  41. +2 −2 src/oneof.js
  42. +2 −3 src/parse.js
  43. +4 −4 src/root.js
  44. +5 −5 src/service.js
  45. +43 −32 src/type.js
  46. +1 −1 src/util.js
  47. +1 −0 src/util/codegen/index.d.ts
  48. +3 −1 src/util/codegen/index.js
  49. +0 −37 src/util/runtime.js
  50. +9 −8 src/verifier.js
  51. 0 tests/{ambiguous-names.js → ambiguous.js}
  52. +1 −0 tests/convert.js
  53. +161 −65 tests/data/ambiguous-names.js
  54. +636 −291 tests/data/mapbox/vector_tile.js
  55. +439 −236 tests/data/package.js
  56. +161 −66 tests/data/rpc.js
  57. +242 −1 tests/data/test.d.ts
  58. +7,171 −3,243 tests/data/test.js
  59. +3 −3 tests/enum.js
  60. +3 −3 tests/extend-deferred.js
  61. +4 −4 tests/oneof.js
  62. +1 −1 tests/rpc.js
  63. +1 −1 tests/service.js
@@ -9,7 +9,7 @@ browsers:
- name: safari
version: [5, latest]
- name: ie
version: [8, 9, 10, 11]
version: [9, 10, 11]
- name: opera
version: [11, 12]
- name: android
@@ -1,15 +1,33 @@
# [6.3.2](https://github.com/dcodeIO/protobuf.js/releases/tag/6.3.2)
# [6.4.0](https://github.com/dcodeIO/protobuf.js/releases/tag/6.4.0)
## Breaking
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/39bc1031bb502f8b677b3736dd283736ea4d92c1) Removed now unused util.longNeq which was used by early static code<br />
## Fixed
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/7eb3d456370d7d66b0856e32b2d2602abf598516) Respect optional properties when writing interfaces in tsd-jsdoc, fixes [#598](https://github.com/dcodeIO/protobuf.js/issues/598)<br />
## New
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/28ce07d9812f5e1743afef95a94532d2c9488a84) Be more verbose when throwing invalid wire type errors, see [#602](https://github.com/dcodeIO/protobuf.js/issues/602)<br />
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/40074bb69c3ca4fcefe09d4cfe01f3a86844a7e8) Added an asJSON-option to always populate array fields, even if defaults=false, see [#597](https://github.com/dcodeIO/protobuf.js/issues/597)<br />
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/a7d23240a278aac0bf01767b6096d692c09ae1ce) Attempt to improve TypeScript support by using explicit exports<br />
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/cec253fb9a177ac810ec96f4f87186506091fa37) Copy-pasted typescript definitions to micro modules, see [#599](https://github.com/dcodeIO/protobuf.js/issues/599)<br />
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/1f18453c7bfcce65c258fa98a3e3d4577d2e550f) Emit an error on resolveAll() if any extension fields cannot be resolved, see [#595](https://github.com/dcodeIO/protobuf.js/issues/595) + test case<br />
## CLI
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/3c775535517b8385a1d3c1bf056f3da3b4266f8c) Added support for TypeScript enums to pbts<br />
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/0cda72a55a1f2567a5d981dc5d924e55b8070513) Added a few helpful comments to static code<br />
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/24b293c297feff8bda5ee7a2f8f3f83d77c156d0) Slightly beautify statically generated code<br />
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/65637ffce20099df97ffbcdce50faccc8e97c366) Do not wrap main definition as a module and export directly instead<br />
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/65637ffce20099df97ffbcdce50faccc8e97c366) Generate prettier definitions with --no-comments<br />
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/20d8a2dd93d3bbb6990594286f992e703fc4e334) Added variable arguments support to tsd-jsdoc<br />
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/8493dbd9a923693e943f710918937d83ae3c4572) Reference dependency imports as a module to prevent name collisions, see [#596](https://github.com/dcodeIO/protobuf.js/issues/596)<br />
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/39a2ea361c50d7f4aaa0408a0d55bb13823b906c) Removed now unnecessary comment lines in generated static code<br />
## Other
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/805291086f6212d1f108b3d8f36325cf1739c0bd) Reverted previous attempt on [#597](https://github.com/dcodeIO/protobuf.js/issues/597)<br />
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/c5160217ea95996375460c5403dfe37b913d392e) Minor tsd-jsdoc refactor<br />
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/961dd03061fc2c43ab3bf22b3f9f5165504c1002) Removed unused sandbox files<br />
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/f625eb8b0762f8f5d35bcd5fc445e52b92d8e77d) Updated package.json of micro modules to reference types, see [#599](https://github.com/dcodeIO/protobuf.js/issues/599)<br />
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/46ec8209b21cf9ff09ae8674e2a5bbc49fd4991b) Reference dependencies as imports in generated typescript definitions, see [#596](https://github.com/dcodeIO/protobuf.js/issues/596)<br />
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/c0ab94c2e469c0fbf790e4807f24fddd6370e342) Reference dependencies as imports in generated typescript definitions, see [#596](https://github.com/dcodeIO/protobuf.js/issues/596)<br />
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/3bab132b871798c7c50c60a4c14c2effdffa372e) Allow null values on optional long fields, see [#590](https://github.com/dcodeIO/protobuf.js/issues/590)<br />
@@ -541,7 +541,7 @@ Compatibility
* Because the internals of this package do not rely on `google/protobuf/descriptor.proto`, options are parsed and presented literally.
* If typed arrays are not supported by the environment, plain arrays will be used instead.
* Support for pre-ES5 environments like IE8 can be achieved by [using a polyfill](https://github.com/dcodeIO/protobuf.js/blob/master/scripts/polyfill.js) and, instead of using property getters and setters on reflection objects, calling the respective functions prefixed with `get`, `set` or `is` directly (i.e. calling `Type#getFieldsById()` instead of accessing `Type#fieldsById`). Note that this also applies to virtual oneof properties (use `getKind`, `setKind` for example if the oneof is named `kind`).
* Support for pre-ES5 environments (except IE8) can be achieved by [using a polyfill](https://github.com/dcodeIO/protobuf.js/blob/master/scripts/polyfill.js).
* If you need a proper way to work with 64 bit values (uint64, int64 etc.), you can install [long.js](https://github.com/dcodeIO/long.js) alongside this library. All 64 bit numbers will then be returned as a `Long` instance instead of a possibly unsafe JavaScript number ([see](https://github.com/dcodeIO/long.js)).
**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
@@ -26,14 +26,17 @@ exports.main = function(args, callback) {
root : "r"
},
string: [ "target", "out", "path", "wrap", "root" ],
boolean: [ "keep-case", "create", "encode", "decode", "verify", "delimited" ],
boolean: [ "keep-case", "create", "encode", "decode", "verify", "convert", "delimited", "beautify", "comments" ],
default: {
target: "json",
create: true,
encode: true,
decode: true,
verify: true,
delimited: true
target : "json",
create : true,
encode : true,
decode : true,
verify : true,
convert : true,
delimited : true,
beautify : true,
comments : true
}
});
@@ -81,7 +84,10 @@ exports.main = function(args, callback) {
" --no-encode Does not generate encode functions.",
" --no-decode Does not generate decode functions.",
" --no-verify Does not generate verify functions.",
" --no-convert Does not generate convert functions like asJSON and from.",
" --no-delimited Does not generate delimited encode/decode functions.",
" --no-beautify Does not beautify generated code.",
" --no-comments Does not output any JSDoc comments.",
"",
"usage: " + chalk.bold.green("pbjs") + " [options] file1.proto file2.json ..."
].join("\n"));
Oops, something went wrong.

0 comments on commit a017bf8

Please sign in to comment.