Releases: bufbuild/protobuf-es
v2.2.3
What's Changed
- Fix Any unpacking to verify types by @timostamm in #1023
- Add experimental options to equals() to include extensions and others by @timostamm in #1029
Full Changelog: v2.2.2...v2.2.3
v2.2.2
What's Changed
- Print diagnostics when a protoplugin fails to emit files by @will-wow in #1003
- Fix JSON types for fields with uncommon json_name by @nicole0707 in #1004
New Contributors
- @will-wow made their first contribution in #1003
- @nicole0707 made their first contribution in #1004
Full Changelog: v2.2.1...v2.2.2
v2.2.1
What's Changed
- Support target prefix in plugin option rewrite_imports @timostamm in #998
Full Changelog: v2.2.0...v2.2.1
v2.2.0
What's Changed
- Properly reset BinaryWriter after finish by @bhollis in #986
- Add typed
DescMethod
variants by @srikrsna-buf in #985
New Contributors
Full Changelog: v2.1.0...v2.2.0
v2.1.0
What's Changed
- Fix assignability of wrong message type in create by @timostamm in #972
- Generate full JSDoc for JSON types by @timostamm in #975
Full Changelog: v2.0.0...v2.1.0
v2.0.0
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
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
.
- Add GeneratedFile.array by @timostamm in #935
- Add DescEnum.value by @timostamm in #927
- Rename GenDescMessage to GenMessage by @timostamm in #925
- Improve plugin option import_extension by @timostamm in #909
- Add $typeName first by @timostamm in #923
- Fix createFileRegistry() with empty arguments by @timostamm in #933
Full Changelog: v2.0.0-beta.2...v2.0.0-beta.3
v2.0.0-beta.2
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
.
- Avoid Array.flatMap by @timostamm in #904
Full Changelog: v2.0.0-beta.1...v2.0.0-beta.2
v2.0.0-beta.1
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
.
- Bump
typescript
version in protoplugin by @srikrsna-buf in #879 - Improve parameter parsing by @srikrsna-buf in #880
- Throw errors in ReflectMessage instead of returning them by @timostamm in #882
- Add typeOnly argument to GeneratedFile.import by @timostamm in #887
- Fix create() with wrapper oneof field by @timostamm in #889
- Improve clash resolution in generated names by @timostamm in #888
- Use suffix "Schema" for generated descriptors by @timostamm in #890
- Use JsonObject to represent google.protobuf.Struct by @timostamm in #893
- JSON Types by @timostamm in #866
- Add mutable registry by @timostamm in #898
- Avoid the prototype chain with editions if possible by @timostamm in #897
Full Changelog: v2.0.0-alpha.4...v2.0.0-beta.1
v2.0.0-alpha.4
What's Changed
This is the fourth alpha release for version 2. See v2.0.0-alpha.1 for an introduction.
- Remove addListItem and setMapEntry from ReflectMessage by @timostamm in #875
- Relax validation in BinaryWriter by @timostamm in #877
Full Changelog: v2.0.0-alpha.3...v2.0.0-alpha.4