You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generates appropriate Protocol Buffer sources from Proto files directly through _TypeScript Compiler API_.
8
-
9
-
This plugin generates plain **Typescript** files that can be used AMD, UMD, CommonJS module systems.
7
+
Aim of this protoc plugin is to make usage of protocol buffers easy in Javascript/Typescript by taking modern approaches. This plugin generates plain **Typescript** files that can be used AMD, UMD, CommonJS module systems.
10
8
11
-
Aim of this protoc plugin is to make usage of protocol buffers easy in Javascript/Typescript by taking modern approaches.
12
9
13
10
## Example
14
11
@@ -72,7 +69,7 @@ To overcome this problem, every generated message class has a static method call
72
69
which can handle the mapping bidirectionally for you, even with the deeply structured messages. since it is
73
70
aware of the field graph, it does not rely on any runtime type information thus we get the chance to keep it fast.
74
71
75
-
given the change example above, one can write code as;
There is a seperate documentation for the usage of protoc-gen-ts along with either `@grpc/grpc-js` or `grpc`.
92
+
There is a seperate documentation for the usage of protoc-gen-ts along with either `@grpc/grpc-js` or `grpc`. By default
93
+
this generated gRPC interfaces will use `@grpc/grpc-js`.
95
94
96
95
Checkout [rpcs](docs/rpc.md).
97
96
@@ -140,20 +139,12 @@ ts_proto_library(
140
139
# Checkout the examples/bazel directory for an example.
141
140
```
142
141
143
-
## Environment variables
144
-
145
-
```sh
146
-
# This controls experimental features such as 'Promise' based rpcs.
147
-
export EXPERIMENTAL_FEATURES=true;
142
+
## Supported Options
148
143
144
+
* With `--ts_opt=unary_rpc_promise=true`, the service definition will contain a promise based rpc with a calling pattern of `const result = await client.METHOD(message)`. Note: all othe `metadata` and `options` parameters are still available to you.
149
145
150
-
# This controls the "import statement" for the outputs.
151
-
# this is here for legacy purposes.
152
-
export GRPC_PACKAGE_NAME="@grpc/grpc-js";
153
-
# or
154
-
export GRPC_PACKAGE_NAME="@grpc/grpc";
146
+
* With `--ts_opt=grpc_package=xxxx`, you can specify a different package to import rather than `@grpc/grpc-js`.
0 commit comments