chore(deps): update dependency @bufbuild/protobuf to v2
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| @bufbuild/protobuf (source) | ^1.7.2 -> ^2.0.0 |
||||
| @bufbuild/protobuf (source) | ^1.4.2 -> ^2.0.0 |
Release Notes
bufbuild/protobuf-es (@bufbuild/protobuf)
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:
- https://github.com/bufbuild/protobuf-es/issues/397 Provide custom options at runtime
- https://github.com/bufbuild/protobuf-es/issues/551 Generated types allow assigning wrong message type if it is a superset of the target type
- https://github.com/bufbuild/protobuf-es/issues/414 Improvements for proto2 required
- https://github.com/bufbuild/protobuf-es/issues/738 type-save full enum value names
- https://github.com/bufbuild/protobuf-es/issues/928 Better interop with 3rd party frameworks requiring plain objects
- https://github.com/bufbuild/protobuf-es/issues/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!
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.
⚠️ No Changeset found
Latest commit: f8232aefde42c3db969683178032302a6c943a69
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Renovate Ignore Notification
Because you closed this PR without merging, Renovate will ignore this update. You will not get PRs for any future 2.x releases. But if you manually upgrade to 2.x then Renovate will re-enable minor and patch updates automatically.
If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.