Releases: connectrpc/connect-es
v2.0.0-beta.1
What's changed
This is a beta release for version 2. See here for an introduction.
To give this version a try, run npx @connectrpc/connect-migrate@beta
. Note that connect-query has not been updated yet.
- Correct type inference for ConnectError#findDetails by @bhollis in #1188
- Remove Node10 subpath fallbacks by @timostamm in #1227
- Remove support for Node.js v16 by @timostamm in #1225
- Use
Stream{Request|Response}
types in interceptors for all streaming rpcs by @srikrsna-buf in #1230 - Bump minimum supported TypeScript version to 4.9.5 by @timostamm in #1231
- Don't trigger handler signal on success by @srikrsna-buf in #1234
- Add migration to v2 by @timostamm in #1142
- Add a transform for
createPromiseClient
->createClient
by @srikrsna-buf in #1236 - Remove
createPromiseClient
andPromiseClient
by @srikrsna-buf in #1240 - Bump browser versions tested on Browserstack by @timostamm in #1241
- Remove "credentials" option from transports by @timostamm in #1242
New Contributors
Full Changelog: v2.0.0-alpha.1...v2.0.0-beta.1
v1.5.0
What's Changed
- Amend RPC <-> HTTP code mappings in accordance with RFC 003 by @srikrsna-buf in #1039
- Tweak error codes according to the conformance suite by @srikrsna-buf in #1063
- Fix paths in npmignore files by @smaye81 in #1112
- Handle multiple set-cookie headers when using Node client by @tcarnes in #1155
- Add support for Next.js v14 by @smaye81 in #1159
- Fix flaky decompression error code by @timostamm in #1204
- Fix Node.js v16 error responses on HTTP1.1 by @timostamm in #1206
- Fix gRPC trailers only response by @srikrsna-buf in #1209
- Upgrade conformance tests to v1.0.3 by @srikrsna-buf in #1208
- Fix signal in handler always aborted in HTTP/1.1 by @srikrsna-buf in #1218
- Fix baseUrl without // mangling request URL on Node.js with HTTP/2 by @timostamm in #1220
- Respect headers from transport option
nodeOptions.headers
by @timostamm in #1219 - Fix error detail debug property by @timostamm in #1221
- Throw an error on missing status in gRPC and gRPC-Web transports by @srikrsna-buf in #1205
New Contributors
- @sjtucoder made their first contribution in #1109
Full Changelog: v1.4.0...v1.5.0
v2.0.0-alpha.1
What's new in version 2
To support protobuf editions, @bufbuild/protobuf
had to make breaking changes, more on this here. Upgrading to v2
of @bufbuild/protobuf
will be breaking change for connect users.
The most notable change is that v2 doesn't require a separate plugin anymore! we only need protoc-gen-es
. For most users this will be a simple change of just removing the connect plugin and changing the import path to point to the protobuf generated types:
import { createPromiseClient } from "@connectrpc/connect";
import { createConnectTransport } from "@connectrpc/connect-node";
// Before this was import { ElizaService } from "./gen/eliza_connect.js"
import { ElizaService } from "./gen/eliza_pb.js";
// Alternatively, use createGrpcTransport or createGrpcWebTransport here
// to use one of the other supported protocols.
const transport = createConnectTransport({
httpVersion: "2",
baseUrl: "https://localhost:8443",
nodeOptions: { rejectUnauthorized },
});
const client = createPromiseClient(ElizaService, transport);
const res = await client.say({ sentence });
Please note that this is an alpha release, and APIs might still change. We're also missing documentation yet. But if you want to try it out, we welcome your feedback!
This release is published with the alpha
tag. To upgrade, you can run:
npm remove @connectrpc/protoc-gen-connect-es
npm install @connectrpc/connect@alpha @connectrpc/connect-node@alpha @bufbuild/protobuf@latest @bufbuild/protoc-gen-es@latest
v1.4.0
What's Changed
This release includes support for server-side interceptors! Here's a quick example:
import * as http from "http";
import routes from "./connect";
import { connectNodeAdapter } from "@connectrpc/connect-node";
import type { Interceptor } from "@connectrpc/connect";
const logger: Interceptor = (next) => async (req) => {
console.log(`recevied message on ${req.url}`);
return await next(req);
};
http
.createServer(
connectNodeAdapter({
routes,
interceptors: [logger],
}),
)
.listen(8080);
For more on them please see the docs.
Other Changes
- Add service and method in grpc-web unary response by @minimal1 in #984
- Document the
ts_nocheck
plugin option by @timostamm in #1012 - Remove node export condition by @smaye81 in #1017
- Avoid instanceof Message by @timostamm in #1023
New Contributors
Full Changelog: v1.3.0...v1.4.0
v1.3.0
What's Changed
- Export
*TransportOptions
types forconnect-node
by @jrschumacher in #959 - Override
instanceof
forConnectError
by @srikrsna-buf in #974
New Contributors
- @jrschumacher made their first contribution in #959
Full Changelog: v1.2.1...v1.3.0
v1.2.1
What's Changed
- Fix normalization of partial messages by @timostamm in #975
Full Changelog: v1.2.0...v1.2.1
v1.2.0
What's Changed
By default, protoc-gen-connect-es (and all other plugins based on @bufbuild/protoplugin) generate ECMAScript import
and export
statements. For use cases where CommonJS is difficult to avoid, a new plugin option has been added named js_import_style
which can be used to generate CommonJS require()
calls.
Here is an example buf.gen.yaml:
version: v1
plugins:
# You'll need @bufbuild/protoc-gen-es v1.6.0 or later
- plugin: es
out: src/gen
opt: js_import_style=legacy_commonjs
- plugin: connect-es
out: src/gen
opt: js_import_style=legacy_commonjs
To view the full PR, see Support CommonJS in protoc-gen-connect-es
by @timostamm in #956
Full Changelog: v1.1.4...v1.2.0
v1.1.4
What's Changed
- Support zero-length compressed request and response messages on Node.js by @timostamm in #893.
- Don't set
User-Agent
header in connect-web by @srikrsna-buf in #912. - Always capture header in
ConnectError
by @srikrsna-buf in #924. - Introduce experimental
ConnectRouter.rpc
overload to not require fullServiceType
by @paul-sachs in #925. - Add explicit exports for node by @smaye81 in #921.
Full Changelog: v1.1.3...v1.1.4
v1.1.3
What's Changed
- Fix multiple read attempts in fetch client by @srikrsna-buf in #876
Full Changelog: v1.1.2...v1.1.3
v1.1.2
What's Changed
- Add ESM wrapper to avoid dual package hazard by @timostamm in #842
Full Changelog: v1.1.1...v1.1.2