The TypeScript implementation of Connect: Protobuf RPC that works.
APACHE-2.0 License
Bot releases are hidden (Show)
Published by smaye81 over 1 year ago
As of this release, Connect-ES offers Basic Keepalive support for HTTP/2 for clients that use one of the transports from @bufbuild/connect-node
. Note that this replaces the option keepSessionAlive
, which is deprecated with this PR.
In it's most simple form, the following example enables regular PINGs every 5 minutes:
import { createConnectTransport } from "@bufbuild/connect-node";
const transport = createConnectTransport({
httpVersion: "2",
baseUrl: "https://demo.connect.build",
pingIntervalMs: 1000 * 60 * 5,
});
For more information, see https://github.com/bufbuild/connect-es/pull/673
This release also changes the default behavior of the JSON parser so that unknown fields are ignored rather than rejected. Previously, Connect-ES followed the official guidance of the proto3 language spec and rejected unknown fields by default in parsing. However, this contradicts with the ethos that adding fields to a Protobuf definition should not be a breaking change. Therefore, the default behavior has been changed so any new/unknown fields are simply ignored.
Note that this could be considered a breaking change if consumers were relying on this rejection behavior.
Full Changelog: https://github.com/bufbuild/connect-es/compare/v0.9.1...v0.10.0
Published by timostamm over 1 year ago
Full Changelog: https://github.com/bufbuild/connect-es/compare/v0.9.0...v0.9.1
Published by timostamm over 1 year ago
As of this release, connect-es supports performing idempotent, side-effect free requests using HTTP GETs. This makes it easier to cache responses in the browser, on your CDN, or in proxies and other middleboxes.
Note
This functionality is only supported when using the Connect protocol—using a Connect client with a Connect server. When using any gRPC or gRPC-web client, includingcreateGrpcTransport()
andcreateGrpcWebTransport()
from @bufbuild/connect-web or @bufbuild/connect-node, all requests will continue to be HTTP POSTs.
To opt into GET support for a given Protobuf RPC, you must mark it as being side-effect free using the MethodOptions.IdempotencyLevel option:
service ElizaService {
rpc Say(stream SayRequest) returns (SayResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
}
}
With this schema change, handlers will automatically support both GET and POST requests for this RPC. However, clients will continue to use POST requests by default, even when GETs are possible. To make clients use GETs for side effect free RPCs, set the useHttpGet
option:
const transport = createConnectTransport({
// ...
useHttpGet: true
});
Another noteworthy change is the full support of timeouts, also known as deadlines in gRPC. For example, when a client provides the timeoutMs
call option, a header Connect-Timeout-Ms
is added to the request. The server parses this timeout, and if it takes longer than the given timeout to process the request, it should give up, and respond with the error code deadline_exceeded
.
On a connect-es server, the parsed timeout is available as an AbortSignal
on the context:
import type { HandlerContext } from "@bufbuild/connect";
const say = async (req: SayRequest, ctx: HandlerContext) => {
ctx.signal.aborted; // true if timed out
ctx.signal.reason; // an error with code deadline_exceed if timed out
ctx.timeoutMs(); // the remaining time in milliseconds
// raises an error with code deadline_exceed if timed out
ctx.signal.throwIfAborted();
// the AbortSignal can be passed to other functions
await longRunning(ctx.signal);
return new SayResponse({sentence: `You said: ${req.sentence}`});
};
Full Changelog: https://github.com/bufbuild/connect-es/compare/v0.8.6...v0.9.0
@private
by @timostamm in https://github.com/bufbuild/connect-es/pull/572
Full Changelog: https://github.com/bufbuild/connect-es/compare/v0.8.5...v0.8.6
Published by smaye81 over 1 year ago
This release contains the following:
ConnectRouter
based Transport
by @srikrsna-buf in #548.Full Changelog: https://github.com/bufbuild/connect-es/compare/v0.8.4...v0.8.5
Published by smaye81 over 1 year ago
If you are coming from v0.7.0 or earlier, make sure to take a look at the release notes of v0.8.0!
We have officially added support for Next.js via the new @bufbuild/connect-next
package! See the docs as well as #533 for more information.
@bufbuild/connect-node
now officially supports Node v19.
unhandledRejection
when aborting a server stream using @bufbuild/connect-node by @johynpapin in #530.Full Changelog: https://github.com/bufbuild/connect-es/compare/v0.8.3...v0.8.4
Published by smaye81 over 1 year ago
If you are coming from v0.7.0 or earlier, make sure to take a look at the release notes of v0.8.0!
This release contains the following:
Full Changelog: https://github.com/bufbuild/connect-es/compare/v0.8.2...v0.8.3
Published by smaye81 over 1 year ago
If you are coming from v0.7.0 or earlier, make sure to take a look at the release notes of v0.8.0!
This release contains the following:
@bufbuild/protobuf
to dependencies by @fubhy in #496.Full Changelog: https://github.com/bufbuild/connect-es/compare/v0.8.1...v0.8.2
Published by timostamm over 1 year ago
If you are coming from v0.7.0 or earlier, make sure to take a look at the release notes of v0.8.0!
Published by smaye81 over 1 year ago
This repository now hosts Connect for Web, but also for Node.js. We changed the name to Connect-ES to reflect the universal nature. As part of the reorganization, this release includes new features, but also some breaking changes.
This is the first release that shares important bits of code between the web and the Node implementation, and comes with some bug fixes and new features:
If you are using Interceptors, please note the breaking change described in #471.
Otherwise, this release is backwards compatible, but we kindly ask you to install @bufbuild/connect
, and import ConnectError
and other types from there. In the future, @bufbuild/connect-web
will only export the Connect and gRPC-web transports.
The Handlers introduced in the preview are gone! With the new ConnectRouter
, we can support more frameworks, and this release adds adapters for Express and Fastify:
If you have been using Connect for Node, please remove @bufbuild/connect-core
, install @bufbuild/connect
instead, and update your imports. See here how to use ConnectRouter with a Node.js server.
The code generator plugin has been renamed to @bufbuild/protoc-gen-connect-es
. The old one is still available, so you don't have to update right away. See here how to update.
Published by timostamm over 1 year ago
This is the first release of Connect for Node.js - clients and servers for Node.js, with support for the gRPC, gRPC-web and Connect's own protocol: @bufbuild/connect-node
Connect-Node is still in preview, so we want your feedback! We’d love to learn about your use cases and what you’d like to do with Connect-Node. For example, do you plan to use it with React, Remix, or on the edge with Vercel’s Edge Runtime? You can reach us either through the Buf Slack or by filing a GitHub issue and we’d be more than happy to chat!
This release does not make any changes to @bufbuild/connect-web or the code generator protoc-gen-connect-web.
Published by gilwong00 almost 2 years ago
This release includes the following:
#370 - The Connect protocol now specifies that a header be set specifying the version of Connect in use. The header name is Connect-Protocol-Version
and Connect-Web has been updated to send this header in its requests. As a result, users will need to make sure their CORS settings allowlist this new header, or all Connect requests will fail with this release.
For more information, see this PR: https://github.com/bufbuild/connect-go/pull/416
Published by smaye81 almost 2 years ago
This release includes the following:
^1.0.0
by @smaye81 in #377Published by smaye81 almost 2 years ago
This release includes the following:
Published by smaye81 almost 2 years ago
This release includes the following:
Published by smaye81 almost 2 years ago
This release includes the following:
Published by smaye81 almost 2 years ago
Published by smaye81 almost 2 years ago
@nguyenyou made their first contributions in #268
Published by smaye81 about 2 years ago
@ymmt2005 made their first contribution in #258.
Published by smaye81 about 2 years ago
@vipero07 made their first contribution in #232