Skip to content

fix(deps): update module connectrpc.com/connect to v2 - #20

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/connectrpc.com-connect-2.x
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/connectrpc.com-connect-2.x

Conversation

@renovate

@renovate renovate Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
connectrpc.com/connect v1.21.1 → v2.0.2 age confidence

Release Notes

connectrpc/connect-go (connectrpc.com/connect)

v2.0.2

Compare Source

What's Changed

Bugfixes

New Contributors

Full Changelog: connectrpc/connect-go@v2.0.1...v2.0.2

v2.0.1

Compare Source

What's Changed

Bugfixes

New Contributors

Full Changelog: connectrpc/connect-go@v2.0.0...v2.0.1

v2.0.0

Compare Source

What's new in version 2

connect-go v2 is a new major version of the Go API, not of ConnectRPC. The wire protocol, gRPC compatibility, and the rest of the ecosystem are unchanged. v1 remains supported on the v1 branch and the two versions can be used in the same module.

Generated code takes and returns plain messages. The connect.Request[T] and connect.Response[T] wrappers are gone, so the simple option is now the only shape:

-func (s *PingServer) Ping(ctx context.Context, req *connect.Request[pingv1.PingRequest]) (*connect.Response[pingv1.PingResponse], error) {
-	return connect.NewResponse(&pingv1.PingResponse{Number: req.Msg.Number}), nil
+func (s *PingServer) Ping(ctx context.Context, req *pingv1.PingRequest) (*pingv1.PingResponse, error) {
+	return &pingv1.PingResponse{Number: req.Number}, nil
 }

The core is now transport-agnostic. Generated code talks to a small Transport interface instead of net/http. connecthttp serves and calls Connect, gRPC, and gRPC-Web over net/http, and connectinprocess calls a server directly in the same process.

Servers register on a *connect.Server and clients are built from a transport:

server := connect.NewServer(validate.NewServerInterceptor())
pingv1connect.RegisterPingServiceHandler(server, &PingServer{})
connecthttp.Mount(mux, server)

client := connect.NewClient(connecthttp.NewTransport(http.DefaultClient, "http://localhost:8080"))
pingClient := pingv1connect.NewPingServiceClient(client)
res, err := pingClient.Ping(ctx, &pingv1.PingRequest{Number: 42})
Test without a network

connectinprocess connects a client to a server in the same process. Tests no longer need httptest.Server or a loopback listener:

server := connect.NewServer()
pingv1connect.RegisterPingServiceHandler(server, &PingServer{})
client := pingv1connect.NewPingServiceClient(connect.NewClient(connectinprocess.New(server)))
Interceptors wrap the whole call

Interceptors run before any decompression or unmarshaling. An auth check can reject a call from its headers alone, without separate HTTP middleware:

func authInterceptor(next connect.ServerFunc) connect.ServerFunc {
	return func(ctx context.Context, spec connect.Spec, stream connect.ServerStream) error {
		info, _ := connect.CallInfoForServerContext(ctx)
		if info.RequestHeader().Get("Authorization") == "" {
			return connect.NewError(connect.CodeUnauthenticated, "missing credentials")
		}
		return next(ctx, spec, stream)
	}
}
Errors don't leak by accident

Only a *connect.Error you create sends its message to the client. Any other error, including one returned from a downstream RPC, reaches the client as a bare code with no message. Attach the original error with WithCause to keep it for errors.Is and errors.As on the server:

if err := store(ctx, req.Number); err != nil {
	return nil, connect.NewError(connect.CodeInternal, "store failed").WithCause(err)
}
Smaller binaries and a smaller API

Without generic client instantiation, the compiler no longer emits a client per RPC. Moving the Buf CLI to v2 shrinks its binary by about 10%. The core package exports about 25 identifiers, down from about 180 in v1, and stream types are interfaces that can be faked in tests.

The v2 guide explains what changed and why.

[!TIP]
If you already use connect-go, see the migration guide. The connect-go-v2-migrate tool updates buf.gen.yaml and rewrites most of your code.

To upgrade, run:

go install connectrpc.com/connect/v2/cmd/connect-go-v2-migrate@latest
connect-go-v2-migrate -w
buf generate
connect-go-v2-migrate -w
go mod tidy
v1 is still supported

v1 remains stable and supported indefinitely. It lives on the v1 branch and will keep receiving bug fixes and security patches as connectrpc.com/connect v1.x releases. There is no deadline to migrate. v1 and v2 have different module paths, so both can be used in the same module and services can move one at a time.

Full Changelog: connectrpc/connect-go@v1.21.0...v2.0.0


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4efe04d7-51e5-4b9f-ba0c-df3a73a7160d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@renovate
renovate Bot force-pushed the renovate/connectrpc.com-connect-2.x branch 4 times, most recently from 4d70062 to cf9a60e Compare October 26, 2026 21:07
@renovate
renovate Bot force-pushed the renovate/connectrpc.com-connect-2.x branch from cf9a60e to 9bbc7d5 Compare October 28, 2026 23:27
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.

0 participants