Skip to content

Conversation

marcaddeo
Copy link

This updates the generation of the Rpc interface to be publicly exported so consumers can define custom Rpc implementations.

Closes #1107

const { useAbortSignal } = options;

chunks.push(code`interface Rpc {`);
chunks.push(code`export interface Rpc {`);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @marcaddeo , thanks for the PR!

Can you update this to conditionally add the export, i.e. something like:

  const maybeExport = options.exportCommonSymbols ? "export" : "";

Because we have some users where, when working with multiple *.proto files, these common exports can import conflicts, so they can opt to turn off the export. Thanks!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah dang, that's true. I'm one of those people who opt out of the common exports too... So now this isn't going to help me at all 😅

Will update though.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh no! Sorry! :-)

Fwiw #1109 is an idea to make a shared ./ts-proto-types.ts type file that have all these common types, and be output all the time, in just one spot, in theory allowing us to kill the common exports problem.

If you're up for tackling a PR for that, that'd be amazing! 🙏

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 this pull request may close these issues.

interface Rpc not exported in service definition

2 participants