-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add `grpc-node` support - Refactor `typescript_proto_library` to generate only messages - Add `typescript_grpc_web_library` to provide previous functionality - Add `typescript_grpc_node_library` to add grpc-node support - Improve documentation - Add migration guide when coming from previous versions - Update `ts-protoc-gen` Co-authored-by: Jens Ulrich Hjuler Fosgerau <[email protected]>
- Loading branch information
Showing
14 changed files
with
987 additions
and
2,902 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Migrating to multi_rules | ||
|
||
Previously, the `typescript_proto_library` rule would also build grpc-web outputs automatically. | ||
|
||
This is now split into multiple rules to align with other languages: | ||
- `typescript_proto_library` for outputting protobuf messages files (_pb.d.ts, _pb.js) | ||
- `typescript_grpc_node_library` for outputting protobuf service and client files (_grpc_pb.d.ts, _grpc_pb.js); supports both grpc and grpc-js requires | ||
- `typescript_grpc_web_library` for outputting protobuf service and client files (_pb_service.d.ts, _pb_service.js) | ||
|
||
To keep the same behavior, add to your definition: | ||
```python | ||
# Before: | ||
typescript_proto_library( | ||
name = "test_ts_proto", | ||
proto = ":test_proto", | ||
) | ||
|
||
# After: | ||
typescript_proto_library( | ||
name = "test_ts_proto", | ||
proto = ":test_proto", | ||
) | ||
typescript_grpc_web_library( | ||
name = "test_ts_grpc_web", | ||
proto = ":test_proto", | ||
) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
load("//src:typescript_proto_library.bzl", _typescript_proto_library = "typescript_proto_library") | ||
load("//src:typescript_grpc_node_library.bzl", _typescript_grpc_node_library = "typescript_grpc_node_library") | ||
load("//src:typescript_grpc_web_library.bzl", _typescript_grpc_web_library = "typescript_grpc_web_library") | ||
load("//src:rules_typescript_proto_dependencies.bzl", _rules_typescript_proto_dependencies = "rules_typescript_proto_dependencies") | ||
|
||
rules_typescript_proto_dependencies = _rules_typescript_proto_dependencies | ||
typescript_proto_library = _typescript_proto_library | ||
typescript_grpc_node_library = _typescript_grpc_node_library | ||
typescript_grpc_web_library = _typescript_grpc_web_library |
Oops, something went wrong.