CHANGELOG
Changelog
8.7.2 (2026-08-08)
Bug Fixes
* Also use TextDecoder for loose UTF-8 decoding (#2408) (5851a3b)
* Parse numeric defaults according to field type (#2402) (bb2d836)
* Parse numeric descriptor defaults by field type (#2406) (09f24ec)
* preserve first enum alias from JSON descriptors (#2389) (8304739)
* Preserve negative zero in codegen formatters (#2403) (92ddc9b)
* Preserve non-finite defaults in toObject (#2393) (a38b925)
Performance Improvements
* Optimize writer allocs and packed varint reads (#2405) (64cc8f1)
8.7.1 (2026-07-12)
Bug Fixes
* accept repeated NullValue elements in ProtoJSON (#2373) (ad0b9bb)
* Apply enum options regardless of declaration order (#2384) (b5009b0)
* Base64-encode bytes field defaults in toObject (#2375) (e552511)
* cli: Handle extensions during sparse generation (#2386) (1965d37)
* cli: Match declaration imports to generated modules (#2385) (3cf7420)
* cli: Preserve array element union precedence in pbts (#2378) (2a697a5)
* cli: Resolve imports from cwd by default (#2381) (65f659a)
* Merge repeated message-valued fields within map entries (#2364) (13b417b)
* Parse aggregate objects in option arrays (#2379) (71c2532)
* Parse Any type URLs in aggregate options (#2383) (666fa6b)
* Parse bracketed special field names in options (#2377) (dd1870b)
* Parse map fields inside groups (#2382) (8a2c427)
* Preserve proto names in bundled definitions (#2390) (7ba0557)
* Remove circular LongBits dependency (#2387) (829f5cd)
8.7.0 (2026-07-06)
Features
* Rework encoder architecture and add additional fast paths (#2359) (e912baf)
Bug Fixes
* Preserve parsed json_name in field options (#2363) (1cdd91e)
* Reject truncated declarations without TypeError (#2358) (5995f2a)
* Resolve feature defaults before lazy codegen (d59d100)
8.6.6 (2026-07-03)
Bug Fixes
* Filter Any type_url lookups to message types (#2346) (88f0aa1)
* handle EOF during options parsing (#2352) (fa5c73a)
8.6.5 (2026-06-23)
Bug Fixes
* Implement open/closed enum semantics (#2337) (2abd056)
* Omit implicit scalar defaults during encode (#2336) (b8d0b84)
* Support hardened prototype properties (#2313) (1aca107)
* Use own-property semantics for internal maps (#2335) (9f97fe4)
8.6.4 (2026-06-16)
Bug Fixes
* Avoid materializing ProtoJSON WKT defaults (#2326) (6aaee14)
* Support runtimes without ICU (#2331) (cd6e2e2)
8.6.3 (2026-06-10)
Bug Fixes
* Consistently reject truncated 64-bit varints (#2322) (ec868f3)
* Include interfaces in API docs and fix FieldMask doc comment (#2319) (c98a4e5)
* Preserve explicit URLs in path resolution (#2320) (c97cdbe)
* Remove renamed reflection objects by identity (#2324) (9c9f8ee)
* Support Node ESM named imports from CommonJS entrypoints (#2315) (3359e64)
* Support utf8_validation during decode (#2325) (4dff8e4)
8.6.2 (2026-06-09)
Bug Fixes
* Discard unknown fields by default (#2310) (bf12d56)
8.6.1 (2026-06-07)
Bug Fixes
* cli: Consistently wait for pbts output before JSDoc exit (#2306) (87ff02f)
* cli: Preserve indentation in multiline declarations (#2307) (b38748d)
* Preserve descriptor metadata needed by protoc-gen-pbjs (#2308) (a3b8dc7)
* Remove inquire submodule (#2305) (cc42616)
8.6.0 (2026-06-04)
Features
* Add spec-compliant protojson extension (#2297) (ffd3d51)
Bug Fixes
* Avoid name collisions in generated code (#2302) (ce013ab)
* cli: Vendor patched Catharsis for pbts (#2304) (29f7c96)
* Remove postinstall script (#2299) (b8ed7be)
* Support null-prototype plain objects in converters (#2300) (bf20d84)
8.5.0 (2026-05-29)
Features
* Add option to discard unknown fields (#2289) (f8c489b)
* Expose RPC metadata on service methods (#2286) (711a279)
Bug Fixes
* cli: Consistently handle derived names (#2293) (9e80030)
* Consistently reject null message argument in fromObject (#2287) (0f6178d)
* Prefer nested type resolution over global fallback (#2288) (4b4c703)
8.4.2 (2026-05-22)
Bug Fixes
* Align reserved range semantics (#2277) (48aa10f)
* Coerce int32 values before writer sizing (#2281) (53c2e54)
8.4.1 (2026-05-21)
Bug Fixes
* Correct util helper typing (#2279) (664a3d1)
* Decode omitted long map values as Long (#2264) (a71254b)
* Expose Field rule declaration (#2261) (1664cbf)
* Improve message return typings (#2274) (0f54489)
* Misc utility hardening (#2272) (3de631b)
* Omit proto3 synthetic oneofs in toObject (#2273) (9a78a4a)
* Preserve writer state in static encodeDelimited (#2275) (d28ec57)
* Register empty common in light build (#2262) (6cc4bc2)
* Treat fixed64 as unsigned in converters (#2265) (d8a6983)
8.4.0 (2026-05-18)
Features
* Support BigInt conversions (#2257) (36873e6)
8.3.0 (2026-05-13)
Features
* Improve generated typings (#2244) (faa424e)
8.2.1 (2026-05-13)
Bug Fixes
* Consolidate depth limit checks (#2246) (9050289)
* Preserve explicit enum zero if not the default (#2249) (9621b35)
Performance Improvements
* Slightly optimize generated code (#2242) (c41160c)
8.2.0 (2026-05-09)
Features
* Add finishInto() for zero-copy serialization into existing buffers (#2196) (657d6f1)
* Add textformat extension (#2233) (4639e29)
* cli: Add optional protoc-gen-pbjs plugin (#2231) (c9b6a2d)
* cli: Align json-module with static-module output (#2227) (a015091)
* Roundtrip unknown fields (#2209) (76fa03c)
Bug Fixes
* Accept URL-safe base64 input (#2207) (57a3821)
* Also resolve common definitions by file name (#2218) (e533950)
* Apply oneof last-value wins during decode (#2193) (cf35cdc)
* Consistently handle scalar map keys (#2186) (29b1183)
* Consistently reject truncated strings (#2205) (689e911)
* Correct parsedOptions TypeScript types (#2217) (dbe8d77)
* Decode bool values from full varints (#2192) (7b8d5c1)
* Decode fields by full wire tag (#2197) (f6264b1)
* Decode missing map message values as empty messages (#2206) (51c1a4f)
* Generate TypeScript class properties for extensions (#2187) (ec04bee)
* Harden parser input handling (#2240) (53a27fc)
* Improve Deno and Bun compatibility (#2228) (6034af8)
* Improve descriptor extension interoperability (#2232) (effbbc4)
* Make optional Node module lookups bundler-safe (#2237) (366030b)
* Merge singular message fields while decoding (#2195) (14d9df7)
* Omit proto3 implicit scalar defaults (#2208) (ea1b003)
* Read non-minimal 32-bit varints correctly (#2198) (5650a07)
* Reject malformed field tag varints (#2224) (1904533)
* Restore first-match namespace lookup (#2235) (4fb8900)
* Support proto2 extension groups (#2181) (1039194)
* Tighten key2Re regex with non-capturing group (#2225) (c87b149)
* Validate field and group tags while decoding (#2200) (c09d4f7)
Performance Improvements
* Avoid constructor setup during resolve (#2211) (1bf3c07)
* Preallocate arrays in converters (#2219) (62d2155)
* Reduce generated code overhead (#2212) (45ec503)
* Tweak reader varint32 and string cases (#2220) (4076ea8)
8.1.0 (skipped)
This version was skipped. Note that the 8.1.x-experimental line has diverged and should not be used.
8.0.3 (2026-04-27)
Bug Fixes
* Accept imports after declarations (#2178) (24651c9)
8.0.2 (2026-04-27)
Bug Fixes
* Accept empty statements in proto definitions (#2176) (a26dd61)
* Correct alternate comment mode line numbers (#2159) (e550cd2)
* Correct ES6 wrapper imports in static-module output (#2151) (88f5a76)
* Don't include @exports for enums (#1824) (eb256f0)
* Forward group end tag in lazy decode (#2162) (3a48675)
* Harden input handling (#2163) (6eb3a3b)
* limit depth of recursion in Reader.prototype.skipType (#2143) (0f643d5)
* Parse empty repeated options (#2161) (8c5060f)
* refactor the code to remove subpackages (#2146) (2fe8b09)
* Remove jsdoc includePattern (#2089) (0fead2e)
* Run pbts jsdoc without a shell (#2160) (648b760)
* Support .cjs and .mjs extensions in pbts (#2152) (aef016a)
8.0.1 (2026-03-11)
Bug Fixes
* bump protobufjs dependency version for cli package (#2128) (549b05e)
* correct json syntax in tsconfig.json (#2120) (8065625)
* descriptor: guard oneof index for non-Type parents (#2122) (1cac5cf)
* do not allow setting __proto__ in Message constructor (#2126) (f05e3c3)
* filter invalid characters from the type name (#2127) (535df44)
8.0.0 (2025-12-16)
⚠ BREAKING CHANGES
* add Edition 2024 Support (#2060)
Features
* add Edition 2024 Support (#2060) (53e8492)
7.5.4 (2025-08-15)
Bug Fixes
* invalid syntax in descriptor.proto (#2092) (5a3769a)
7.5.3 (2025-05-28)
Bug Fixes
* descriptor extensions handling post-editions (#2075) (6e255d4)
7.5.2 (2025-05-14)
Bug Fixes
* ensure that types are always resolved (#2068) (4b51cb2)
7.5.1 (2025-05-08)
Bug Fixes
* optimize regressions from editions implementations (#2066) (6406d4c)
* reserved field inside group blocks fail parsing (#2058) (56782bf)
7.5.0 (2025-04-15)
Features
* add Edition 2023 Support (f04ded3)
* add Edition 2023 Support (ac9a3b9)
* add Edition 2023 Support (e5ca5c8)
* add Edition 2023 Support (a84409b)
* add Edition 2023 Support (9c5a178)
* add Edition 2023 Support (b2c6867)
* add Edition 2023 Support (60f3e51)
* add Edition 2023 Support (a656361)
* add Edition 2023 Support (869a95b)
* add Edition 2023 Support (b936af4)
* add Edition 2023 Support (a938467)
* add Edition 2023 Support (1af8454)
* add Edition 2023 Support (785416f)
* add feature resolution (a9ffc8a)
* add feature resolution and tests (68b5339)
* add feature resolution for protobuf editions (547afa2)
* add feature resolution for protobuf editions (65d3ed1)
* api_converters_editions tests added and run successfully" (b4b5ca4)
* increase size of file that protobufjs CLI can process (00d5f1a)
* increase size of file that protobufjs CLI can process (d36ef0f)
Bug Fixes
* change tree traversal order and feature resolution algorithm (d2d47d9)
* remove eval usage so that chrome extension MV3 can run properly (#1941) (f2ccb99)
7.4.0 (2024-08-22)
Features
* Add prepublishOnly script (0e4da8b)
Bug Fixes
* include (28e3334)
7.3.3 (2024-08-16)
Bug Fixes
* handle nullability for optional fields (59569c1)
7.3.2 (2024-06-12)
Bug Fixes
* docs: Update readme to correct command for creating types (#1939) (0f9d477)
7.3.1 (2024-06-05)
Bug Fixes
* types: reserved field in IType can contain reserved names (#2001) (d1d2c0c)
7.3.0 (2024-05-10)
Features
* add handling for extension range options (#1990) (2d58011)
7.2.6 (2024-01-16)
Bug Fixes
* report missing import properly in loadSync (#1960) (af3ff83)
7.2.5 (2023-08-21)
Bug Fixes
* crash in comment parsing (#1890) (eaf9f0a)
* deprecation warning for new Buffer (#1905) (e93286e)
* possible infinite loop when parsing option (#1923) (f2a8620)
7.2.4 (2023-06-23)
Bug Fixes
* do not let setProperty change the prototype (#1899) (e66379f)
7.2.3 (2023-03-27)
Bug Fixes
* type names can be split into multiple tokens (#1877) (8817ee6)
7.2.2 (2023-02-07)
Bug Fixes
* do not allow to extend same field twice to prevent the error (#1784) (14f0536)
7.2.1 (2023-02-02)
Bug Fixes
* cli: fix relative path to Google pb files (#1859) (e42eea4)
* Revert "fix: error should be thrown" (4489fa7)
* use bundled filename to fix common pb includes (#1860) (dce9a2e)
* use ES5 style function syntax (#1830) (64e8936)
7.2.0 (2023-01-24)
Features
* cli: generate static files at the granularity of proto messages (#1840) (32f2d6a)
Bug Fixes
* error should be thrown (#1817) (e7a3489)
7.1.2 (2022-09-22)
Bug Fixes
* types: nested object can be a oneof (#1812) (119d90a)
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
* accept unknown enum values in fromObject (#1793) (ef24ae4)
* valuesOptions for enums (#1358) (bb6b1d4)
Bug Fixes
* deps: update dependency glob to v8 (#1750) (8303a64)
* extensions broke oneof (#1789) (d7f501c)
* remove unused @types/long (#1785) (0f4af83)
* support for nested messages and enums within group blocks (#1790) (f36d4e4)
* types: update type deps (#1776) (d87978b)
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
* add --no-service option for pbjs static target (#1577) (d01394a)
* add alt-comment CLI option (#1692) (7558ef0)
* add configurable Root.prototype.fetch (ad3cffd)
* add getTypeUrl method to generated code (#1463) (d13d5d5)
* add null-defaults option (#1611) (6e713ba)
* add support for buffer configuration (#1372) (101aa1a)
* allow message.getTypeUrl provide custom typeUrlPrefix (#1762) (8aad1dd)
* better comment parse (#1419) (7fd2e18)
* move command line tool to a new package named protobufjs-cli (#1234) (da34f43)
* parsed options (#1256) (7a25398)
* prepare initial publication of cli (#1752) (64811d5)
* proto3 optional support (#1584) (6c4d307)
* support parsing of complex options (#1744) (b1746a8)
* update dependencies / general cleanup (#1356) (42f49b4)
Bug Fixes
* allow for an optional semicolon where there is an optional comma in parseOptionValue (#1571) (af1b449)
* allow Windows unc paths to be resolved and normalized (#1351) (cd4aeda)
* deps: patch minimatch vulnerability (#1704) (bac61b8)
* deps: update dependency long to v5 (#1751) (dadc65e)
* deps: use eslint 8.x (#1728) (fa01883)
* do not fail if no process (#1440) (f2faa8c)
* do not let setProperty change the prototype (#1731) (3357ef7)
* docs: update CHANGELOG to match format of release-please (#1376) (15ed8a0)
* drop support for Node 4, 6, 8, 10 (#1764) (50370dd)
* encoding of empty Buffers (#1514) (b4cae07), closes #1500 #885
* es6 export enum (#1446) (9f33784)
* fix util.global (#1441) (742b8dc)
* fromObject should not initialize oneof members (#1597) (90afe44)
* google.protobuf.Any type_url fixes (#1068) (192f5f1)
* handling of map entries with omitted key or value (#1348) (b950877)
* handling properly fields with leading and trailing comments after field with trailing comment (#1593) (9011aac)
* make node detection a bit more forgiving (#1445) (4e75f6d)
* make parsedOptions appear in method JSON representation (#1506) (3d29969)
* proper relative path to protobufjs in cli (#1753) (a1d6029)
* properly parse empty messages in options (#1429) (7fbc79f)
* proto3 optional scalars should default to null in reflection API (#1693) (d9144de)
* replace deprecated String.prototype.substr() (#1701) (e33a84a)
* scope variable for map field to avoid redeclaration (#1717) (#1718) (1d3c02a)
* support for options with repeated_value: [ "foo", "bar" ] (#1574) (f5b893c)
* typo in pbjs help text (#1552) (7f46dbe)
* update minimal.js to evade override mistake (#1742) (e2f33a0)
* updated isNode check (#1221) (#1363) (5564e7b)
* utf8 -> utf16 decoding bug on surrogate pairs (#1486) (75172cd)
6.10.2 (2020-11-13)
Bug Fixes
* es6 export enum (#1446) (9f33784)
* make parsedOptions appear in method JSON representation (#1506) (3d29969)
* utf8 -> utf16 decoding bug on surrogate pairs (#1486) (75172cd)
6.10.1 (2020-07-16)
Bug Fixes
* make node detection a bit more forgiving (#1445) (4e75f6d)
6.10.0 (2020-07-13)
Features
* add configurable Root.prototype.fetch (ad3cffd)
* better comment parse (#1419) (7fd2e18)
* parsed options (#1256) (7a25398)
Bug Fixes
* allow Windows unc paths to be resolved and normalized (#1351) (cd4aeda)
* do not fail if no process (#1440) (f2faa8c)
* fix util.global (#1441) (742b8dc)
* google.protobuf.Any type_url fixes (#1068) (192f5f1)
* handling of map entries with omitted key or value (#1348) (b950877)
* properly parse empty messages in options (#1429) (7fbc79f)
* updated isNode check (#1221) (#1363) (5564e7b)
6.9.0 (2020-04-17)
Features
* add support for buffer configuration (#1372) (101aa1a)
* update dependencies / general cleanup (#1356) (42f49b4)
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)
6.8.8
Fixed
:hash: Persist recent index.d.ts changes in JSDoc<br />
6.8.7
Fixed
:hash: Fix package browser field descriptor (#1046)<br />
:hash: Fix static codegen issues with uglifyjs3<br />
:hash: Fix lint issues / pbts on windows<br />
:hash: Fix empty 'bytes' field decoding, now using Buffer where applicable (#1020)<br />
:hash: Fix circular dependency of Namespace and Enum (#994)<br />
:hash: Ignore optional commas in aggregate options (#999)<br />
New
:hash: Make Message<T> have a default type param (#1086)<br />
:hash: Explicitly define service method names when generating static code, see #857<br />
:hash: Also handle services in ext/descriptor (#1001)<br />
CLI
:hash: Extend list of ignored ESLint rules for pbjs, fixes #1085<br />
:hash: Fix declared return type of pbjs/pbts callback (#1025)<br />
:hash: Added an option to pbts to allow custom imports (#1038)<br />
:hash: Get node executable path from process.execPath (#1018)<br />
Other
:hash: Slim down CI testing and remove some not ultimately necesssary dependencies with audit issues<br />
:hash: Move global handling to util, see #995<br />
6.8.6
Fixed
:hash: Fix typeRefRe being vulnerable to ReDoS<br />
6.8.5
New
:hash: Preserve comments when serializing/deserializing with toJSON and fromJSON. (#983)<br />
:hash: Add more details to some frequent error messages (#962)<br />
:hash: Add IParseOptions#alternateCommentMode (#968)<br />
:hash: Added field_mask to built-in common wrappers (#982)<br />
Other
:hash: Remove code climate config in order to use 'in-app' config instead<br />
6.8.4
Other
:hash: Update jsdoc dependency (pinned vulnerable marked)<br />
6.8.3
CLI
:hash: Use correct safeProp in json-module target, see #956<br />
6.8.2
Other
:hash: Include dist files in npm package, see #955<br />
6.8.1
Fixed
:hash: Prevent invalid JSDoc names when generating service methods, see #870<br />
:hash: Prevent parse errors when generating service method names, see #870<br />
:hash: Support parsing nested option-values with or without ':' (#951, fixes #946)<br />
:hash: Add support for reserved keyword in enums (#950, fixes #949)<br />
:hash: Unified safe property escapes and added a test for #834<br />
:hash: Fix codegen if type name starts with "Object"<br />
:hash: Fixed dependency for json-module to use "light".<br />
:hash: Basic support for URL prefixes in google.protobuf.Any types.<br />
:hash: fixed 'error is not defined linter warning when using static/static-module and es6<br />
:hash: Fixed wrong type_url for any type (no leading '.' allowed).<br />
:hash: Fixed fromObject() for google.protobuf.Any types.<br />
:hash: Handle case where 'extendee' is undefined in ext/descriptor<br />
CLI
:hash: Sanitize CR-only line endings (coming from jsdoc?)<br />
:hash: Make sure enum typings become generated (#884 didn't solve this)<br />
:hash: Remove exclude and include patterns from jsdoc config<br />
:hash: Skip defaults when generating proto3<br />
:hash: Wait for both the 'end' and 'close' event to happen before finishing in pbts, see #863<br />
:hash: Accept null for optional fields in generated static code<br />
:hash: Annotate TS classes with @implements<br />
:hash: Annotate virtual oneofs as string literal unions<br />
New
:hash: Also check for reserved ids and names in enums<br />
:hash: Also support 'reserved' in enum descriptors<br />
Other
:hash: Include just relevant files in npm package, fixes #781<br />
:hash: Fix travis build<br />
6.8.0
Breaking
:hash: Replaced Buffer and Long types with interfaces and removed stubs<br />
:hash: Removed Message#toObject in favor of having just the static version (unnecessary static code otherwise)<br />
:hash: Everything uses interfaces now instead of typedefs (SomethingProperties is now ISomething)<br />
:hash: ReflectionObject#toJSON properly omits explicit undefined values<br />
:hash: Initial implementation of TypeScript decorators<br />
:hash: Refactored protobuf.Class away<br />
:hash: TypeScript definitions now have (a lot of) generics<br />
:hash: Removed deprecated features<br />
Fixed
:hash: Added 'undefined' besides 'null' as a valid value of an optional field, fixes #826<br />
:hash: Fixed an issue with codegen typings, see #819<br />
:hash: Ported utf8 chunking mechanism to base64 as well, fixes #800<br />
:hash: Also be more verbose when defining properties for ES6, fixes #820<br />
:hash: Generate more verbose JSDoc comments for ES6 support, fixes #820<br />
:hash: Emit a maximum of one error var when generating verifiers, fixes #786<br />
:hash: Fixed missing semicolon after 'extensions' and 'reserved' when generating proto files, fixes #810<br />
:hash: Call npm with '--no-bin-links' when installing CLI deps, fixes #823<br />
:hash: Fix Reader argument conversion in static module<br />
:hash: Use JSDoc, they said, it documents code, they said. Fixes #770<br />
:hash: parser should not confuse previous trailing line comments with comments for the next declaration, see #762<br />
:hash: Types should not clear constructor with cache (fixes decorators)<br />
:hash: Namespace#lookup should also check in nested namespaces (wtf)<br />
:hash: Reader#bytes should also support plain arrays<br />
:hash: Fix markdown for pipe in code in table<br />
New
:hash: Upgrade to codegen 2<br />
:hash: ext/descriptor enables interoperability between reflection and descriptor.proto (experimental), see #757<br />
:hash: Added 'json' conversion option for proto3 JSON mapping compatibility of NaN and Infinity + additional documentation of util.toJSONOptions, see #351<br />
CLI
:hash: Use protobuf/minimal when pbjs target is static-module<br />
:hash: Added closure wrapper<br />
:hash: Various improvements to statically generated JSDoc, also fixes #772<br />
:hash: Check incompatible properties for namespaces only in tsd-jsdoc<br />
:hash: Additional tsd-jsdoc handling of properties inside of namespaces and TS specific API exposure<br />
:hash: Several improvements to tsd-jsdoc emitted comments<br />
:hash: Further TypeScript definition improvements<br />
:hash: Relieved tsd files from unnecessary comments<br />
:hash: Generate TS namespaces for vars and functions with properties<br />
:hash: Prefer @tstype over @type when generating typedefs (tsd-jsdoc)<br />
Docs
:hash: Replaced nullable types with explicit type|null for better tooling compatibility, also fixes #766 and fixes 767<br />
:hash: Added more info to ext/descriptor README, see #757<br />
:hash: Additional notes on ext/descriptor<br />
:hash: Updated CHANGELOG so everyone knows what's going on (and soon, breaking)<br />
:hash: Additional docs on TS/decorators usage<br />
Other
:hash: Updated dist files<br />
:hash: Added package-lock.json<br />
:hash: Minor formatting<br />
:hash: Generate files<br />
:hash: Remove the no-constructor arg<br />
:hash: Remove the ctor option.<br />
:hash: Add support to generate types for JSON object.<br />
:hash: aspromise performance pass<br />
:hash: codegen 2 performance pass, #653 might benefit<br />
:hash: Fixed minimal library including reflection functionality<br />
:hash: Minor compression ratio tuning<br />
:hash: Fixed failing test case + coverage<br />
:hash: Improved fromObject wrapper for google.protobuf.Any.<br />
:hash: Fixed failing tokenize test case<br />
:hash: Removed debug build, made it an extension<br />
:hash: Regenerated dist files<br />
:hash: Even more documentation and typings for ext/descriptor<br />
:hash: ext/descriptor docs<br />
:hash: Decorators coverage<br />
:hash: ext/descriptor support for various standard options, see #757<br />
:hash: ext/descriptor passes descriptor.proto test with no differences, see #757<br />
:hash: Properly remove unnecessary (packed) options from JSON descriptors<br />
:hash: Use typedefs in ext/descriptor (like everywhere else), see #757<br />
:hash: Fixed obvious issues with ext/descriptor, does not throw anymore when throwing descriptor.proto itself at it, see #757<br />
:hash: Added still missing root traversal to ext/descriptor, see #757<br />
:hash: Initial map fields support for ext/descriptor, see #757<br />
:hash: Added infrastructure for TypeScript support of extensions<br />
:hash: TypeScript generics improvements<br />
:hash: More ext/descriptor progress, see #757<br />
:hash: Just export the relevant namespace in ext/descriptor<br />
:hash: Initial descriptor.proto extension for reflection interoperability, see #757<br />
:hash: Moved custom wrappers to its own module instead, also makes the API easier to use manually, see #677<br />
:hash: Added infrastructure for custom wrapping/unwrapping of special types, see #677<br />
:hash: More decorator progress (MapField.d, optional Type.d)<br />
:hash: tsd-jsdoc now has limited generics support<br />
6.7.3
Other
:hash: long, @types/long and @types/node are just dependencies, see #753<br />
6.7.2
New
:hash: Split up NamespaceDescriptor to make nested plain namespaces a thing, see #749<br />
Docs
:hash: More README<br />
:hash: Replaced 'runtime message' with 'message instance' for clarity<br />
:hash: Rephrased the Usage section around the concept of valid messages<br />
:hash: Added toolset diagram to README<br />
Other
:hash: Touched benchmark output metrics once more<br />
:hash: Fixed failing browser test<br />
:hash: Output more human friendly metrics from benchmark<br />
:hash: Stripped down static bench code to what's necessary<br />
:hash: Revamped benchmark, now also covers Google's JS implementation<br />
:hash: Updated dependencies and dist files<br />
6.7.1
New
:hash: Made .verify behave more like .encode, see #710<br />
CLI
:hash: With null/undefined eliminated by constructors and .create, document message fields as non-optional where applicable (ideally used with TS & strictNullChecks), see #743<br />
:hash: Renamed --strict-long/message to --force-long/message with backward compatible aliases, see #741<br />
:hash: Keep $Properties with --strict-message but require actual instances within, see #741<br />
:hash: Added --strict-message option to pbjs to strictly reference message instances instead of $Properties, see #741<br />
Docs
:hash: Restructured README<br />
:hash: Added more information on typings usage, see #744<br />
:hash: Clarified typescript example in README, see #744<br />
:hash: Clarified that the service API targets clients consuming a service, see #742<br />
Other
:hash: Omit copying of undefined or null in constructors and .create, see #743<br />
6.7.0
Breaking
:hash: Namespace#lookupEnum should actually look up the reflected enum and not just its values<br />
:hash: Decoder now throws if required fields are missing, see #695 / #696<br />
Fixed
:hash: Added functionality to filter for multiple types at once in lookup(), used by lookupTypeOrEnum(), fixes #740<br />
:hash: Ensure that fields have been resolved when looking up js types in static target, see #731<br />
:hash: Properly copy fields array before sorting in toObject, fixes #729<br />
:hash: Actually emit TS compatible enums in static target if not aliases, see #720<br />
:hash: Hardened tokenize/parse, esp. comment parsing, see #713<br />
:hash: Exclude any fields part of some oneof when populating defaults in toObject, see #710<br />
:hash: Most of the parser is not case insensitive, see #705<br />
:hash: Retain options argument in Root#load when used with promises, see #684<br />
New
:hash: Created a micromodule from (currently still bundled) float support<br />
:hash: util.isset(obj, prop) can be used to test if a message property is considered to be set, see #728<br />
:hash: Implemented stubs for long.js / node buffers to be used where either one isn't wanted, see #718<br />
:hash: Simplified reusing / replacing internal constructors<br />
:hash: Constructors/.create always initialize proper mutable objects/arrays, see #700<br />
:hash: Verifiers return an error if multiple fields part of the same oneof are set, see #710<br />
:hash: Added
oneofs: true to ConversionOptions, see #710<br />:hash: Optional fields handle null just like undefined regardless of type see #709<br />
:hash: Encoders no longer examine virtual oneof properties but encode whatever is present, see #710<br />
:hash: pbjs now generates multiple exports when using ES6 syntax, see #686<br />
:hash: Sequentially serialize fields ordered by id, as of the spec.<br />
:hash: decode throws specific ProtocolError with a reference to the so far decoded message if required fields are missing + example<br />
:hash: Reader.create asserts that
buffer is a valid buffer, see #695<br />CLI
:hash: Exclude JSDoc on typedefs from generated d.ts files because typescript@next, see #737<br />
:hash: Prepare static code with estraverse instead of regular expressions, see #732<br />
:hash: Moved tsd-jsdoc to future cli package, see #716<br />
:hash: $Properties are just a type that's satisfied, not implemented, by classes, see #723<br />
:hash: More progress on decoupling the CLI<br />
:hash: Fixed computed array indexes not being renamed in static code, see #726<br />
:hash: Check upfront if key-var is required in static decoders with maps, see #726<br />
:hash: Fixed handling of stdout if callback is specified, see #724<br />
:hash: Preparations for moving the CLI to its own package, see #716<br />
:hash: Properly implement $Properties interface in JSDoc, see #723<br />
:hash: Recursively use $Properties inside of $Properties in static code, see #717<br />
:hash: Added --strict-long option to pbjs to always emit 'Long' instead of 'number|Long' (only relevant with long.js), see #718<br />
:hash: Statically emitted long type is 'Long' now instead of '$protobuf.Long', see #718<br />
:hash: Decoupled message properties as an interface in static code for TS intellisense support, see #717<br />
:hash: Static code statically resolves types[..], see #715<br />
Docs
:hash: Added type definitions for all possible JSON descriptors<br />
:hash: Explained the JSON structure in README and moved CLI specific information to the CLI package<br />
:hash: Added information on how to use the stubs to README, see #718<br />
:hash: Added 'What is a valid message' section to README<br />
:hash: Added a hint on using .create to initial example<br />
:hash: Even more usage for README<br />
:hash: Additional information on general usage (README)<br />
:hash: Restructured README to Installation, Usage and Examples sections<br />
:hash: Added a longish section on the correct use of the toolset to README<br />
:hash: Added a few additional notes on core methods to README, see #710<br />
:hash: Extended traverse-types example, see #693<br />
:hash: Better explain how .verify, .encode and .decode are connected<br />
:hash: Documented that Type#encode respectively Message.encode do not implicitly .verify, see #696 [ci-skip]<br />
:hash: Documented throwing behavior of Reader.create and Message.decode<br />
:hash: Added error handling notes to README, see #696<br />
Other
:hash: Use @protobufjs/float<br />
:hash: Rebuilt dist files for 6.7.0<br />
:hash: Updated deps, ts fixes and regenerated dist files<br />
:hash: Manually merged gentests improvements, fixes #733<br />
:hash: Make sure that util.Long is overridden by AMD loaders only if present, see #730<br />
:hash: Coverage for util.isset and service as a namespace<br />
:hash: Shortened !== undefined && !== null to equivalent != null in static code<br />
:hash: With stubs in place, 'number|Long' return values can be just 'Long' instead, see #718<br />
:hash: Just alias as the actual ideal type when using stubs, see #718<br />
:hash: General cleanup + regenerated dist/test files<br />
:hash: Simplified camel case regex, see #714<br />
:hash: Regenerated dist files and changelog for 6.7.0<br />
:hash: Retain alias order in static code for what it's worth, see #712<br />
:hash: Everything can be block- or line-style when parsing, see #713<br />
:hash: Determine necessary aliases depending on config, see #712<br />
:hash: Use more precise types for message-like plain objects<br />
:hash: Regenerated dist files<br />
:hash: Regenerated relevant files<br />
:hash: Moved field comparer to util<br />
:hash: Updated tests to use new simplified encoder logic<br />
:hash: Updated path to tsd-jsdoc template used by pbts, see #707<br />
:hash: Additional restructuring for moving configuration files out of the root folder<br />
:hash: Added codegen support for constructor functions, see #700<br />
:hash: Attempted to fix broken custom error test<br />
:hash: Trying out a more aggressive aproach for custom error subclasses<br />
:hash: Moved a few things out of the root folder<br />
:hash: Coverage for encoder compat. / protocolerror<br />
:hash: Updated dist and generated test files<br />
:hash: Added tslint<br />
:hash: Exclude dist/ from codeclimate checks<br />
:hash: Also lint cli utilities<br />
:hash: Cache any regexp instance (perf)<br />
:hash: Use code climate badges<br />
:hash: Updated travis to pipe to codeclimate, coverage<br />
:hash: More precise linter configuration<br />
:hash: Added codeclimate<br />
:hash: Moved cli deps placeholder creation to post install script<br />
6.6.5
Fixed
:hash: sfixed64 is not zig-zag encoded, see #692<br />
CLI
:hash: Added a placeholder to cli deps node_modules folder to make sure node can load from it<br />
Other
:hash: Restructured a few failing tests<br />
:hash: Traversal example + minimalistic documentation<br />
:hash: Added a custom getters/setters example for gRPC<br />
6.6.4
Fixed
:hash: Made sure that LongBits ctor is always called with unsigned 32 bits + static codegen compat., fixes #690<br />
:hash: Properly handle multiple ../.. in path.normalize, see #688<br />
:hash: Post-merge, also tackles #683 (packed option for repeated enum values)<br />
New
:hash: Verify accepts non-null objects only, see #685<br />
:hash: allow_alias enum option was not being honored. This case is now handled and a test case was added<br />
CLI
:hash: Added an experimental --sparse option to limit pbjs output to actually referenced types within main files<br />
Docs
:hash: Added explicit hint on Uint8Array to initial example, see #670<br />
Other
:hash: Ranges and names support for reserved fields, see #676<br />
:hash: Updated depdendencies / rebuilt dist files<br />
:hash: Use ?: instead of |undefined in .d.ts files<br />
:hash: Mark optional fields as possibly being undefined<br />
:hash: Added a few more common google types from google/api, see #433<br />
:hash: Minor optimizations to dependencies, build process and tsd<br />
6.6.3
Fixed
:hash: Support node 4.2.0 to 4.4.7 buffers + travis case, see #665<br />
CLI
:hash: Added ES6 syntax flag to pbjs, see #667<br />
Docs
:hash: Reference Buffer for BufferReader/Writer, see #668<br />
:hash: Slightly shortened README<br />
:hash: Additional notes on the distinction of different use cases / distributions, see #666<br />
:hash: Extended README with additional information on JSON format<br />
:hash: Added extended usage instructions for TypeScript and custom classes to README, see #666<br />
Other
:hash: Updated dist files<br />
:hash: Updated test cases to use new buffer util<br />
:hash: Added fetch test cases + some test cleanup<br />
6.6.2
Fixed
:hash: Properly replace short vars when beautifying static code, see #663<br />
:hash: Use custom prelude in order to exclude any module loader code from source (for webpack), see #658<br />
:hash: Make sure to check optional inner messages for null when encoding, see #658<br />
New
:hash: Initial attempt on a backwards compatible fetch implementation with binary support, see #661<br />
Other
:hash: Root#resolvePath skips files when returning null, see #368<br />
:hash: Changes callback on failed response decode in rpc service to pass actual error instead of 'error' string<br />
:hash: Travis should exit with the respective error when running sauce tests<br />
:hash: Moved checks whether a test case is applicable to parent case<br />
:hash: Added eventemitter tests and updated micromodule dependencies (so far)<br />
:hash: Added lib/path tests and updated a few dependencies<br />
:hash: Moved micro modules to lib so they can have their own tests etc.<br />
:hash: Updated travis<br />
6.6.1
Fixed
:hash: Properly set up reflection when using light build<br />
6.6.0 (release)
Breaking
:hash: Inlined / refactored away .testJSON, see #653<br />
:hash: Refactored util.extend away<br />
:hash: Reflected and statically generated services use common utility, now work exactly the same<br />
:hash: fromObject now throws for entirely bogus values (repeated, map and inner message fields), fixes #601<br />
:hash: Cleaned up library distributions, now is full / light / minimal with proper browserify support for each<br />
Fixed
:hash: Do not randomly remove slashes from comments, fixes #656<br />
:hash: Properly parse nested textformat options, also tackles #655<br />
New
:hash: Relieved the requirement to call .resolveAll() on roots in order to populate static code-compatible properties, see #653<br />
:hash: Added a (highly experimental) debug build as a starting point for #653<br />
:hash: Full build depends on light build depends on minimal build, shares all relevant code<br />
CLI
:hash: Also reuse specified root in pbjs for JSON modules, see #653<br />
:hash: Reuse specified root name in pbjs to be able to split definitions over multiple files more easily, see #653<br />
Docs
:hash: Improved pbjs/pbts examples, better covers reflection with definitions for static modules<br />
:hash: Fixed centered formatting on npm<br />
Other
:hash: Various other minor improvements / assertions refactored away, see #653<br />
:hash: Fixed some common reflection deopt sites, see #653<br />
:hash: Reflection performance pass, see #653<br />
:hash: Added TS definitions to alternative builds' index files<br />
:hash: Removed unnecessary prototype aliases, improves gzip ratio<br />
:hash: Unified behaviour of and docs on Class constructor / Class.create<br />
:hash: Statically generated services actually inherit from rpc.Service<br />
:hash: Do not try to run sauce tests for PRs<br />
:hash: Added utility to enable/disable debugging extensions to experimental debug build<br />
:hash: Fixed node 0.12 tests<br />
:hash: Fixed coverage<br />
:hash: Added a test case for #652<br />
6.5.3
Other
:hash: In fromObject, check if object is already a runtime message, see #652<br />
6.5.2
Docs
:hash: Added coverage reporting<br />
CLI
:hash: Added version scheme warning to everything CLI so that we don't need this overly explicit in README<br />
Other
:hash: Coverage progress, 100%<br />
:hash: Coverage progress<br />
:hash: Attempted to fix badges once and for all<br />
:hash: Coverage progress<br />
6.5.1
CLI
:hash: Reuse module paths when looking up cli dependencies, see #648<br />
:hash: Check actual module directories to determine if cli dependencies are present and bootstrap semver, see #648<br />
Docs
:hash: Added a note on semver-incompatibility, see #649<br />
Other
:hash: Coverage progress<br />
6.5.0 (release)
Breaking
:hash: Initial upgrade of converters to real generated functions, see #620<br />
Fixed
:hash: An enum's default value present as a string looks up using typeDefault, not defaultValue which is an array if repeated<br />
:hash: Use common utility for virtual oneof getters and setters in both reflection and static code, see #644<br />
:hash: Properly use Type.toObject/Message.toObject within converters, see #641<br />
:hash: Generate null/undefined assertion in fromObject if actually NOT an enum, see #620<br />
:hash: Replace ALL occurencies of types[%d].values in static code, see #641<br />
New
:hash: Switched to own property-aware encoders for compatibility, see #639<br />
:hash: Now also parses comments, sets them on reflected objects and re-uses them when generating static code, see #640<br />
CLI
:hash: Further improved generated static code style<br />
:hash: Removed scoping iifes from generated static code<br />
:hash: Removed even more clutter from generated static code<br />
:hash: Removed various clutter from generated static code<br />
:hash: Made sure that static target's replacement regexes don't match fields<br />
:hash: Also accept (trailing) triple-slash comments for compatibility with protoc-gen-doc, see #640<br />
:hash: Use semver to validate that CLI dependencies actually satisfy the required version, see #637<br />
Docs
:hash: Added a hint on documenting .proto files for static code<br />
:hash: Documented internally used codegen partials for what it's worth<br />
:hash: Updated converter documentation<br />
Other
:hash: Bundler provides useful stuff to uglify and a global var without extra bloat<br />
:hash: Cleaned and categorized tests, coverage progress<br />
:hash: Properly removed builtins from bundle<br />
:hash: Call hasOwnProperty builtin as late as possible decreasing the probability of having to call it at all (perf)<br />
:hash: Slightly hardened codegen sprintf<br />
:hash: Significantly improved uint32 write performance<br />
:hash: Cleaned up test case data and removed unused files<br />
:hash: Removed now useless trailing comment checks, see #640<br />
:hash: Ensured that pbjs' beautify does not break regular expressions in generated verify functions<br />
6.4.6
Fixed
:hash: Case-sensitively test for legacy group definitions, fixes #638<br />
:hash: Properly parse text format options + simple test case, fixes #636<br />
Docs
:hash: Added SVG logo, see #629<br />
Other
:hash: Also refactored Service and Type to inherit from NamespaceBase, see #635<br />
:hash: Moved TS-compatible Namespace features to a virtual NamespaceBase class, compiles with strictNullChecks by default now, see #635<br />
:hash: Minor codegen enhancements<br />
6.4.5
Fixed
:hash: Properly handle empty/noop Writer#ldelim, fixes #625<br />
:hash: Properly annotate map fields in pbjs, fixes #624<br />
New
:hash: Made sure that Writer#bytes is always able to handle plain arrays<br />
Other
:hash: Slightly restructured utility to better support static code default values<br />
6.4.4
Fixed
:hash: Dynamically resolve jsdoc when running pbts, fixes #622<br />
Docs
:hash: Explain 6.4.2 vs 6.4.3 in changelog<br />
6.4.3
Fixed
:hash: Fixed invalid definition of Field#packed property, also introduced decoder.compat mode (packed fields, on by default)<br />
:hash: Always decode packed/non-packed based on wire format only, see #602<br />
:hash: Use full library for JSON modules and runtime dependency for static modules, fixes #621<br />
CLI
:hash: Additional workarounds for on demand CLI dependencies, see #618<br />
:hash: Revised automatic setup of cli dependencies, see #618<br />
Other
:hash: Removed Android 4.0 test (no longer supported by sauce)<br />
:hash: Removed some unused utility, slightly more efficient codegen, additional comments<br />
:hash: Updated tests for new package.json layout<br />
:hash: Added break/continue label support to codegen<br />
:hash: Updated dependencies, rebuilt dist files and changed logo to use an absolute url<br />
6.4.2 had been accidentally published as 6.4.3.
6.4.1
Fixed
:hash: Added more default value checks to converter, fixes #616<br />
:hash: Respect long defaults in converters<br />
:hash: Convert inner messages and undefined/null values more thoroughly, fixes #615<br />
:hash: Always use first defined enum value as field default, fixes #613<br />
:hash: Install correct 'tmp' dependency when running pbts without dev dependencies installed, fixes #612<br />
New
:hash: Generate named constructors for runtime messages, see #588<br />
CLI
:hash: pbjs/pbts no longer generate any volatile headers, see #614<br />
Docs
:hash: Attempted to make broken shields less annoying<br />
:hash: Updated README<br />
Other
:hash: Some cleanup and added a logo<br />
:hash: use $protobuf.Long<br />
6.4.0 (release)
Breaking
:hash: Dropped IE8 support<br />
:hash: Removed now unused util.longNeq which was used by early static code<br />
Fixed
:hash: Do not swallow errors in loadSync, also accept negative enum values in Enum#add, fixes #609<br />
:hash: Improved bytes field support, also fixes #606<br />
:hash: Fall back to browser Reader when passing an Uint8Array under node, fixes #605<br />
:hash: Respect optional properties when writing interfaces in tsd-jsdoc, fixes #598<br />
New
:hash: Instead of protobuf.parse.keepCase, fall back to protobuf.parse.defaults holding all possible defaults, see #608<br />
:hash: Added global ParseOptions#keepCase fallback as protobuf.parse.keepCase, see #608<br />
:hash: Converters use code generation and support custom implementations<br />
:hash: Be more verbose when throwing invalid wire type errors, see #602<br />
:hash: Added an asJSON-option to always populate array fields, even if defaults=false, see #597<br />
:hash: Attempt to improve TypeScript support by using explicit exports<br />
:hash: Copy-pasted typescript definitions to micro modules, see #599<br />
:hash: Emit an error on resolveAll() if any extension fields cannot be resolved, see #595 + test case<br />
CLI
:hash: Removed 'not recommend' label for --keep-case, see #608<br />
:hash: Added customizable linter configuration to pbjs<br />
:hash: Added stdin support to pbjs and pbts<br />
:hash: Static code no longer uses IE8 support utility<br />
:hash: Generated static code now supports asJSON/from<br />
:hash: Added support for TypeScript enums to pbts<br />
:hash: Added a few helpful comments to static code<br />
:hash: Slightly beautify statically generated code<br />
:hash: Do not wrap main definition as a module and export directly instead<br />
:hash: Generate prettier definitions with --no-comments<br />
:hash: Added variable arguments support to tsd-jsdoc<br />
:hash: Reference dependency imports as a module to prevent name collisions, see #596<br />
:hash: Removed now unnecessary comment lines in generated static code<br />
Docs
:hash: Added notes on CSP-restricted environments to README, see #593<br />
Other
:hash: Added test case for asJSON with arrays=true, see #597<br />
:hash: Added a tape adapter to assert message equality accross browsers<br />
:hash: Refactored some internal utility away<br />
:hash: Reverted previous attempt on #597<br />
:hash: Minor tsd-jsdoc refactor<br />
:hash: Removed unused sandbox files<br />
:hash: Updated package.json of micro modules to reference types, see #599<br />
:hash: Reference dependencies as imports in generated typescript definitions, see #596<br />
:hash: Allow null values on optional long fields, see #590<br />
:hash: Various jsdoc improvements and a workaround for d.ts generation, see #592<br />
6.3.1
Fixed
:hash: Empty inner messages are always present on the wire + test case + removed now unused Writer#ldelim parameter, see #585<br />
CLI
:hash: Expose tsd-jsdoc's comments option to pbts as --no-comments, see #587<br />
:hash: Increase child process max buffer when running jsdoc from pbts, see #587<br />
:hash: pbjs now generates more convenient dot-notation property accessors<br />
Other
:hash: And fixed IE8 again (should probably just drop IE8 for good)<br />
6.3.0
Breaking
:hash: Moved camelCase/underScore away from util to where actually used<br />
:hash: Renamed asJSON option keys (enum to enums, long to longs) because enum is a reserved keyword<br />
:hash: Moved JSON/Message conversion to its own source file and added Message/Type.from + test case, see #575<br />
:hash: Relicensed the library and its components to BSD-3-Clause to match the official implementation (again)<br />
:hash: Dropped support for browser buffer entirely (is an Uint8Array anyway), ensures performance and makes things simpler<br />
:hash: Removed dead parts of the Reader API<br />
:hash: Refactored BufferReader/Writer to their own files and removed unnecessary operations (node always has FloatXXArray and browser buffer uses ieee anyway)<br />
:hash: Stripped out fallback encoder/decoder/verifier completely (even IE8 supports codegen), significantly reduces bundle size, can use static codegen elsewhere<br />
Fixed
:hash: Actually concatenate mixed custom options when parsing<br />
:hash: Fixed a couple of issues with alternative browser builds<br />
:hash: Properly set long defaults on prototypes<br />
:hash: Fixed reference error in minimal runtime, see #580<br />
:hash: Non-repeated empty messages are always present on the wire, see #581<br />
:hash: Properly check Buffer.prototype.set with node v4<br />
:hash: Prevent NRE and properly annotate verify signature in tsd-jsdoc, fixed #572<br />
:hash: Fix directly using Buffer instead of util.Buffer<br />
:hash: Added filter type to Namespace#lookup, fixes #569<br />
:hash: Fixed parsing enum inner options, see #565<br />
:hash: Fixed release links in README files<br />
New
:hash: Added a noparse build for completeness<br />
:hash: Now compresses .gz files using zopfli to make them useful beyond being just a reference<br />
:hash: Updated non-bundled google types folder with missing descriptors and added wrappers to core<br />
:hash: Replaced the ieee754 implementation for old browsers with a faster, use-case specific one + simple test case<br />
:hash: Added .create to statically generated types and uppercase nested elements to reflection namespaces, see #576<br />
:hash: Also added Namespace#getEnum for completeness, see #576<br />
:hash: Added Namespace#getEnum and changed #lookupEnum to the same behavior, see #576<br />
:hash: Added a heap of coverage comments for usually unused code paths to open things up<br />
:hash: Added codegen test to determine if any ancient browsers don't actually support it<br />
:hash: Added legacy groups support to pbjs, see #568<br />
:hash: Initial support for legacy groups + test case, see #568<br />
:hash: Added asJSON bytes as Buffer, see #566<br />
CLI
:hash: Annotated callback types in pbjs-generated services, see #582<br />
:hash: Removed type/ns alias comment in static target to not confuse jsdoc unnecessarily<br />
:hash: Made pbjs use loadSync for deterministic outputs, see #573<br />
Docs
:hash: Updated documentation on runtime and noparse builds<br />
:hash: Fixed an issue with the changelog generator skipping some commits<br />
:hash: Added notes on how to use pbjs and pbts programmatically<br />
:hash: Manually sorted old changelog entries<br />
:hash: Initial changelog generator, see #574<br />
:hash: Added static/JSON module interchangeability to README<br />
:hash: Updated README and bundler according to dynamic require calls<br />
Other
:hash: Added basic services test case<br />
:hash: Just polyfill Buffer.from / .allocUnsafe for good<br />
:hash: Added a test case to find out if all the fallbacks are just for IE8<br />
:hash: Commented out float assertions in float test including explanation<br />
:hash: Expose array implementation used with (older) browsers on util for tests<br />
:hash: Updated test cases<br />
:hash: Added assumptions to float test case<br />
:hash: Updated travis config to use C++11<br />
:hash: Updated / added additional LICENSE files where appropriate<br />
:hash: Integrated changelog into build process, now also has 'npm run make' for everything, see #574<br />
:hash: Minor optimizations through providing type-hints<br />
:hash: Reverted shortened switch statements in verifier<br />
:hash: Enums can't be map key types<br />
:hash: Use custom require (now a micromodule) for all optional modules, see #571<br />
:hash: Support usage when size = 0<br />
:hash: Reverted aliases frequently used in codegen for better gzip ratio<br />
:hash: Shrinked bundle size - a bit<br />
:hash: Can finally run with --trace-deopt again without crashes<br />
:hash: Other minor optimizations<br />
6.2.1
New
:hash: Added ParseOptions to protobuf.parse and --keep-case for .proto sources to pbjs, see #564<br />
Other
:hash: Better TypeScript definition support for @property-annotated objects<br />
:hash: Can't just inline longNeq but can be simplified<br />
:hash: Array abuse and varint optimization<br />
:hash: Updated dependencies<br />
:hash: Other minor improvements to short ifs<br />
:hash: Reader/Writer example<br />
6.2.0
Fixed
:hash: Fixed reserved names re, also ensure valid service method names, see #559<br />
:hash: Fix d.ts whitespace on empty lines, added tsd-jsdoc LICENSE<br />
:hash: Fix asJSON defaults option, make it work for repeated fields.<br />
:hash: Inlined any Reader/Writer#tag calls, also fixes #556<br />
:hash: Fix building default dist files with explicit runtime=false<br />
:hash: Apply asJSON recursively<br />
:hash: Ensure working reflection class names with minified builds<br />
:hash: Lazily resolve (some) cyclic dependencies, see #560<br />
New
:hash: Added protobuf.roots to minimal runtime, see #554<br />
:hash: Repo now includes a restructured version of tsd-jsdoc with our changes incorporated for issues/prs, see #550<br />
CLI
:hash: Updated pbjs arguments<br />
:hash: Pipe tsd-jsdoc output (requires dcodeIO/tsd-jsdoc/master) and respect cwd, see #550<br />
:hash: tsd-jsdoc progress<br />
Docs
:hash: README<br />
Other
:hash: Added GH issue template<br />
:hash: Path micromodule, dependencies<br />
:hash: Test case for #556<br />
:hash: Raw alloc benchmark<br />
:hash: Other minor optimizations<br />
6.1.1
Fixed
:hash: Properly encode/decode map kv pairs as repeated messages (codegen and fallback), see #547<br />
:hash: Make genVerifyKey actually generate conditions for 32bit values and bool, fixes #546<br />
:hash: Fix to generation of verify methods for bytes<br />
:hash: Take special care of oneofs when encoding (i.e. when explicitly set to defaults), see #542<br />
New
:hash: Added Message#asJSON option for bytes conversion<br />
:hash: Added Namespace#lookupType and Namespace#lookupService (throw instead of returning null), see #544<br />
:hash: Provide prebuilt browser versions of the static runtime<br />
CLI
:hash: Initial pbts CLI for generating TypeScript definitions, see #550<br />
:hash: Refactored json/static-module targets to use common wrappers<br />
:hash: 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<br />
:hash: Annotate namespaces generated by static target, see #550<br />
:hash: static target: Basic support for oneof fields, see #542<br />
Docs
:hash: Fix to reflection documentation<br />
:hash: README on minimal runtime / available downloads<br />
:hash: Notes on descriptors vs static modules<br />
Other
:hash: A lot of minor optimizations to performance and gzip ratio<br />
:hash: Minimized base64 tables<br />
6.1.0
Breaking
:hash: Removed as-function overload for Reader/Writer, profiler stub, optimized version of Reader#int32<br />
:hash: Refactored Prototype and inherits away, is now Class and Message for more intuitive documentation and type refs<br />
Fixed
:hash: Fixed failing test case on node < 6<br />
:hash: Fixed serialization order of sfixed64, fixes #536<br />
:hash: Fixed serialization order of fixed64, fallback to parseInt with no long lib, see #534<br />
:hash: Actually allow undefined as service method type, fixes #528<br />
:hash: Do not skip optional delimiter after aggregate options, fixes #520<br />
:hash: Verify empty base64 encoded strings for bytes fields, see #535<br />
:hash: wrong spell role should be rule<br />
:hash: decodeDelimited always forks if writer is specified, see #531<br />
:hash: Mimic spec-compliant behaviour in oneof getVirtual, see #523<br />
New
:hash: Initial base64 string support for bytes fields, see #535<br />
:hash: Initial type-checking verifier, see #526, added to bench out of competition<br />
:hash: Initial loadSync (node only), see #529<br />
:hash: Initial RPC service implementaion, see #529<br />
:hash: added 'defaults' option to Prototype#asJSON, see #521<br />
:hash: Use Uint8Array pool in browsers, just like node does with buffers<br />
:hash: Also validate map fields, see #526 (this really needs some tests)<br />
CLI
:hash: Added json-module target to pbjs, renamed static to static-module, see #522<br />
:hash: updated internals and static target to use immutable objects on prototypes<br />
Docs
:hash: 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<br />
:hash: Added variations for Root#load, see #527<br />
:hash: Added benchmark and profile related information to README<br />
:hash: Added service example to README, see #529<br />
:hash: README on tests<br />
:hash: Update README/dist to reflect recent changes<br />
:hash: Minimal documentation for micromodules<br />
:hash: Document all the callbacks, see #527<br />
:hash: Documented streaming-rpc example a bit<br />
Other
:hash: Removed the need for triple-slash references in .d.ts by providing a minimal Long interface, see #527, see #530<br />
:hash: Transition to micromodules<br />
:hash: Refactored argument order of utf8 for plausibility<br />
:hash: Restructured reusable micromodules<br />
:hash: Can't use Uint8Array#set on node < 6 buffers<br />
:hash: Test case for #531<br />
:hash: Safer signaling for synchronous load, see #529<br />
:hash: Proper end of stream signaling to rpcImpl, see #529<br />
:hash: Moved event emitter to util, also accepts listener context, see #529<br />
:hash: Probably the worst form of hiding require programmatically, see #527<br />
:hash: Attempt to hide require('fs') from webpack, see #527<br />
:hash: Trying out jsdoc variations, see #527<br />
:hash: by the way, why not include the json->proto functionality into "util"?<br />
:hash: Update proto.js<br />
:hash: Automatic profile generation and processing<br />
:hash: Generalized buffer pool and moved it to util<br />
:hash: Make shields visible on npm, yey<br />
:hash: More shields, I love shields, and maybe a workaround for travis timing out when sauce takes forever<br />
:hash: Trying SauceLabs with higher concurrency<br />
6.0.2
Fixed
:hash: Fix packable float/double see #513<br />
New
:hash: Handle oneofs in prototype ctor, add non-ES5 fallbacks, test case<br />
:hash: Be nice to AMD, allow reconfiguration of Reader/Writer interface<br />
CLI
:hash: Initial static codegen target for reference<br />
:hash: pbjs static target services support<br />
:hash: pbjs static target progress, uses customizable wrapper template<br />
:hash: Static pbjs target progress, now generates usable CommonJS code, see #512<br />
Docs
:hash: TypeScript example<br />
:hash: Adjectives, notes on browserify<br />
Other
:hash: Refactor runtime util into separate file, reader/writer uses runtime util<br />
:hash: Also optimize reader with what we have learned<br />
:hash: More (shameless) writer over-optimization<br />
:hash: Trading package size for float speed<br />
:hash: Skip defining getters and setters on IE8 entirely, automate defining fallbacks<br />
:hash: Unified proto/reflection/classes/static encoding API to always return a writer<br />
:hash: plain js utf8 is faster for short strings<br />
:hash: improve TypeScript support. add simple test script.<br />
:hash: Use long.js dependency in tests, reference types instead of paths in .d.ts see #503<br />
:hash: Restructured encoder / decoder to better support static code gen<br />
6.0.1
Fixed
:hash: Add support for long strings, fixes #509<br />
:hash: expose zero on LongBits, fixes #508<br />
:hash: Fixed issues with Root.fromJSON/#addJSON, search global for Long<br />
:hash: Properly exclude browserify's annoying _process, again, fixes #502<br />
:hash: Remember loaded files earlier to prevent race conditions, fixes #501<br />
:hash: Allow negative enum ids even if super inefficient (encodes as 10 bytes), fixes #499, fixes #500<br />
:hash: set resolvedResponseType on resolve(), fixes #497<br />
New
:hash: Initial take on runtime services, see #507<br />
:hash: Include dist/ in npm package for frontend use<br />
CLI
:hash: pbjs proto target field options, language-level compliance with jspb test.proto<br />
Docs
:hash: always use Uint8Array in docs for tsd, see #503<br />
:hash: Notes on dist files<br />
Other
:hash: Update eslint env<br />
:hash: Browser field in package.json isn't required<br />
---
CONTRIBUTING
Contributing
Issues
Please use the issue template and include a minimal reproduction.
For CLI issues, include the protobufjs-cli version and the exact pbjs, pbts or protoc-gen-pbjs command.
Paste errors, generated output, schemas and repro code as text / code blocks, not screenshots.
Security reports should follow SECURITY.md.
Pull requests
For larger changes, please open an issue first to discuss the approach.
Keep pull requests focused on one behavior change or fix.
Link the relevant issue when there is one.
Include tests for bug fixes and new behavior when practical. If a test is not practical, explain why in the pull request.
Avoid unrelated refactors, formatting-only churn, generated-output dumps, or dependency changes unless they are part of the fix.
Development
npm install
npm --prefix cli install
npm run build
npm testRegenerate test fixtures when affected:
npm run build:tests---
README
<h1><p align="center"><img alt="protobuf.js" src="https://github.com/protobufjs/protobuf.js/raw/master/pbjs.svg" height="100" /><br/>protobuf.js</p></h1>
<p align="center">
<a href="https://github.com/protobufjs/protobuf.js/actions/workflows/test.yml"><img src="https://img.shields.io/github/actions/workflow/status/protobufjs/protobuf.js/test.yml?branch=master&label=build&logo=github" alt=""></a>
<a href="https://github.com/protobufjs/protobuf.js/actions/workflows/release.yaml"><img src="https://img.shields.io/github/actions/workflow/status/protobufjs/protobuf.js/release.yaml?branch=master&label=release&logo=github" alt=""></a>
<a href="https://npmjs.org/package/protobufjs"><img src="https://img.shields.io/npm/v/protobufjs.svg?logo=npm" alt=""></a>
<a href="https://npmjs.org/package/protobufjs"><img src="https://img.shields.io/npm/dm/protobufjs.svg?label=downloads&logo=npm" alt=""></a>
<a href="https://www.jsdelivr.com/package/npm/protobufjs"><img src="https://img.shields.io/jsdelivr/npm/hm/protobufjs?label=requests&logo=jsdelivr" alt=""></a>
</p>
protobuf.js is a very fast, conformant, and unusually versatile JavaScript implementation of Protocol Buffers for Node.js and browsers. It is independently maintained with contributions from the upstream Protocol Buffers project, works with .proto schemas without requiring protoc, and supports runtime reflection as well as specialized code generation with matching TypeScript declarations.
If protobuf.js is important to your project or organization, or if you depend on it commercially, consider supporting its ongoing maintenance. Sponsorship helps make bug fixes, releases, LTS/security handling, and user support more sustainable.
Getting started
Getting up and running is simple: Install the package, load a schema, and you are all set to encode and decode Protobuf messages. From there, protobuf.js grows with your requirements: Add code generation with TypeScript declarations, transport-agnostic services, support for text-based formats, and more as needed.
Install
npm install protobufjsThe command line utility for generating reflection bundles, static code and TypeScript declarations is published as an add-on package:
npm install --save-dev protobufjs-cliThe CLI is a JS-native protobuf.js toolchain that does not require setting up protoc. If you prefer a protoc-based workflow, it provides protoc-gen-pbjs as an option.
#### Browser builds
Canonical browser builds are provided via the jsDelivr CDN, supporting CommonJS, AMD and global window.protobuf. Make sure to pin an exact version in production.
Usage
The examples below use this schema:
syntax = "proto3";package awesomepackage;
message AwesomeMessage {
string awesome_field = 1;
}
protobuf.js converts .proto field names to camelCase by default, so awesome_field is used as awesomeField in JavaScript. Use the keepCase option when loading or parsing .proto files to preserve field names as written.
Load a schema
const protobuf = require("protobufjs");const root = await protobuf.load("awesome.proto");
const AwesomeMessage = root.lookupType("awesomepackage.AwesomeMessage");
Optionally use load() with a callback, or loadSync() for synchronous loading on Node.js. Imports resolve relative to the importing file by default. To resolve imports against a specific base directory, create a Root and override root.resolvePath before calling root.load().
Encode and decode
const payload = { awesomeField: "hello" };// Optionally create a message instance from already valid data
const message = AwesomeMessage.create(payload);
const encoded = AwesomeMessage.encode(message).finish();
const decoded = AwesomeMessage.decode(encoded);
encode expects a message instance or equivalent plain object and does not verify input implicitly. Use create to create a message instance from already valid data when useful, verify for plain objects whose shape is not guaranteed, and fromObject when conversion from broader JavaScript objects is needed.
Plain objects can be encoded directly when they already use protobuf.js runtime types: numbers for 32-bit numeric fields, booleans for bool, strings for string, Uint8Array or Buffer for bytes, arrays for repeated fields, and plain objects for maps. Map keys are the string representation of the respective value or an 8-character hash string for 64-bit keys.
Note that, as with any structured binary format, decoded structures incur runtime memory overhead beyond their encoded representation. Applications processing untrusted input should therefore apply appropriate input-size and concurrency limits to bound memory use. For this reason, unknown fields present on the wire are intentionally discarded as the safer default, but can be retained by setting reader.discardUnknown = false per reader, or by setting Reader.discardUnknown = false to make it the default for subsequently created readers. Preserved unknown field data can also be explicitly dropped with delete message.$unknowns.
Convert plain objects
Conversion is an explicit interoperability boundary. fromObject accepts common JavaScript inputs such as enum values by name, base64 bytes, decimal 64-bit strings, Long, and BigInt; toObject lets callers choose the output expected by their application or transport.
const message = AwesomeMessage.fromObject({ awesomeField: 42 });
const object = AwesomeMessage.toObject(message, {
longs: String,
enums: String,
bytes: String
});Common ConversionOptions are:
| Option | Effect |
|--------|--------|
| longs: BigInt | Converts 64-bit values to bigint values |
| longs: String | Converts 64-bit values to decimal strings |
| longs: Number | Converts 64-bit values to JS numbers (may lose precision) |
| enums: String | Converts enum values to names |
| bytes: String | Converts bytes to base64 strings |
| defaults: true | Includes default values for unset fields |
| arrays: true | Includes empty arrays for repeated fields |
| objects: true | Includes empty objects for map fields |
| oneofs: true | Includes virtual oneof discriminator properties |
Message API
Message types expose focused methods for validation, conversion, and binary I/O.
* encode(message: Message | object, writer?: Writer): Writer
Encodes a message or equivalent plain object. Call .finish() on the returned writer to obtain a buffer.
* encodeDelimited(message: Message | object, writer?: Writer): Writer
Encodes a length-delimited message.
* decode(reader: Reader | Uint8Array): Message
Decodes a message from protobuf binary data.
* decodeDelimited(reader: Reader | Uint8Array): Message
Decodes a length-delimited message.
* create(properties?: object): Message
Creates a message instance from already valid data.
* verify(object: object): null | string
Checks whether a plain object can be encoded as-is. Returns null if valid, otherwise an error message.
* fromObject(object: object): Message
Converts broader JavaScript input into a message instance.
* toObject(message: Message, options?: ConversionOptions): object
Converts a message instance to a configurable plain JavaScript object.
* message.toJSON(): object
Converts a message instance to JSON-compatible output using default conversion options.
Message instances provide stable runtime identity for testing with instanceof.
Length-delimited methods read and write a varint byte length before the message, which is useful for streams and framed protocols.
If required fields are missing while decoding proto2 data, decode throws protobuf.util.ProtocolError with the partially decoded message available as err.instance.
Code generation
Use protobufjs-cli to generate schema-specific code, either directly with pbjs or through the optional protoc-gen-pbjs plugin for protoc.
protobuf.js offers two code-generation modes, both with matching TypeScript declarations: reflection modules generate optimized code at runtime with reflection metadata retained; static modules generate reflection-free code ahead of time. Both use the same runtime package and automatically import only the runtime capabilities they need.
| Target | Output | Runtime entry |
|--------|--------|---------------|
| json-module | Reflection module | protobufjs/light.js (without parser) |
| static-module | Static code module | protobufjs/minimal.js (without reflection) |
Module targets support --wrap default for CommonJS and AMD, plus esm, commonjs, amd, and closure; --wrap can also load a custom wrapper module.
Static modules
Static modules emit dedicated, reflection-free JavaScript code for your schema.
npx pbjs -t static-module -w esm -o awesome.js --dts awesome.protoimport { awesomepackage } from "./awesome.js";const message = awesomepackage.AwesomeMessage.create({ awesomeField: "hello" });
Static code is repetitive by design, but compresses unusually well with Brotli or gzip and works in CSP-restricted environments.
Reflection modules
Reflection modules wrap schemas as compact JSON metadata while avoiding .proto parsing at runtime.
npx pbjs -t json-module -w esm -o awesome.js --dts awesome.protoimport { awesomepackage } from "./awesome.js";const AwesomeMessage = awesomepackage.AwesomeMessage;
Declarations for reflection modules mirror static-module typings. Because JSON modules export reflection objects, message instances should be created with MyMessage.create(...) rather than constructors. Code using create(...) works with static modules as well. Separately, -t json can serialize reflection metadata as bare JSON bundles for use with load() or Root.fromJSON().
TypeScript integration
protobuf.js works with TypeScript out of the box: its runtime API is typed, and generated code can be paired with matching TypeScript declarations in a single CLI invocation. Declarations are strongly typed, including discriminated unions for oneofs and scoped types for plain-object usage:
message Profile {
oneof contact {
string email = 1;
string phone = 2;
}
}const profile = Profile.create({
contact: "email",
email: "[email protected]"
});if (profile.contact === "email") {
profile.email; // string
}
const decoded = Profile.decode(bytes);
if (decoded.contact === "phone") {
decoded.phone; // string
}
The same narrowed shape is available for plain-object inputs:
const object: Profile.$Shape = {
contact: "email",
email: "[email protected]"
};Advanced usage
Programmatic schemas
Schemas can be constructed directly through reflection:
const AwesomeMessage = new protobuf.Type("AwesomeMessage")
.add(new protobuf.Field("awesomeField", 1, "string"));const root = new protobuf.Root()
.define("awesomepackage")
.add(AwesomeMessage);
Custom message classes
A reflected type can use a custom class as its runtime constructor:
class AwesomeMessage extends protobuf.Message<AwesomeMessage> {
awesomeField = ""; constructor(properties?: protobuf.Properties<AwesomeMessage>) {
super(properties);
// ...
}
customInstanceMethod() {
return this.awesomeField.toLowerCase();
}
}
root.lookupType("awesomepackage.AwesomeMessage").ctor = AwesomeMessage;
const decoded = AwesomeMessage.decode(bytes);
decoded.customInstanceMethod(); // string
protobuf.js will populate the constructor with the usual static runtime methods and use it for decoded messages. When assigning constructors manually, add the type to its parent namespace/root first if fields reference other reflected types. In TypeScript, custom members are visible when using the custom class type in consuming code.
Services
protobuf.js supports service clients built from service definitions. The service API is transport-agnostic: provide an rpcImpl function to connect it to HTTP, WebSocket, gRPC, or another transport.
function myRpcImpl(method, requestData, callback) {
// method.name
// method.path
// method.requestStream?
// method.responseStream?
performRequest(requestData, function(err, responseData) {
callback(err, responseData);
});
}const myService = MyService.create(myRpcImpl/, requestDelimited?, responseDelimited? /);
See examples/streaming-rpc.js for a streaming example.
See examples/grpc-service.js for an integration example with @grpc/grpc-js.
Extensions
The following extensions provide descriptor conversion and text-based protobuf formats when reflection metadata is available. Most applications only need the binary APIs above.
#### Descriptors
protobuf.js uses a compact JSON-based reflection representation internally. See ext/descriptor for use cases that need conversion between reflected roots and protoc descriptor messages.
#### ProtoJSON
Protocol Buffers support a special ProtoJSON format to share data with systems that do not support the binary wire format, for example when implementing gateways. Spec-compliant ProtoJSON is supported via ext/protojson.
#### Text Format
Protocol Buffers Text Format is a special syntax for representing protobuf data in text form, which can be useful for configurations or tests. Spec-compliant Text Format is supported via ext/textformat.
Conformance
protobuf.js is validated against the official Protocol Buffers conformance suite. It passes all required and recommended tests for the Proto2, Proto3 and Editions binary wire formats, with complete ProtoJSON and Text Format support available as optional extensions when those formats are needed.
| Category | Total | Required | Recommended |
| ---------- | ------------------: | ------------------: | ------------------: |
| Binary | 100.00% (2835/2835) | 100.00% (1958/1958) | 100.00% (877/877) |
| ↳ Proto2 | 100.00% (707/707) | 100.00% (489/489) | 100.00% (218/218) |
| ↳ Proto3 | 100.00% (707/707) | 100.00% (486/486) | 100.00% (221/221) |
| ↳ Editions | 100.00% (1421/1421) | 100.00% (983/983) | 100.00% (438/438) |
| ProtoJSON | 100.00% (2796/2796) | 100.00% (2362/2362) | 100.00% (434/434) |
| TextFormat | 100.00% (909/909) | 100.00% (845/845) | 100.00% (64/64) |
| Overall | 100.00% (6540/6540) | 100.00% (5165/5165) | 100.00% (1375/1375) |
Structured results of the conformance tests are also available as CI artifacts.
Performance
Both reflection and static modes use specialized encoders and decoders backed by the same hand-tuned reader and writer primitives.
The repository includes a benchmark suite you can run yourself. It compares protobuf.js with other general-purpose JavaScript implementations across three substantially different cases: our classic common message shape and two unmodified, structurally distinct fixtures sourced externally. The suite measures each library's recommended serialization and deserialization path using identical schemas and inputs, with JSON included as an additional baseline. Across these cases, protobuf.js is a clear upgrade over using JSON and consistently the fastest Protobuf implementation by a considerable margin.
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./bench/results/encode-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="./bench/results/encode-light.svg">
<img alt="Encode benchmark" src="./bench/results/encode.svg">
</picture>
<details>
<summary>Show table</summary>
| Implementation | Common | Vector tile | Buf perf |
| --- | ---: | ---: | ---: |
| protobuf.js static | 5.34M ops/s <small>1.0x</small> | 3.09K ops/s <small>1.0x</small> | 43.1K ops/s <small>1.0x</small> |
| protobuf.js reflect | 4.89M ops/s <small>1.1x</small> | 3.03K ops/s <small>1.0x</small> | 43.3K ops/s <small>1.0x</small> |
| JSON | 2.09M ops/s <small>2.6x</small> | 897 ops/s <small>3.4x</small> | 6.70K ops/s <small>6.5x</small> |
| protoc-gen-js | 1.03M ops/s <small>5.2x</small> | 700 ops/s <small>4.4x</small> | 13.9K ops/s <small>3.1x</small> |
| protoc-gen-es | 402K ops/s <small>13.3x</small> | 235 ops/s <small>13.2x</small> | 8.22K ops/s <small>5.3x</small> |
</details>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./bench/results/decode-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="./bench/results/decode-light.svg">
<img alt="Decode benchmark" src="./bench/results/decode.svg">
</picture>
<details>
<summary>Show table</summary>
| Implementation | Common | Vector tile | Buf perf |
| --- | ---: | ---: | ---: |
| protobuf.js static | 6.45M ops/s <small>1.1x</small> | 2.70K ops/s <small>1.1x</small> | 81.7K ops/s <small>1.0x</small> |
| protobuf.js reflect | 6.93M ops/s <small>1.0x</small> | 2.99K ops/s <small>1.0x</small> | 80.3K ops/s <small>1.0x</small> |
| JSON | 1.37M ops/s <small>5.0x</small> | 1.06K ops/s <small>2.8x</small> | 19.5K ops/s <small>4.2x</small> |
| protoc-gen-js | 811K ops/s <small>8.5x</small> | 851 ops/s <small>3.5x</small> | 21.7K ops/s <small>3.8x</small> |
| protoc-gen-es | 691K ops/s <small>10.0x</small> | 376 ops/s <small>8.0x</small> | 14.3K ops/s <small>5.7x</small> |
</details>
Structured results and environment details for this run are also available as committed artifacts.
To run the benchmark on your own hardware:
npm --prefix bench install
npm run benchCompatibility
Supported runtimes are browsers, Node.js v12+, Deno and Bun. When using the CLI with Bun, Node.js must also be installed.
Security
Security-impacting reports are handled through coordinated GitHub Security Advisories where appropriate. See SECURITY.md for supported release lines and reporting instructions.
Development
git clone https://github.com/protobufjs/protobuf.js
cd protobuf.js
npm install
npm --prefix cli installRunning the tests:
npm testBuilding the development and production versions with their respective source maps to dist/:
npm run buildAdditional documentation
* API Documentation
* Changelog
* Protocol Buffers Documentation
---
SECURITY
Security Policy
Supported Versions
Security fixes are provided for the latest patch release of the supported
release lines listed below.
We generally do not backport security fixes to older patch or minor releases
within the same major release line. For example, if a vulnerability affects
multiple 8.x releases, the fix will normally be released as a new latest 8.x
patch release. Users on older 8.x versions should upgrade to the latest 8.x
release containing the fix.
| Release line | Supported |
| ------------ | --------- |
| 8.x | ✅ |
| 7.x | ✅ |
| < 7 | ❌ |
Untrusted Schema Input
Historically, loading untrusted .proto files and JSON descriptors was not
treated as a dedicated security boundary. The support scope has since been
expanded: malformed or adversarial schema input is now considered part of the
supported input surface for active release lines.
Security-impacting behavior in this area, including code execution, prototype
pollution, and denial-of-service issues with practical exploitability, should
be reported through the security process described below.
Reporting a Vulnerability
Please do not report security vulnerabilities through public GitHub issues.
To report a vulnerability, use GitHub's private vulnerability reporting feature
from the repository's Security tab.
When reporting a vulnerability, please include as much detail as possible,
including:
- a description of the issue and its potential impact
- steps to reproduce the issue
- affected versions, if known
- any suggested mitigation or patch, if available
We will review vulnerability reports privately. If the report is accepted, we
will work on a fix and coordinate disclosure through a GitHub Security Advisory
where appropriate. If the report is declined, we will explain why it is not
considered a security issue.
---