Skip to content

Latest commit

 

History

History
1093 lines (873 loc) · 133 KB

CHANGELOG.md

File metadata and controls

1093 lines (873 loc) · 133 KB

Changelog

7.2.0 (2023-01-24)

Features

  • cli: generate static files at the granularity of proto messages (#1840) (32f2d6a)

Bug Fixes

7.1.2 (2022-09-22)

Bug Fixes

7.1.1 (2022-09-09)

Bug Fixes

  • add import long to the generated .d.ts (#1802) (7c27b5a)
  • generate valid js code for aliased enum values (#1801) (7120e93)

7.1.0 (2022-08-26)

Features

Bug Fixes

7.0.0 (2022-07-08)

⚠ BREAKING CHANGES

  • drop support for Node 4, 6, 8, 10 (#1764)
  • move command line tool to a new package named protobufjs-cli (#1234)
  • encoding of empty Buffers (#1514)

Features

Bug Fixes

6.10.2 (2020-11-13)

Bug Fixes

6.10.1 (2020-07-16)

Bug Fixes

  • make node detection a bit more forgiving (#1445) (4e75f6d)

6.10.0 (2020-07-13)

Features

Bug Fixes

6.9.0 (2020-04-17)

Features

Bug Fixes

  • allow file-level options everywhere in the file (b70eebd)
  • Import Long types (1d98cb8)
  • npm audit fixes (ca52447)
  • properly iterate and return method descriptors (d96bb7a)
  • run npm audit fix (#1208) (b5b6632)
  • docs: update CHANGELOG to match format of release-please (#1376) (15ed8a0)

Fixed

#️⃣ Persist recent index.d.ts changes in JSDoc

Fixed

#️⃣ Fix package browser field descriptor (#1046)
#️⃣ Fix static codegen issues with uglifyjs3
#️⃣ Fix lint issues / pbts on windows
#️⃣ Fix empty 'bytes' field decoding, now using Buffer where applicable (#1020)
#️⃣ Fix circular dependency of Namespace and Enum (#994)
#️⃣ Ignore optional commas in aggregate options (#999)

New

#️⃣ Make Message have a default type param (#1086)
#️⃣ Explicitly define service method names when generating static code, see #857
#️⃣ Also handle services in ext/descriptor (#1001)

CLI

#️⃣ Extend list of ignored ESLint rules for pbjs, fixes #1085
#️⃣ Fix declared return type of pbjs/pbts callback (#1025)
#️⃣ Added an option to pbts to allow custom imports (#1038)
#️⃣ Get node executable path from process.execPath (#1018)

Other

#️⃣ Slim down CI testing and remove some not ultimately necesssary dependencies with audit issues
#️⃣ Move global handling to util, see #995

Fixed

#️⃣ Fix typeRefRe being vulnerable to ReDoS

New

#️⃣ Preserve comments when serializing/deserializing with toJSON and fromJSON. (#983)
#️⃣ Add more details to some frequent error messages (#962)
#️⃣ Add IParseOptions#alternateCommentMode (#968)
#️⃣ Added field_mask to built-in common wrappers (#982)

Other

#️⃣ Remove code climate config in order to use 'in-app' config instead

Other

#️⃣ Update jsdoc dependency (pinned vulnerable marked)

CLI

#️⃣ Use correct safeProp in json-module target, see #956

Other

#️⃣ Include dist files in npm package, see #955

Fixed

#️⃣ Prevent invalid JSDoc names when generating service methods, see #870
#️⃣ Prevent parse errors when generating service method names, see #870
#️⃣ Support parsing nested option-values with or without ':' (#951, fixes #946)
#️⃣ Add support for reserved keyword in enums (#950, fixes #949)
#️⃣ Unified safe property escapes and added a test for #834
#️⃣ Fix codegen if type name starts with "Object"
#️⃣ Fixed dependency for json-module to use "light".
#️⃣ Basic support for URL prefixes in google.protobuf.Any types.
#️⃣ fixed 'error is not defined linter warning when using static/static-module and es6
#️⃣ Fixed wrong type_url for any type (no leading '.' allowed).
#️⃣ Fixed fromObject() for google.protobuf.Any types.
#️⃣ Handle case where 'extendee' is undefined in ext/descriptor

CLI

#️⃣ Sanitize CR-only line endings (coming from jsdoc?)
#️⃣ Make sure enum typings become generated (#884 didn't solve this)
#️⃣ Remove exclude and include patterns from jsdoc config
#️⃣ Skip defaults when generating proto3
#️⃣ Wait for both the 'end' and 'close' event to happen before finishing in pbts, see #863
#️⃣ Accept null for optional fields in generated static code
#️⃣ Annotate TS classes with @implements
#️⃣ Annotate virtual oneofs as string literal unions

New

#️⃣ Also check for reserved ids and names in enums
#️⃣ Also support 'reserved' in enum descriptors

Other

#️⃣ Include just relevant files in npm package, fixes #781
#️⃣ Fix travis build

Breaking

#️⃣ Replaced Buffer and Long types with interfaces and removed stubs
#️⃣ Removed Message#toObject in favor of having just the static version (unnecessary static code otherwise)
#️⃣ Everything uses interfaces now instead of typedefs (SomethingProperties is now ISomething)
#️⃣ ReflectionObject#toJSON properly omits explicit undefined values
#️⃣ Initial implementation of TypeScript decorators
#️⃣ Refactored protobuf.Class away
#️⃣ TypeScript definitions now have (a lot of) generics
#️⃣ Removed deprecated features

Fixed

#️⃣ Added 'undefined' besides 'null' as a valid value of an optional field, fixes #826
#️⃣ Fixed an issue with codegen typings, see #819
#️⃣ Ported utf8 chunking mechanism to base64 as well, fixes #800
#️⃣ Also be more verbose when defining properties for ES6, fixes #820
#️⃣ Generate more verbose JSDoc comments for ES6 support, fixes #820
#️⃣ Emit a maximum of one error var when generating verifiers, fixes #786
#️⃣ Fixed missing semicolon after 'extensions' and 'reserved' when generating proto files, fixes #810
#️⃣ Call npm with '--no-bin-links' when installing CLI deps, fixes #823
#️⃣ Fix Reader argument conversion in static module
#️⃣ Use JSDoc, they said, it documents code, they said. Fixes #770
#️⃣ parser should not confuse previous trailing line comments with comments for the next declaration, see #762
#️⃣ Types should not clear constructor with cache (fixes decorators)
#️⃣ Namespace#lookup should also check in nested namespaces (wtf)
#️⃣ Reader#bytes should also support plain arrays
#️⃣ Fix markdown for pipe in code in table

New

#️⃣ Upgrade to codegen 2
#️⃣ ext/descriptor enables interoperability between reflection and descriptor.proto (experimental), see #757
#️⃣ Added 'json' conversion option for proto3 JSON mapping compatibility of NaN and Infinity + additional documentation of util.toJSONOptions, see #351

CLI

#️⃣ Use protobuf/minimal when pbjs target is static-module
#️⃣ Added closure wrapper
#️⃣ Various improvements to statically generated JSDoc, also fixes #772
#️⃣ Check incompatible properties for namespaces only in tsd-jsdoc
#️⃣ Additional tsd-jsdoc handling of properties inside of namespaces and TS specific API exposure
#️⃣ Several improvements to tsd-jsdoc emitted comments
#️⃣ Further TypeScript definition improvements
#️⃣ Relieved tsd files from unnecessary comments
#️⃣ Generate TS namespaces for vars and functions with properties
#️⃣ Prefer @tstype over @type when generating typedefs (tsd-jsdoc)

Docs

#️⃣ Replaced nullable types with explicit type|null for better tooling compatibility, also fixes #766 and fixes 767
#️⃣ Added more info to ext/descriptor README, see #757
#️⃣ Additional notes on ext/descriptor
#️⃣ Updated CHANGELOG so everyone knows what's going on (and soon, breaking)
#️⃣ Additional docs on TS/decorators usage

Other

#️⃣ Updated dist files
#️⃣ Added package-lock.json
#️⃣ Minor formatting
#️⃣ Generate files
#️⃣ Remove the no-constructor arg
#️⃣ Remove the ctor option.
#️⃣ Add support to generate types for JSON object.
#️⃣ aspromise performance pass
#️⃣ codegen 2 performance pass, #653 might benefit
#️⃣ Fixed minimal library including reflection functionality
#️⃣ Minor compression ratio tuning
#️⃣ Fixed failing test case + coverage
#️⃣ Improved fromObject wrapper for google.protobuf.Any.
#️⃣ Fixed failing tokenize test case
#️⃣ Removed debug build, made it an extension
#️⃣ Regenerated dist files
#️⃣ Even more documentation and typings for ext/descriptor
#️⃣ ext/descriptor docs
#️⃣ Decorators coverage
#️⃣ ext/descriptor support for various standard options, see #757
#️⃣ ext/descriptor passes descriptor.proto test with no differences, see #757
#️⃣ Properly remove unnecessary (packed) options from JSON descriptors
#️⃣ Use typedefs in ext/descriptor (like everywhere else), see #757
#️⃣ Fixed obvious issues with ext/descriptor, does not throw anymore when throwing descriptor.proto itself at it, see #757
#️⃣ Added still missing root traversal to ext/descriptor, see #757
#️⃣ Initial map fields support for ext/descriptor, see #757
#️⃣ Added infrastructure for TypeScript support of extensions
#️⃣ TypeScript generics improvements
#️⃣ More ext/descriptor progress, see #757
#️⃣ Just export the relevant namespace in ext/descriptor
#️⃣ Initial descriptor.proto extension for reflection interoperability, see #757
#️⃣ Moved custom wrappers to its own module instead, also makes the API easier to use manually, see #677
#️⃣ Added infrastructure for custom wrapping/unwrapping of special types, see #677
#️⃣ More decorator progress (MapField.d, optional Type.d)
#️⃣ tsd-jsdoc now has limited generics support

Other

#️⃣ long, @types/long and @types/node are just dependencies, see #753

New

#️⃣ Split up NamespaceDescriptor to make nested plain namespaces a thing, see #749

Docs

#️⃣ More README
#️⃣ Replaced 'runtime message' with 'message instance' for clarity
#️⃣ Rephrased the Usage section around the concept of valid messages
#️⃣ Added toolset diagram to README

Other

#️⃣ Touched benchmark output metrics once more
#️⃣ Fixed failing browser test
#️⃣ Output more human friendly metrics from benchmark
#️⃣ Stripped down static bench code to what's necessary
#️⃣ Revamped benchmark, now also covers Google's JS implementation
#️⃣ Updated dependencies and dist files

New

#️⃣ Made .verify behave more like .encode, see #710

CLI

#️⃣ With null/undefined eliminated by constructors and .create, document message fields as non-optional where applicable (ideally used with TS & strictNullChecks), see #743
#️⃣ Renamed --strict-long/message to --force-long/message with backward compatible aliases, see #741
#️⃣ Keep $Properties with --strict-message but require actual instances within, see #741
#️⃣ Added --strict-message option to pbjs to strictly reference message instances instead of $Properties, see #741

Docs

#️⃣ Restructured README
#️⃣ Added more information on typings usage, see #744
#️⃣ Clarified typescript example in README, see #744
#️⃣ Clarified that the service API targets clients consuming a service, see #742

Other

#️⃣ Omit copying of undefined or null in constructors and .create, see #743

Breaking

#️⃣ Namespace#lookupEnum should actually look up the reflected enum and not just its values
#️⃣ Decoder now throws if required fields are missing, see #695 / #696

Fixed

#️⃣ Added functionality to filter for multiple types at once in lookup(), used by lookupTypeOrEnum(), fixes #740
#️⃣ Ensure that fields have been resolved when looking up js types in static target, see #731
#️⃣ Properly copy fields array before sorting in toObject, fixes #729
#️⃣ Actually emit TS compatible enums in static target if not aliases, see #720
#️⃣ Hardened tokenize/parse, esp. comment parsing, see #713
#️⃣ Exclude any fields part of some oneof when populating defaults in toObject, see #710
#️⃣ Most of the parser is not case insensitive, see #705
#️⃣ Retain options argument in Root#load when used with promises, see #684

New

#️⃣ Created a micromodule from (currently still bundled) float support
#️⃣ util.isset(obj, prop) can be used to test if a message property is considered to be set, see #728
#️⃣ Implemented stubs for long.js / node buffers to be used where either one isn't wanted, see #718
#️⃣ Simplified reusing / replacing internal constructors
#️⃣ Constructors/.create always initialize proper mutable objects/arrays, see #700
#️⃣ Verifiers return an error if multiple fields part of the same oneof are set, see #710
#️⃣ Added oneofs: true to ConversionOptions, see #710
#️⃣ Optional fields handle null just like undefined regardless of type see #709
#️⃣ Encoders no longer examine virtual oneof properties but encode whatever is present, see #710
#️⃣ pbjs now generates multiple exports when using ES6 syntax, see #686
#️⃣ Sequentially serialize fields ordered by id, as of the spec.
#️⃣ decode throws specific ProtocolError with a reference to the so far decoded message if required fields are missing + example
#️⃣ Reader.create asserts that buffer is a valid buffer, see #695

CLI

#️⃣ Exclude JSDoc on typedefs from generated d.ts files because typescript@next, see #737
#️⃣ Prepare static code with estraverse instead of regular expressions, see #732
#️⃣ Moved tsd-jsdoc to future cli package, see #716
#️⃣ $Properties are just a type that's satisfied, not implemented, by classes, see #723
#️⃣ More progress on decoupling the CLI
#️⃣ Fixed computed array indexes not being renamed in static code, see #726
#️⃣ Check upfront if key-var is required in static decoders with maps, see #726
#️⃣ Fixed handling of stdout if callback is specified, see #724
#️⃣ Preparations for moving the CLI to its own package, see #716
#️⃣ Properly implement $Properties interface in JSDoc, see #723
#️⃣ Recursively use $Properties inside of $Properties in static code, see #717
#️⃣ Added --strict-long option to pbjs to always emit 'Long' instead of 'number|Long' (only relevant with long.js), see #718
#️⃣ Statically emitted long type is 'Long' now instead of '$protobuf.Long', see #718
#️⃣ Decoupled message properties as an interface in static code for TS intellisense support, see #717
#️⃣ Static code statically resolves types[..], see #715

Docs

#️⃣ Added type definitions for all possible JSON descriptors
#️⃣ Explained the JSON structure in README and moved CLI specific information to the CLI package
#️⃣ Added information on how to use the stubs to README, see #718
#️⃣ Added 'What is a valid message' section to README
#️⃣ Added a hint on using .create to initial example
#️⃣ Even more usage for README
#️⃣ Additional information on general usage (README)
#️⃣ Restructured README to Installation, Usage and Examples sections
#️⃣ Added a longish section on the correct use of the toolset to README
#️⃣ Added a few additional notes on core methods to README, see #710
#️⃣ Extended traverse-types example, see #693
#️⃣ Better explain how .verify, .encode and .decode are connected
#️⃣ Documented that Type#encode respectively Message.encode do not implicitly .verify, see #696 [ci-skip]
#️⃣ Documented throwing behavior of Reader.create and Message.decode
#️⃣ Added error handling notes to README, see #696

Other

#️⃣ Use @protobufjs/float
#️⃣ Rebuilt dist files for 6.7.0
#️⃣ Updated deps, ts fixes and regenerated dist files
#️⃣ Manually merged gentests improvements, fixes #733
#️⃣ Make sure that util.Long is overridden by AMD loaders only if present, see #730
#️⃣ Coverage for util.isset and service as a namespace
#️⃣ Shortened !== undefined && !== null to equivalent != null in static code
#️⃣ With stubs in place, 'number|Long' return values can be just 'Long' instead, see #718
#️⃣ Just alias as the actual ideal type when using stubs, see #718
#️⃣ General cleanup + regenerated dist/test files
#️⃣ Simplified camel case regex, see #714
#️⃣ Regenerated dist files and changelog for 6.7.0
#️⃣ Retain alias order in static code for what it's worth, see #712
#️⃣ Everything can be block- or line-style when parsing, see #713
#️⃣ Determine necessary aliases depending on config, see #712
#️⃣ Use more precise types for message-like plain objects
#️⃣ Regenerated dist files
#️⃣ Regenerated relevant files
#️⃣ Moved field comparer to util
#️⃣ Updated tests to use new simplified encoder logic
#️⃣ Updated path to tsd-jsdoc template used by pbts, see #707
#️⃣ Additional restructuring for moving configuration files out of the root folder
#️⃣ Added codegen support for constructor functions, see #700
#️⃣ Attempted to fix broken custom error test
#️⃣ Trying out a more aggressive aproach for custom error subclasses
#️⃣ Moved a few things out of the root folder
#️⃣ Coverage for encoder compat. / protocolerror
#️⃣ Updated dist and generated test files
#️⃣ Added tslint
#️⃣ Exclude dist/ from codeclimate checks
#️⃣ Also lint cli utilities
#️⃣ Cache any regexp instance (perf)
#️⃣ Use code climate badges
#️⃣ Updated travis to pipe to codeclimate, coverage
#️⃣ More precise linter configuration
#️⃣ Added codeclimate
#️⃣ Moved cli deps placeholder creation to post install script

Fixed

#️⃣ sfixed64 is not zig-zag encoded, see #692

CLI

#️⃣ Added a placeholder to cli deps node_modules folder to make sure node can load from it

Other

#️⃣ Restructured a few failing tests
#️⃣ Traversal example + minimalistic documentation
#️⃣ Added a custom getters/setters example for gRPC

Fixed

#️⃣ Made sure that LongBits ctor is always called with unsigned 32 bits + static codegen compat., fixes #690
#️⃣ Properly handle multiple ../.. in path.normalize, see #688
#️⃣ Post-merge, also tackles #683 (packed option for repeated enum values)

New

#️⃣ Verify accepts non-null objects only, see #685
#️⃣ allow_alias enum option was not being honored. This case is now handled and a test case was added

CLI

#️⃣ Added an experimental --sparse option to limit pbjs output to actually referenced types within main files

Docs

#️⃣ Added explicit hint on Uint8Array to initial example, see #670

Other

#️⃣ Ranges and names support for reserved fields, see #676
#️⃣ Updated depdendencies / rebuilt dist files
#️⃣ Use ?: instead of |undefined in .d.ts files
#️⃣ Mark optional fields as possibly being undefined
#️⃣ Added a few more common google types from google/api, see #433
#️⃣ Minor optimizations to dependencies, build process and tsd

Fixed

#️⃣ Support node 4.2.0 to 4.4.7 buffers + travis case, see #665

CLI

#️⃣ Added ES6 syntax flag to pbjs, see #667

Docs

#️⃣ Reference Buffer for BufferReader/Writer, see #668
#️⃣ Slightly shortened README
#️⃣ Additional notes on the distinction of different use cases / distributions, see #666
#️⃣ Extended README with additional information on JSON format
#️⃣ Added extended usage instructions for TypeScript and custom classes to README, see #666

Other

#️⃣ Updated dist files
#️⃣ Updated test cases to use new buffer util
#️⃣ Added fetch test cases + some test cleanup

Fixed

#️⃣ Properly replace short vars when beautifying static code, see #663
#️⃣ Use custom prelude in order to exclude any module loader code from source (for webpack), see #658
#️⃣ Make sure to check optional inner messages for null when encoding, see #658

New

#️⃣ Initial attempt on a backwards compatible fetch implementation with binary support, see #661

Other

#️⃣ Root#resolvePath skips files when returning null, see #368
#️⃣ Changes callback on failed response decode in rpc service to pass actual error instead of 'error' string
#️⃣ Travis should exit with the respective error when running sauce tests
#️⃣ Moved checks whether a test case is applicable to parent case
#️⃣ Added eventemitter tests and updated micromodule dependencies (so far)
#️⃣ Added lib/path tests and updated a few dependencies
#️⃣ Moved micro modules to lib so they can have their own tests etc.
#️⃣ Updated travis

Fixed

#️⃣ Properly set up reflection when using light build

Breaking

#️⃣ Inlined / refactored away .testJSON, see #653
#️⃣ Refactored util.extend away
#️⃣ Reflected and statically generated services use common utility, now work exactly the same
#️⃣ fromObject now throws for entirely bogus values (repeated, map and inner message fields), fixes #601
#️⃣ Cleaned up library distributions, now is full / light / minimal with proper browserify support for each

Fixed

#️⃣ Do not randomly remove slashes from comments, fixes #656
#️⃣ Properly parse nested textformat options, also tackles #655

New

#️⃣ Relieved the requirement to call .resolveAll() on roots in order to populate static code-compatible properties, see #653
#️⃣ Added a (highly experimental) debug build as a starting point for #653
#️⃣ Full build depends on light build depends on minimal build, shares all relevant code

CLI

#️⃣ Also reuse specified root in pbjs for JSON modules, see #653
#️⃣ Reuse specified root name in pbjs to be able to split definitions over multiple files more easily, see #653

Docs

#️⃣ Improved pbjs/pbts examples, better covers reflection with definitions for static modules
#️⃣ Fixed centered formatting on npm

Other

#️⃣ Various other minor improvements / assertions refactored away, see #653
#️⃣ Fixed some common reflection deopt sites, see #653
#️⃣ Reflection performance pass, see #653
#️⃣ Added TS definitions to alternative builds' index files
#️⃣ Removed unnecessary prototype aliases, improves gzip ratio
#️⃣ Unified behaviour of and docs on Class constructor / Class.create
#️⃣ Statically generated services actually inherit from rpc.Service
#️⃣ Do not try to run sauce tests for PRs
#️⃣ Added utility to enable/disable debugging extensions to experimental debug build
#️⃣ Fixed node 0.12 tests
#️⃣ Fixed coverage
#️⃣ Added a test case for #652

Other

#️⃣ In fromObject, check if object is already a runtime message, see #652

Docs

#️⃣ Added coverage reporting

CLI

#️⃣ Added version scheme warning to everything CLI so that we don't need this overly explicit in README

Other

#️⃣ Coverage progress, 100%
#️⃣ Coverage progress
#️⃣ Attempted to fix badges once and for all
#️⃣ Coverage progress

CLI

#️⃣ Reuse module paths when looking up cli dependencies, see #648
#️⃣ Check actual module directories to determine if cli dependencies are present and bootstrap semver, see #648

Docs

#️⃣ Added a note on semver-incompatibility, see #649

Other

#️⃣ Coverage progress

Breaking

#️⃣ Initial upgrade of converters to real generated functions, see #620

Fixed

#️⃣ An enum's default value present as a string looks up using typeDefault, not defaultValue which is an array if repeated
#️⃣ Use common utility for virtual oneof getters and setters in both reflection and static code, see #644
#️⃣ Properly use Type.toObject/Message.toObject within converters, see #641
#️⃣ Generate null/undefined assertion in fromObject if actually NOT an enum, see #620
#️⃣ Replace ALL occurencies of types[%d].values in static code, see #641

New

#️⃣ Switched to own property-aware encoders for compatibility, see #639
#️⃣ Now also parses comments, sets them on reflected objects and re-uses them when generating static code, see #640

CLI

#️⃣ Further improved generated static code style
#️⃣ Removed scoping iifes from generated static code
#️⃣ Removed even more clutter from generated static code
#️⃣ Removed various clutter from generated static code
#️⃣ Made sure that static target's replacement regexes don't match fields
#️⃣ Also accept (trailing) triple-slash comments for compatibility with protoc-gen-doc, see #640
#️⃣ Use semver to validate that CLI dependencies actually satisfy the required version, see #637

Docs

#️⃣ Added a hint on documenting .proto files for static code
#️⃣ Documented internally used codegen partials for what it's worth
#️⃣ Updated converter documentation

Other

#️⃣ Bundler provides useful stuff to uglify and a global var without extra bloat
#️⃣ Cleaned and categorized tests, coverage progress
#️⃣ Properly removed builtins from bundle
#️⃣ Call hasOwnProperty builtin as late as possible decreasing the probability of having to call it at all (perf)
#️⃣ Slightly hardened codegen sprintf
#️⃣ Significantly improved uint32 write performance
#️⃣ Cleaned up test case data and removed unused files
#️⃣ Removed now useless trailing comment checks, see #640
#️⃣ Ensured that pbjs' beautify does not break regular expressions in generated verify functions

Fixed

#️⃣ Case-sensitively test for legacy group definitions, fixes #638
#️⃣ Properly parse text format options + simple test case, fixes #636

Docs

#️⃣ Added SVG logo, see #629

Other

#️⃣ Also refactored Service and Type to inherit from NamespaceBase, see #635
#️⃣ Moved TS-compatible Namespace features to a virtual NamespaceBase class, compiles with strictNullChecks by default now, see #635
#️⃣ Minor codegen enhancements

Fixed

#️⃣ Properly handle empty/noop Writer#ldelim, fixes #625
#️⃣ Properly annotate map fields in pbjs, fixes #624

New

#️⃣ Made sure that Writer#bytes is always able to handle plain arrays

Other

#️⃣ Slightly restructured utility to better support static code default values

Fixed

#️⃣ Dynamically resolve jsdoc when running pbts, fixes #622

Docs

#️⃣ Explain 6.4.2 vs 6.4.3 in changelog

Fixed

#️⃣ Fixed invalid definition of Field#packed property, also introduced decoder.compat mode (packed fields, on by default)
#️⃣ Always decode packed/non-packed based on wire format only, see #602
#️⃣ Use full library for JSON modules and runtime dependency for static modules, fixes #621

CLI

#️⃣ Additional workarounds for on demand CLI dependencies, see #618
#️⃣ Revised automatic setup of cli dependencies, see #618

Other

#️⃣ Removed Android 4.0 test (no longer supported by sauce)
#️⃣ Removed some unused utility, slightly more efficient codegen, additional comments
#️⃣ Updated tests for new package.json layout
#️⃣ Added break/continue label support to codegen
#️⃣ Updated dependencies, rebuilt dist files and changed logo to use an absolute url

6.4.2 had been accidentally published as 6.4.3.

Fixed

#️⃣ Added more default value checks to converter, fixes #616
#️⃣ Respect long defaults in converters
#️⃣ Convert inner messages and undefined/null values more thoroughly, fixes #615
#️⃣ Always use first defined enum value as field default, fixes #613
#️⃣ Install correct 'tmp' dependency when running pbts without dev dependencies installed, fixes #612

New

#️⃣ Generate named constructors for runtime messages, see #588

CLI

#️⃣ pbjs/pbts no longer generate any volatile headers, see #614

Docs

#️⃣ Attempted to make broken shields less annoying
#️⃣ Updated README

Other

#️⃣ Some cleanup and added a logo
#️⃣ use $protobuf.Long

Breaking

#️⃣ Dropped IE8 support
#️⃣ Removed now unused util.longNeq which was used by early static code

Fixed

#️⃣ Do not swallow errors in loadSync, also accept negative enum values in Enum#add, fixes #609
#️⃣ Improved bytes field support, also fixes #606
#️⃣ Fall back to browser Reader when passing an Uint8Array under node, fixes #605
#️⃣ Respect optional properties when writing interfaces in tsd-jsdoc, fixes #598

New

#️⃣ Instead of protobuf.parse.keepCase, fall back to protobuf.parse.defaults holding all possible defaults, see #608
#️⃣ Added global ParseOptions#keepCase fallback as protobuf.parse.keepCase, see #608
#️⃣ Converters use code generation and support custom implementations
#️⃣ Be more verbose when throwing invalid wire type errors, see #602
#️⃣ Added an asJSON-option to always populate array fields, even if defaults=false, see #597
#️⃣ Attempt to improve TypeScript support by using explicit exports
#️⃣ Copy-pasted typescript definitions to micro modules, see #599
#️⃣ Emit an error on resolveAll() if any extension fields cannot be resolved, see #595 + test case

CLI

#️⃣ Removed 'not recommend' label for --keep-case, see #608
#️⃣ Added customizable linter configuration to pbjs
#️⃣ Added stdin support to pbjs and pbts
#️⃣ Static code no longer uses IE8 support utility
#️⃣ Generated static code now supports asJSON/from
#️⃣ Added support for TypeScript enums to pbts
#️⃣ Added a few helpful comments to static code
#️⃣ Slightly beautify statically generated code
#️⃣ Do not wrap main definition as a module and export directly instead
#️⃣ Generate prettier definitions with --no-comments
#️⃣ Added variable arguments support to tsd-jsdoc
#️⃣ Reference dependency imports as a module to prevent name collisions, see #596
#️⃣ Removed now unnecessary comment lines in generated static code

Docs

#️⃣ Added notes on CSP-restricted environments to README, see #593

Other

#️⃣ Added test case for asJSON with arrays=true, see #597
#️⃣ Added a tape adapter to assert message equality accross browsers
#️⃣ Refactored some internal utility away
#️⃣ Reverted previous attempt on #597
#️⃣ Minor tsd-jsdoc refactor
#️⃣ Removed unused sandbox files
#️⃣ Updated package.json of micro modules to reference types, see #599
#️⃣ Reference dependencies as imports in generated typescript definitions, see #596
#️⃣ Allow null values on optional long fields, see #590
#️⃣ Various jsdoc improvements and a workaround for d.ts generation, see #592

Fixed

#️⃣ Empty inner messages are always present on the wire + test case + removed now unused Writer#ldelim parameter, see #585

CLI

#️⃣ Expose tsd-jsdoc's comments option to pbts as --no-comments, see #587
#️⃣ Increase child process max buffer when running jsdoc from pbts, see #587
#️⃣ pbjs now generates more convenient dot-notation property accessors

Other

#️⃣ And fixed IE8 again (should probably just drop IE8 for good)

Breaking

#️⃣ Moved camelCase/underScore away from util to where actually used
#️⃣ Renamed asJSON option keys (enum to enums, long to longs) because enum is a reserved keyword
#️⃣ Moved JSON/Message conversion to its own source file and added Message/Type.from + test case, see #575
#️⃣ Relicensed the library and its components to BSD-3-Clause to match the official implementation (again)
#️⃣ Dropped support for browser buffer entirely (is an Uint8Array anyway), ensures performance and makes things simpler
#️⃣ Removed dead parts of the Reader API
#️⃣ Refactored BufferReader/Writer to their own files and removed unnecessary operations (node always has FloatXXArray and browser buffer uses ieee anyway)
#️⃣ Stripped out fallback encoder/decoder/verifier completely (even IE8 supports codegen), significantly reduces bundle size, can use static codegen elsewhere

Fixed

#️⃣ Actually concatenate mixed custom options when parsing
#️⃣ Fixed a couple of issues with alternative browser builds
#️⃣ Properly set long defaults on prototypes
#️⃣ Fixed reference error in minimal runtime, see #580
#️⃣ Non-repeated empty messages are always present on the wire, see #581
#️⃣ Properly check Buffer.prototype.set with node v4
#️⃣ Prevent NRE and properly annotate verify signature in tsd-jsdoc, fixed #572
#️⃣ Fix directly using Buffer instead of util.Buffer
#️⃣ Added filter type to Namespace#lookup, fixes #569
#️⃣ Fixed parsing enum inner options, see #565
#️⃣ Fixed release links in README files

New

#️⃣ Added a noparse build for completeness
#️⃣ Now compresses .gz files using zopfli to make them useful beyond being just a reference
#️⃣ Updated non-bundled google types folder with missing descriptors and added wrappers to core
#️⃣ Replaced the ieee754 implementation for old browsers with a faster, use-case specific one + simple test case
#️⃣ Added .create to statically generated types and uppercase nested elements to reflection namespaces, see #576
#️⃣ Also added Namespace#getEnum for completeness, see #576
#️⃣ Added Namespace#getEnum and changed #lookupEnum to the same behavior, see #576
#️⃣ Added a heap of coverage comments for usually unused code paths to open things up
#️⃣ Added codegen test to determine if any ancient browsers don't actually support it
#️⃣ Added legacy groups support to pbjs, see #568
#️⃣ Initial support for legacy groups + test case, see #568
#️⃣ Added asJSON bytes as Buffer, see #566

CLI

#️⃣ Annotated callback types in pbjs-generated services, see #582
#️⃣ Removed type/ns alias comment in static target to not confuse jsdoc unnecessarily
#️⃣ Made pbjs use loadSync for deterministic outputs, see #573

Docs

#️⃣ Updated documentation on runtime and noparse builds
#️⃣ Fixed an issue with the changelog generator skipping some commits
#️⃣ Added notes on how to use pbjs and pbts programmatically
#️⃣ Manually sorted old changelog entries
#️⃣ Initial changelog generator, see #574
#️⃣ Added static/JSON module interchangeability to README
#️⃣ Updated README and bundler according to dynamic require calls

Other

#️⃣ Added basic services test case
#️⃣ Just polyfill Buffer.from / .allocUnsafe for good
#️⃣ Added a test case to find out if all the fallbacks are just for IE8
#️⃣ Commented out float assertions in float test including explanation
#️⃣ Expose array implementation used with (older) browsers on util for tests
#️⃣ Updated test cases
#️⃣ Added assumptions to float test case
#️⃣ Updated travis config to use C++11
#️⃣ Updated / added additional LICENSE files where appropriate
#️⃣ Integrated changelog into build process, now also has 'npm run make' for everything, see #574
#️⃣ Minor optimizations through providing type-hints
#️⃣ Reverted shortened switch statements in verifier
#️⃣ Enums can't be map key types
#️⃣ Use custom require (now a micromodule) for all optional modules, see #571
#️⃣ Support usage when size = 0
#️⃣ Reverted aliases frequently used in codegen for better gzip ratio
#️⃣ Shrinked bundle size - a bit
#️⃣ Can finally run with --trace-deopt again without crashes
#️⃣ Other minor optimizations

New

#️⃣ Added ParseOptions to protobuf.parse and --keep-case for .proto sources to pbjs, see #564

Other

#️⃣ Better TypeScript definition support for @property-annotated objects
#️⃣ Can't just inline longNeq but can be simplified
#️⃣ Array abuse and varint optimization
#️⃣ Updated dependencies
#️⃣ Other minor improvements to short ifs
#️⃣ Reader/Writer example

Fixed

#️⃣ Fixed reserved names re, also ensure valid service method names, see #559
#️⃣ Fix d.ts whitespace on empty lines, added tsd-jsdoc LICENSE
#️⃣ Fix asJSON defaults option, make it work for repeated fields.
#️⃣ Inlined any Reader/Writer#tag calls, also fixes #556
#️⃣ Fix building default dist files with explicit runtime=false
#️⃣ Apply asJSON recursively
#️⃣ Ensure working reflection class names with minified builds
#️⃣ Lazily resolve (some) cyclic dependencies, see #560

New

#️⃣ Added protobuf.roots to minimal runtime, see #554
#️⃣ Repo now includes a restructured version of tsd-jsdoc with our changes incorporated for issues/prs, see #550

CLI

#️⃣ Updated pbjs arguments
#️⃣ Pipe tsd-jsdoc output (requires dcodeIO/tsd-jsdoc/master) and respect cwd, see #550
#️⃣ tsd-jsdoc progress

Docs

#️⃣ README

Other

#️⃣ Added GH issue template
#️⃣ Path micromodule, dependencies
#️⃣ Test case for #556
#️⃣ Raw alloc benchmark
#️⃣ Other minor optimizations

Fixed

#️⃣ Properly encode/decode map kv pairs as repeated messages (codegen and fallback), see #547
#️⃣ Make genVerifyKey actually generate conditions for 32bit values and bool, fixes #546
#️⃣ Fix to generation of verify methods for bytes
#️⃣ Take special care of oneofs when encoding (i.e. when explicitly set to defaults), see #542

New

#️⃣ Added Message#asJSON option for bytes conversion
#️⃣ Added Namespace#lookupType and Namespace#lookupService (throw instead of returning null), see #544
#️⃣ Provide prebuilt browser versions of the static runtime

CLI

#️⃣ Initial pbts CLI for generating TypeScript definitions, see #550
#️⃣ Refactored json/static-module targets to use common wrappers
#️⃣ Refactor cli to support multiple built-in wrappers, added named roots instead of always using global.root and added additionally necessary eslint comments, see #540
#️⃣ Annotate namespaces generated by static target, see #550
#️⃣ static target: Basic support for oneof fields, see #542

Docs

#️⃣ Fix to reflection documentation
#️⃣ README on minimal runtime / available downloads
#️⃣ Notes on descriptors vs static modules

Other

#️⃣ A lot of minor optimizations to performance and gzip ratio
#️⃣ Minimized base64 tables

Breaking

#️⃣ Removed as-function overload for Reader/Writer, profiler stub, optimized version of Reader#int32
#️⃣ Refactored Prototype and inherits away, is now Class and Message for more intuitive documentation and type refs

Fixed

#️⃣ Fixed failing test case on node < 6
#️⃣ Fixed serialization order of sfixed64, fixes #536
#️⃣ Fixed serialization order of fixed64, fallback to parseInt with no long lib, see #534
#️⃣ Actually allow undefined as service method type, fixes #528
#️⃣ Do not skip optional delimiter after aggregate options, fixes #520
#️⃣ Verify empty base64 encoded strings for bytes fields, see #535
#️⃣ wrong spell role should be rule
#️⃣ decodeDelimited always forks if writer is specified, see #531
#️⃣ Mimic spec-compliant behaviour in oneof getVirtual, see #523

New

#️⃣ Initial base64 string support for bytes fields, see #535
#️⃣ Initial type-checking verifier, see #526, added to bench out of competition
#️⃣ Initial loadSync (node only), see #529
#️⃣ Initial RPC service implementaion, see #529
#️⃣ added 'defaults' option to Prototype#asJSON, see #521
#️⃣ Use Uint8Array pool in browsers, just like node does with buffers
#️⃣ Also validate map fields, see #526 (this really needs some tests)

CLI

#️⃣ Added json-module target to pbjs, renamed static to static-module, see #522
#️⃣ updated internals and static target to use immutable objects on prototypes

Docs

#️⃣ Added a couple of alternative signatures, protobuf.load returns promise or undefined, aliased Reader/Writer-as-function signature with Reader/Writer.create for typed dialects, see #518
#️⃣ Added variations for Root#load, see #527
#️⃣ Added benchmark and profile related information to README
#️⃣ Added service example to README, see #529
#️⃣ README on tests
#️⃣ Update README/dist to reflect recent changes
#️⃣ Minimal documentation for micromodules
#️⃣ Document all the callbacks, see #527
#️⃣ Documented streaming-rpc example a bit

Other

#️⃣ Removed the need for triple-slash references in .d.ts by providing a minimal Long interface, see #527, see #530
#️⃣ Transition to micromodules
#️⃣ Refactored argument order of utf8 for plausibility
#️⃣ Restructured reusable micromodules
#️⃣ Can't use Uint8Array#set on node < 6 buffers
#️⃣ Test case for #531
#️⃣ Safer signaling for synchronous load, see #529
#️⃣ Proper end of stream signaling to rpcImpl, see #529
#️⃣ Moved event emitter to util, also accepts listener context, see #529
#️⃣ Probably the worst form of hiding require programmatically, see #527
#️⃣ Attempt to hide require('fs') from webpack, see #527
#️⃣ Trying out jsdoc variations, see #527
#️⃣ by the way, why not include the json->proto functionality into "util"?
#️⃣ Update proto.js
#️⃣ Automatic profile generation and processing
#️⃣ Generalized buffer pool and moved it to util
#️⃣ Make shields visible on npm, yey
#️⃣ More shields, I love shields, and maybe a workaround for travis timing out when sauce takes forever
#️⃣ Trying SauceLabs with higher concurrency

Fixed

#️⃣ Fix packable float/double see #513

New

#️⃣ Handle oneofs in prototype ctor, add non-ES5 fallbacks, test case
#️⃣ Be nice to AMD, allow reconfiguration of Reader/Writer interface

CLI

#️⃣ Initial static codegen target for reference
#️⃣ pbjs static target services support
#️⃣ pbjs static target progress, uses customizable wrapper template
#️⃣ Static pbjs target progress, now generates usable CommonJS code, see #512

Docs

#️⃣ TypeScript example
#️⃣ Adjectives, notes on browserify

Other

#️⃣ Refactor runtime util into separate file, reader/writer uses runtime util
#️⃣ Also optimize reader with what we have learned
#️⃣ More (shameless) writer over-optimization
#️⃣ Trading package size for float speed
#️⃣ Skip defining getters and setters on IE8 entirely, automate defining fallbacks
#️⃣ Unified proto/reflection/classes/static encoding API to always return a writer
#️⃣ plain js utf8 is faster for short strings
#️⃣ improve TypeScript support. add simple test script.
#️⃣ Use long.js dependency in tests, reference types instead of paths in .d.ts see #503
#️⃣ Restructured encoder / decoder to better support static code gen

Fixed

#️⃣ Add support for long strings, fixes #509
#️⃣ expose zero on LongBits, fixes #508
#️⃣ Fixed issues with Root.fromJSON/#addJSON, search global for Long
#️⃣ Properly exclude browserify's annoying _process, again, fixes #502
#️⃣ Remember loaded files earlier to prevent race conditions, fixes #501
#️⃣ Allow negative enum ids even if super inefficient (encodes as 10 bytes), fixes #499, fixes #500
#️⃣ set resolvedResponseType on resolve(), fixes #497

New

#️⃣ Initial take on runtime services, see #507
#️⃣ Include dist/ in npm package for frontend use

CLI

#️⃣ pbjs proto target field options, language-level compliance with jspb test.proto

Docs

#️⃣ always use Uint8Array in docs for tsd, see #503
#️⃣ Notes on dist files

Other

#️⃣ Update eslint env
#️⃣ Browser field in package.json isn't required