Skip to content

Latest commit

 

History

History
589 lines (475 loc) · 67.9 KB

CHANGELOG.md

File metadata and controls

589 lines (475 loc) · 67.9 KB

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