Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.7.0 #678

Merged
merged 1 commit into from
Jan 24, 2024
Merged

Release 1.7.0 #678

merged 1 commit into from
Jan 24, 2024

Conversation

timostamm
Copy link
Member

What's Changed

This release adds support for extensions, a Protobuf language feature that allows to extend a message with an additional field.

For example:

syntax = "proto2";

message User {
  extensions 100 to 200;
}

extend User {
  optional uint32 age = 100;
}

For the extension age, we generate a new export const age: Extension<User, number>. You can set the extension field with the function setExtension:

import { setExtension } from "@bufbuild/protobuf";
import { User, age } from "./example_pb.js";

const user = new User();
setExtension(user, age, 77);

To learn more about the details, see the API documentation.

For plugin authors: Since extensions provide a better way to access custom options in a plugin, we are deprecating the findCustom*Option functions from @bufbuild/protoplugin/ecmascript. We recommend to switch to extensions for better type safety and flexibility, see the PR for details.

All changes

Full Changelog: v1.6.0...v1.7.0

@timostamm timostamm merged commit db0bd03 into main Jan 24, 2024
5 checks passed
@timostamm timostamm deleted the tstamm/release-1.7.0 branch January 24, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants