Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interface Rpc not exported in service definition #1107

Open
marcaddeo opened this issue Sep 14, 2024 · 2 comments · May be fixed by #1115
Open

interface Rpc not exported in service definition #1107

marcaddeo opened this issue Sep 14, 2024 · 2 comments · May be fixed by #1115

Comments

@marcaddeo
Copy link

When I generate a service the Rpc interface is not exported, should it be?

interface Rpc {
  request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
}

I'm trying to implement it as a custom rpc to pass to my ServiceClientImpl that is generated, but since it's not exported I have to edit the file to add export.

@stephenh
Copy link
Owner

Hi @marcaddeo ! Apologies for the late reply, I have to batch when I triage ts-proto issues...

I'm not sure why we haven't exported Rpc, but that makes sense; if you'd like to submit a PR, that would be amazing, the code is around in here:

https://github.com/stephenh/ts-proto/blob/main/src/generate-services.ts#L459

Or here if you're using grpc-web:

https://github.com/stephenh/ts-proto/blob/main/src/generate-grpc-web.ts#L176

Thanks!

@marcaddeo marcaddeo linked a pull request Sep 30, 2024 that will close this issue
@marcaddeo
Copy link
Author

@stephenh no worries! Was easy enough to just patch that after codegen in the interim. PR submitted.

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 a pull request may close this issue.

2 participants