grpc / grpc-web

gRPC for Web Clients
https://grpc.io
Apache License 2.0
8.45k stars 760 forks source link

[Experiment] Generate `thenableCall()` instead of `unaryCall()` #1444

Closed sampajano closed 1 week ago

sampajano commented 1 week ago

This came up in https://github.com/grpc/grpc-web/issues/1331


thenableCall() is what's currently exposed on the AbstractClientBase API. https://github.com/grpc/grpc-web/blob/master/packages/grpc-web/index.d.ts

Which was added in the following commit for the sake of supporting "Generic API" (which no longer applies) https://github.com/grpc/grpc-web/commit/916d6cbef42e10c301c7fd964869f3afdbcb7b17


unaryCall() is just an alias for thenableCall(), where it simply calls the latter.

The right long-term fix is probably to get rid of thenableCall() in favor of unaryCall(), as the latter sounds like a better API (more clear).

sampajano commented 1 week ago

Not planning on merging this. But will keep in mind in simplifying this going forward :)

(FTR - tests passed :))