Skip to content

v2.0.1

Latest
Compare
Choose a tag to compare
@smaye81 smaye81 released this 09 Jan 18:14
134f9ca

What's Changed

The only noteworthy changes in this release are enhancements made to the @connectrpc/connect-migrate package.

The migration tool now handles additional scenarios for migrating your code to Connect v2:

Transforms new to create:

- import { Foo } from "./foo_pb.js";
+ import { FooSchema } from "./foo_pb.js";
+ import { create } from "@bufbuild/protobuf";
- const foo = new Foo();
+ const foo = create(FooSchema);

Transforms isMessage to use the schema:

import { isMessage } from "@bufbuild/protobuf";
- import { Foo } from "./foo_pb.js";
+ import { FooSchema } from "./foo_pb.js";
- isMessage(1, Foo); 
+ isMessage(1, FooSchema);

Transforms the static fromBinary, fromJson, and fromJsonString method calls:

- import { Foo } from "./foo_pb.js";
+ import { FooSchema } from "./foo_pb.js";
+ import { fromJson } from "@bufbuild/protobuf";
- Foo.fromJson(x, y);
+ fromJson(FooSchema, x, y);

In addition, if the message is a well-known type, the import path is updated accordingly.

For details on Connect v2, see the v2 release notes as well as the full migration guide.

New Contributors

Full Changelog: v2.0.0...v2.0.1