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.
- Transform class references in connect-migrate by @timostamm and @smaye81 in #1342
New Contributors
- @HermanBilous made their first contribution in #1340
Full Changelog: v2.0.0...v2.0.1