From 3cbdb5cbcd0d9289e6f48278499ee0ec6a04b2e5 Mon Sep 17 00:00:00 2001 From: Patrick Roza Date: Thu, 2 Jul 2026 20:56:03 +0200 Subject: [PATCH] fix(client): remove automatic request make calls --- packages/effect-app/src/client/apiClientFactory.ts | 4 ++-- packages/effect-app/src/client/clientFor.ts | 9 +++++---- packages/vue/src/makeClient.ts | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/effect-app/src/client/apiClientFactory.ts b/packages/effect-app/src/client/apiClientFactory.ts index dfab8d5f5..ad5a952ac 100644 --- a/packages/effect-app/src/client/apiClientFactory.ts +++ b/packages/effect-app/src/client/apiClientFactory.ts @@ -301,7 +301,7 @@ const makeApiClientFactory = Effect mr.contextEffect.pipe( Effect.flatMap((svcs) => { const rpcEffect = TheClient - .use((client) => (client as any)[requestAttr]!(Request.make(input)) as Effect.Effect) + .use((client) => (client as any)[requestAttr]!(input) as Effect.Effect) .pipe( // local: true → isolate to this RPC call. `layers` is pure today // (RequestName + caller-supplied requestLevelLayers), but the @@ -324,7 +324,7 @@ const makeApiClientFactory = Effect TheClient .useSync((client) => { const rpcStream = (client as any)[requestAttr]!( - Request.make(input) + input ) as Stream.Stream return rpcStream.pipe( // Collect server invalidation keys from the "done" chunk, then discard it. diff --git a/packages/effect-app/src/client/clientFor.ts b/packages/effect-app/src/client/clientFor.ts index bb4da478e..f3d987261 100644 --- a/packages/effect-app/src/client/clientFor.ts +++ b/packages/effect-app/src/client/clientFor.ts @@ -133,8 +133,8 @@ export type RequestStreamHandler // make sure this is exported or d.ts of apiClientFactory breaks?! -export type RequestInputFromMake any }> = Parameters extends - [] ? void : Parameters[0] +export type RequestInputFromMake = + I["~type.make.in"] // Has no input only when the request schema declares no payload fields (the auto-added // `_tag` field is ignored). Any payload fields (even all-optional) produce a function handler. @@ -142,13 +142,14 @@ type HasNoFields = I extends { readonly fields: infer F extends S.Struct.Fiel ? [Exclude] extends [never] ? true : false : false -type RequestInput any }> = Parameters[0] +type RequestInput = + I["~type.make.in"] /** * Caller-facing input type for a request. `void` when the request schema has no fields; * otherwise `make`'s first param type. */ -export type HandlerInput any }> = HasNoFields extends true ? void +export type HandlerInput = HasNoFields extends true ? void : RequestInput /** Extracts the final-value type from a stream request. Defaults to the success type when no `final` schema is set. */ diff --git a/packages/vue/src/makeClient.ts b/packages/vue/src/makeClient.ts index 2ed232d71..55a3e1c8f 100644 --- a/packages/vue/src/makeClient.ts +++ b/packages/vue/src/makeClient.ts @@ -1268,6 +1268,6 @@ export interface CommandBase { export interface EffectCommand extends CommandBase, A, E> {} -export interface CommandFromRequest any }, A = unknown, E = unknown> +export interface CommandFromRequest extends EffectCommand, A, E> {}