grpc / grpc-web

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

(Typescript) Mark some `metadata` parameters as optional #1369

Closed andrewmbenton closed 11 months ago

andrewmbenton commented 12 months ago

There are a couple of method signatures in the generated TypeScript client that should mark the metadata parameter as optional, to reduce explicitly passing unnecessary null values:

https://github.com/grpc/grpc-web/blob/0ec55aaad784e114bcb391b0b33ac4fd2e83e3f2/javascript/net/grpc/web/generator/grpc_generator.cc#L652-L655

https://github.com/grpc/grpc-web/blob/0ec55aaad784e114bcb391b0b33ac4fd2e83e3f2/javascript/net/grpc/web/generator/grpc_generator.cc#L670-L674

Making the metadata parameter optional in the method returning a Promise would bring the TypeScript client closer in line with the PromiseClient interface available when generating with import_style=commonjs+dts.

Resolves https://github.com/grpc/grpc-web/issues/1368

linux-foundation-easycla[bot] commented 12 months ago

CLA Signed

The committers listed above are authorized under a signed CLA.