From 8b25cf336ce38ba70ad57afa2a2e33fa7a358da0 Mon Sep 17 00:00:00 2001 From: Sri Krishna <93153132+srikrsna-buf@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:23:44 +0530 Subject: [PATCH] V2: Remove `createPromiseClient` and `PromiseClient` (#1240) Signed-off-by: Sri Krishna Paritala --- packages/connect-web-bench/README.md | 8 ++++---- packages/connect-web-bench/chart.svg | 10 +++++----- packages/connect/src/index.ts | 4 ++-- packages/connect/src/promise-client.ts | 15 --------------- 4 files changed, 11 insertions(+), 26 deletions(-) diff --git a/packages/connect-web-bench/README.md b/packages/connect-web-bench/README.md index f1091ce8f..4b1e96adb 100644 --- a/packages/connect-web-bench/README.md +++ b/packages/connect-web-bench/README.md @@ -15,10 +15,10 @@ usually do. We repeat this for an increasing number of RPCs. | code generator | RPCs | bundle size | minified | compressed | | -------------- | ---: | ----------: | --------: | ---------: | -| Connect-ES | 1 | 276,503 b | 176,399 b | 35,752 b | -| Connect-ES | 4 | 280,755 b | 179,501 b | 36,598 b | -| Connect-ES | 8 | 285,618 b | 183,932 b | 37,485 b | -| Connect-ES | 16 | 294,746 b | 191,556 b | 38,999 b | +| Connect-ES | 1 | 276,503 b | 176,399 b | 35,786 b | +| Connect-ES | 4 | 280,755 b | 179,501 b | 36,562 b | +| Connect-ES | 8 | 285,618 b | 183,932 b | 37,491 b | +| Connect-ES | 16 | 294,746 b | 191,556 b | 38,985 b | | gRPC-Web | 1 | 876,563 b | 548,495 b | 52,300 b | | gRPC-Web | 4 | 928,964 b | 580,477 b | 54,673 b | | gRPC-Web | 8 | 1,004,833 b | 628,223 b | 57,118 b | diff --git a/packages/connect-web-bench/chart.svg b/packages/connect-web-bench/chart.svg index ab3a87730..5280d7869 100644 --- a/packages/connect-web-bench/chart.svg +++ b/packages/connect-web-bench/chart.svg @@ -42,13 +42,13 @@ 0 KiB - + Connect-ES -Connect-ES 34.91 KiB for 1 RPCs -Connect-ES 35.74 KiB for 4 RPCs -Connect-ES 36.61 KiB for 8 RPCs -Connect-ES 38.08 KiB for 16 RPCs +Connect-ES 34.95 KiB for 1 RPCs +Connect-ES 35.71 KiB for 4 RPCs +Connect-ES 36.61 KiB for 8 RPCs +Connect-ES 38.07 KiB for 16 RPCs diff --git a/packages/connect/src/index.ts b/packages/connect/src/index.ts index a262c0e1a..d5f34c1c5 100644 --- a/packages/connect/src/index.ts +++ b/packages/connect/src/index.ts @@ -21,8 +21,8 @@ export { } from "./http-headers.js"; export { createCallbackClient } from "./callback-client.js"; export type { CallbackClient } from "./callback-client.js"; -export { createClient, createPromiseClient } from "./promise-client.js"; -export type { Client, PromiseClient } from "./promise-client.js"; +export { createClient } from "./promise-client.js"; +export type { Client } from "./promise-client.js"; export type { CallOptions } from "./call-options.js"; export type { Transport } from "./transport.js"; export type { diff --git a/packages/connect/src/promise-client.ts b/packages/connect/src/promise-client.ts index b8004e337..733367b33 100644 --- a/packages/connect/src/promise-client.ts +++ b/packages/connect/src/promise-client.ts @@ -47,11 +47,6 @@ export type Client = { : never; }; -/** - * @deprecated use Client - */ -export type PromiseClient = Client; - /** * Create a Client for the given service, invoking RPCs through the * given transport. @@ -76,16 +71,6 @@ export function createClient( }) as Client; } -/** - * @deprecated use createClient. - */ -export function createPromiseClient( - service: T, - transport: Transport, -) { - return createClient(service, transport); -} - /** * UnaryFn is the method signature for a unary method of a PromiseClient. */