Skip to content

Commit d4a09ce

Browse files
committed
Update doc and fix compiled js files.
1 parent a28b3d9 commit d4a09ce

File tree

5 files changed

+26
-6
lines changed

5 files changed

+26
-6
lines changed

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ More information about grpc_tools_node_protoc:
1010
* [source code](https://github.com/grpc/grpc-node/tree/master/packages/grpc-tools)
1111
* [doc how to use](https://github.com/grpc/grpc/blob/master/examples/node/static_codegen/README.md)
1212

13-
And the versions bigger than 3.0.0 support [@grpc/grpc-js](https://www.npmjs.com/package/@grpc/grpc-js). Please read the doc: [@grpc/grpc-js support](https://github.com/agreatfool/grpc_tools_node_protoc_ts/blob/master/doc/grpcjs_support.md).
13+
And the versions over 3.0.0 support [@grpc/grpc-js](https://www.npmjs.com/package/@grpc/grpc-js)([email protected] required). Please read the doc: [@grpc/grpc-js support](https://github.com/agreatfool/grpc_tools_node_protoc_ts/blob/master/doc/grpcjs_support.md). **New version 5.0.0 is recommended for users who using grpc-tools over v1.9.0.**
1414

1515
## Breaking changes
1616
### v4.0.0
@@ -473,14 +473,32 @@ export namespace Example {
473473
```
474474

475475
## Changes
476+
### 5.0.0
477+
Migrating to option `grpc_js` from [[email protected]](https://github.com/grpc/grpc-node/releases/tag/grpc-tools%401.9.0).
478+
479+
Two points:
480+
481+
* Using option `grpc_js` in `grpc_tools_node_protoc ... --grpc_out=grpc_js:...`
482+
* Style of generated js codes looks like traditional `grpc_tools_node_protoc ... --plugin=protoc-gen-grpc=\`which grpc_tools_node_protoc_plugin\``
483+
484+
Difference between grpc-tools version `1.8.1` and `1.9.0`, and also between `generate_package_definition` and `grpc_js` could be found here: [@grpc/grpc-js support @5.0.0](https://github.com/agreatfool/grpc_tools_node_protoc_ts/blob/master/doc/grpcjs_support.md).
485+
486+
Users who is using version 3.0.0 - 4.1.5 would not be affected. In version 5.0.0 options `generate_package_definition` and `grpc_js` are all available. Though, 5.0.0 is recommended for users who using [email protected] or over, don't forget to switch your option to `grpc_js`.
487+
488+
See more details:
489+
490+
* [PR#71](https://github.com/agreatfool/grpc_tools_node_protoc_ts/pull/71)
491+
* [Broken ts imports after moving to grpc-js #70](https://github.com/agreatfool/grpc_tools_node_protoc_ts/issues/70)
492+
* [Broken typescript exports after moving to @grpc/grpc-js#1600](https://github.com/grpc/grpc-node/issues/1600#issuecomment-705097639)
493+
476494
### 4.1.5
477495
Use string literal type for path. See: [PR#69](https://github.com/agreatfool/grpc_tools_node_protoc_ts/pull/69).
478496

479497
### 4.1.4
480498
Add `.npmignore` to shrink the size of npm package. See: [PR#65](https://github.com/agreatfool/grpc_tools_node_protoc_ts/pull/65).
481499

482500
### 4.1.3
483-
Update doc to solve the issues like: [Issue#63](https://github.com/agreatfool/grpc_tools_node_protoc_ts/issues/63).
501+
Update doc to solve issues like: [Issue#63](https://github.com/agreatfool/grpc_tools_node_protoc_ts/issues/63).
484502

485503
### 4.1.1 - 4.1.2
486504
Update grpc-js example codes. Fix vulnerabilities of example packages. Fix type of third param of Client class, see: [PR#62](https://github.com/agreatfool/grpc_tools_node_protoc_ts/pull/62).

build/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/grpcjs_support.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# @grpc/grpc-js support
22

3-
## Breaking changes warning
3+
## Changes
44
Current document is published along with [email protected] and binds to [grpc-tools](https://www.npmjs.com/package/grpc-tools) version equal to or greater than `1.9.0`.
55

66
If you are still using grpc-tools version `1.8.1`, please read the doc of previous version: [doc/[email protected]](https://github.com/agreatfool/grpc_tools_node_protoc_ts/blob/v3.0.0/doc/grpcjs_support.md).
@@ -45,6 +45,8 @@ As you can see:
4545
* `exports['com.book.BookService']` changed to `exports.BookServiceService`
4646
* `exports.BookServiceClient = grpc.makeGenericClientConstructor(BookServiceService);` added
4747
48+
This looks like traditional `grpc_tools_node_protoc ... --plugin=protoc-gen-grpc=\`which grpc_tools_node_protoc_plugin\``.
49+
4850
---
4951

5052
## Why

examples/bash/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ proto/*.proto
3131

3232
grpc_tools_node_protoc \
3333
--plugin=protoc-gen-ts=../bin/protoc-gen-ts \
34-
--ts_out=generate_package_definition:./src/grpcjs/proto \
34+
--ts_out=grpc_js:./src/grpcjs/proto \
3535
-I ./proto \
3636
proto/*.proto
3737

0 commit comments

Comments
 (0)