Skip to content

Releases: bufbuild/protobuf-es

v2.1.0

18 Sep 15:19
c3ba54e
Compare
Choose a tag to compare

What's Changed

Full Changelog: v2.0.0...v2.1.0

v2.0.0

30 Jul 16:12
76cbbc1
Compare
Choose a tag to compare

What's new in version 2

To support Protobuf editions, we have to make breaking changes that also affect users of proto2 and proto3. This prompted us to make more extensive changes that take feedback from version 1 into account:

We no longer use classes. Instead, we generate a schema object and a type for every message. To create a new instance, to serialize, and for other concerns, we provide functions. Here is a simple example:

import { create, toBinary } from "@bufbuild/protobuf";
import { UserSchema } from "./gen/example_pb";

let user = create(UserSchema, {
  firstName: "Homer",
  lastName: "Simpson",
  active: true,
});

const bytes = toBinary(UserSchema, user);

If you use proto3, messages are now plain objects. Files with proto2 and editions use the prototype chain to track field presence.

This approach solves several outstanding issues, such as:

  • #397 Provide custom options at runtime
  • #551 Generated types allow assigning wrong message type if it is a superset of the target type
  • #414 Improvements for proto2 required
  • #738 type-save full enum value names
  • #928 Better interop with 3rd party frameworks requiring plain objects
  • #508 JSON types

Tip

Take a look at the upgrade guide to learn more.

Note

Connect-ES does not support version 2 yet. We will update it shortly.

Contributors

Thanks to @srikrsna-buf for his contributions to v2!

v2.0.0-beta.3

23 Jul 14:06
d4e6715
Compare
Choose a tag to compare
v2.0.0-beta.3 Pre-release
Pre-release

What's Changed

This is the third beta release for version 2. See v2.0.0-alpha.1 for an introduction. To install beta packages, run npm install @bufbuild/protobuf@beta @bufbuild/protoc-gen-es@beta.

Full Changelog: v2.0.0-beta.2...v2.0.0-beta.3

v2.0.0-beta.2

26 Jun 14:57
3bb20e0
Compare
Choose a tag to compare
v2.0.0-beta.2 Pre-release
Pre-release

What's Changed

This is the second beta release for version 2. See v2.0.0-alpha.1 for an introduction. To install beta packages, run npm install @bufbuild/protobuf@beta @bufbuild/protoc-gen-es@beta.

Full Changelog: v2.0.0-beta.1...v2.0.0-beta.2

v2.0.0-beta.1

24 Jun 15:44
793ff3b
Compare
Choose a tag to compare
v2.0.0-beta.1 Pre-release
Pre-release

What's Changed

This is the first beta release for version 2. See v2.0.0-alpha.1 for an introduction. To install beta packages, run npm install @bufbuild/protobuf@beta @bufbuild/protoc-gen-es@beta.

Full Changelog: v2.0.0-alpha.4...v2.0.0-beta.1

v2.0.0-alpha.4

04 Jun 18:07
38bf1e5
Compare
Choose a tag to compare
v2.0.0-alpha.4 Pre-release
Pre-release

What's Changed

This is the fourth alpha release for version 2. See v2.0.0-alpha.1 for an introduction.

Full Changelog: v2.0.0-alpha.3...v2.0.0-alpha.4

v2.0.0-alpha.3

03 Jun 16:20
fff0681
Compare
Choose a tag to compare
v2.0.0-alpha.3 Pre-release
Pre-release

What's Changed

This is the third alpha release for version 2. See v2.0.0-alpha.1 for an introduction.

Full Changelog: v2.0.0-alpha.2...v2.0.0-alpha.3

v1.10.0

30 May 15:10
4ab30bf
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.9.0...v1.10.0

v2.0.0-alpha.2

13 May 14:36
d1cd584
Compare
Choose a tag to compare
v2.0.0-alpha.2 Pre-release
Pre-release

What's Changed

This is the second alpha release for version 2. See v2.0.0-alpha.1 for an introduction.

Breaking

Fixes

  • Strip only last .proto suffix for DescFile.name by @timostamm in #807
  • Fix wrapper extension JSON serialization by @timostamm in #821
  • Check for matching field numbers in StartGroup / EndGroup tags by @timostamm in #810
  • For deprecated elements, generate a @deprecated tag on descriptors by @timostamm in #818

New Features

Performance improvements

Full Changelog: v2.0.0-alpha.1...v2.0.0-alpha.2

v2.0.0-alpha.1

22 Apr 09:55
91ac90f
Compare
Choose a tag to compare
v2.0.0-alpha.1 Pre-release
Pre-release

What's new in version 2

To support Protobuf editions, we have to make breaking changes that also affect users of proto2 and proto3. This prompted us to make more extensive changes that take feedback from version 1 into account:

We no longer uses classes. Instead, we generate a type and a descriptor for every message, and provide functions to create a new instance, for serialization, and other concerns. Here is a simple example:

import { create, toBinary, fromBinary, fromJsonString } from "@bufbuild/protobuf";
import { UserDesc } from "./gen/user_pb.js";

let user = create(UserDesc, {
  firstName: "Homer",
  lastName: "Simpson",
  active: true,
  locations: ["Springfield"],
  projects: { SPP: "Springfield Power Plant" },
  manager: {
    firstName: "Montgomery",
    lastName: "Burns",
  },
});

const bytes = toBinary(UserDesc, user);
user = fromBinary(UserDesc, bytes);
user = fromJsonString(UserDesc, '{"firstName": "Homer", "lastName": "Simpson"}');

This approach solves several outstanding issues, such as:

  • #397 Provide custom options at runtime
  • #551 Generated types allow assigning wrong message type if it is a superset of the target type
  • #414 Improvements for proto2 required
  • #738 type-save full enum value names
  • #928 Better interop with 3rd party frameworks requiring plain objects
  • #508 JSON types

If you use proto3, messages are now plain objects. Files with proto2 and editions use the prototype chain to track field presence.

Please note that this is an alpha release, and APIs might still change. We're also missing documentation yet. But if you want to try it out, we welcome your feedback!

This release is published with the alpha tag. To install the alpha packages, you can run:

npm install @bufbuild/protobuf@alpha @bufbuild/protoc-gen-es@alpha

Contributors

Thanks to @srikrsna-buf for his contributions to v2!