Skip to content

Commit 25f9a88

Browse files
authored
feat: support optional proto3 fields for grpc (#165)
Upgrading ts-protoc-gen allowed TS protos to compile, but was insufficient to get grpc codegen working; for that, we need to upgrade a few other things. Also add a test to assert that codegen works for protos with `optional` fields.
1 parent f6641db commit 25f9a88

File tree

4 files changed

+179
-193
lines changed

4 files changed

+179
-193
lines changed

WORKSPACE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ http_archive(
2121

2222
http_archive(
2323
name = "rules_proto",
24-
sha256 = "aa1ee19226f707d44bee44c720915199c20c84a23318bb0597ed4e5c873ccbd5",
25-
strip_prefix = "rules_proto-40298556293ae502c66579620a7ce867d5f57311",
24+
sha256 = "c22cfcb3f22a0ae2e684801ea8dfed070ba5bed25e73f73580564f250475e72d",
25+
strip_prefix = "rules_proto-4.0.0-3.19.2",
2626
urls = [
27-
"https://github.com/bazelbuild/rules_proto/archive/40298556293ae502c66579620a7ce867d5f57311.tar.gz",
27+
"https://github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0-3.19.2.tar.gz",
2828
],
2929
)
3030

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
"repository": "https://github.com/Dig-Doug/rules_typescript_proto",
55
"license": "Apache-2.0",
66
"dependencies": {
7-
"google-protobuf": "3.12.2"
7+
"google-protobuf": "3.15.5"
88
},
99
"devDependencies": {
1010
"@bazel/concatjs": "3.0.0",
1111
"@bazel/jasmine": "3.0.0",
1212
"@bazel/rollup": "3.0.0",
1313
"@bazel/typescript": "3.0.0",
1414
"@grpc/grpc-js": "1.2.1",
15-
"@improbable-eng/grpc-web": "0.13.0",
16-
"@types/google-protobuf": "3.7.2",
15+
"@improbable-eng/grpc-web": "0.15.0",
16+
"@types/google-protobuf": "3.15.5",
1717
"@types/jasmine": "3.5.11",
1818
"@types/node": "12.12.50",
1919
"c8": "^7.10.0",
2020
"clang-format": "1.4.0",
2121
"grpc": "1.24.9",
22-
"grpc-tools": "1.10.0",
22+
"grpc-tools": "1.11.2",
2323
"husky": "4.2.5",
2424
"jasmine": "^3.10.0",
2525
"jasmine-core": "^3.10.1",

test/proto/pizza_service.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ service PizzaService {
1313
message OrderPizzaRequest {
1414
// The list of pizzas to order.
1515
repeated Pizza pizzas = 1;
16+
optional string toppings = 2;
1617
}
1718

1819
message OrderPizzaResponse {

0 commit comments

Comments
 (0)