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

Correct generated client, bidi stream method stubs #131

Merged
merged 1 commit into from
Oct 20, 2018

Conversation

johanbrandhorst
Copy link
Contributor

@johanbrandhorst johanbrandhorst commented Oct 20, 2018

It appears we were using the responseType instead of the requestType when creating the stream.

Fixes #132, #133

@johanbrandhorst
Copy link
Contributor Author

@jonny-improbable should be a simple merge I hope.

@johanbrandhorst
Copy link
Contributor Author

I've found another problem, lets wait with merging this please.

@johanbrandhorst
Copy link
Contributor Author

@jonny-improbable ok there we go.

@@ -222,13 +222,13 @@ function generateTypescriptDefinition(fileDescriptor: FileDescriptorProto, expor
printer.printIndentedLn(`on(type: 'end', handler: () => void): RequestStream<T>;`);
printer.printIndentedLn(`on(type: 'status', handler: (status: Status) => void): RequestStream<T>;`);
printer.printLn(`}`);
printer.printLn(`interface BidirectionalStream<T> {`);
printer.printIndentedLn(`write(message: T): BidirectionalStream<T>;`);
printer.printLn(`interface BidirectionalStream<Req, Res> {`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd like to know opinions on the Generic type variables here, but I can't use <R, R>, and I think <T, V> is just unclear.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe <ReqT, ResT>?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep ReqT and ResT work for me

@johanbrandhorst
Copy link
Contributor Author

My formatter has formatted the files I've touched, I can try and revert those changes and keep the edits minimal if required.

Copy link
Contributor

@jonnyreeves jonnyreeves left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this up, some pretty silly bugs in there from me 😋

This hints that the project would benefit from a proper integration test against an actual grpc-web server...

If you wouldn't mind reverting the whitespace changes then I'll be happy to merge

Thanks again

@johanbrandhorst johanbrandhorst changed the title Correct generated client stream method stub Correct generated client, bidi stream method stubs Oct 20, 2018
@johanbrandhorst
Copy link
Contributor Author

johanbrandhorst commented Oct 20, 2018

@jonnyreeves should be good now (should I @jonnyreeves or @jonny-improbable?).

@jonnyreeves
Copy link
Contributor

Both work 😁

@jonnyreeves jonnyreeves merged commit 217169b into improbable-eng:master Oct 20, 2018
@johanbrandhorst johanbrandhorst deleted the patch-1 branch October 20, 2018 21:39
@jonnyreeves
Copy link
Contributor

Published as (0.7.8-pre.217169b)

chrisgervang pushed a commit to chrisgervang/flowtype-protoc-gen that referenced this pull request Nov 14, 2018
chrisgervang added a commit to chrisgervang/flowtype-protoc-gen that referenced this pull request Nov 16, 2018
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.

2 participants