Skip to content

Commit

Permalink
Implement Client Streaming and BiDi Streaming for grpc-web (#82)
Browse files Browse the repository at this point in the history
* WIP

* Fix tests

* Improve test coverage

* WIP

* Finish off tests

* Document connecting Chrome Inspector to test runs.

* Reinstate test for service creation.

* Reinstate mocha-reporter
  • Loading branch information
jonnyreeves authored Sep 6, 2018
1 parent 24fbad6 commit 5959599
Show file tree
Hide file tree
Showing 14 changed files with 649 additions and 68 deletions.
9 changes: 8 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,11 @@ The following is a set of guidelines for contributing to `ts-protoc-gen`.
Please review and follow our [Code of Conduct](https://github.com/improbable-eng/ts-protoc-gen/blob/master/README.md).

## Releasing
Your changes will be released with the next version release.
Your changes will be released with the next version release.

## Debugging
You can attach the Chrome Inspector when running the tests by setting the `MOCHA_DEBUG` environment variable before running the tests, ie:

```
MOCHA_DEBUG=true npm test
```
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ For our latest build straight from master:
```bash
npm install ts-protoc-gen@next
```

### bazel
Include the following in your `WORKSPACE`:
```python
Expand Down
1 change: 1 addition & 0 deletions examples/generated/proto/examplecom/simple_service_pb.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/generated/proto/examplecom/simple_service_pb.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 41 additions & 3 deletions examples/generated/proto/examplecom/simple_service_pb_service.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

113 changes: 109 additions & 4 deletions examples/generated/proto/examplecom/simple_service_pb_service.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions examples/generated/proto/orphan_pb_service.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@types/node": "^7.0.52",
"babel": "^6.5.2",
"chai": "^3.5.0",
"grpc-web-client": "^0.5.0",
"grpc-web-client": "^0.6.0",
"lodash": "^4.17.5",
"lodash.isequal": "^4.5.0",
"mocha": "^5.2.0",
Expand Down
7 changes: 5 additions & 2 deletions proto/examplecom/simple_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ package examplecom;

import "proto/othercom/external_child_message.proto";

// this import should not be output in the generated typescript service
// these imports should not be output in the generated typescript service
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";

message UnaryRequest {
Expand All @@ -20,7 +21,9 @@ message StreamRequest {

service SimpleService {
rpc DoUnary(UnaryRequest) returns (othercom.ExternalChildMessage) {}
rpc DoStream(StreamRequest) returns (stream othercom.ExternalChildMessage) {}
rpc DoServerStream(StreamRequest) returns (stream othercom.ExternalChildMessage) {}
rpc DoClientStream(stream StreamRequest) returns (google.protobuf.Empty) {}
rpc DoBidiStream(stream StreamRequest) returns (stream othercom.ExternalChildMessage) {}

// checks that rpc methods that use reserved JS words don't generate invalid code
rpc Delete(UnaryRequest) returns (UnaryResponse) {}
Expand Down
Loading

0 comments on commit 5959599

Please sign in to comment.