Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tomwright/grpc-simple-ts
Protoc plugin to make working with grpc-web easier.
https://github.com/tomwright/grpc-simple-ts
Last synced: 19 days ago
JSON representation
Protoc plugin to make working with grpc-web easier.
- Host: GitHub
- URL: https://github.com/tomwright/grpc-simple-ts
- Owner: TomWright
- License: mit
- Created: 2020-11-20T17:06:28.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-01T15:39:50.000Z (about 3 years ago)
- Last Synced: 2024-10-04T02:41:14.535Z (about 1 month ago)
- Language: Go
- Size: 214 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# grpc-simple-ts
A simple wrapper around [grpc-web](https://github.com/grpc/grpc-web) that maintains typing as outlined in the proto file.
## Table of Contents
* [About](#about)
* [Protoc Usage](#protoc-usage)
* [Typescript Usage](#typescript-usage)## About
Using grpc-web from typescript should be simpler than it is. The compiled data structures and types can make it hard to get started.
This package compiles additional types and mappers that you can use on top of grpc-web to simplify the way you interact with it in your application.
## Protoc Usage
First make sure that you have a `grpc-simple-ts` executable installed:
```
go get -v -ldflags="-s -w" \
github.com/golang/protobuf/protoc-gen-go \
github.com/tomwright/grpc-simple-ts/cmd/protoc-gen-simple-ts@${GO_VERSION_LOCK_SIMPLE_TS} \
2>&1
```And then use `--simple-ts_out=./out` to activate the plugin.
Please note that values of `simple-ts_out`, `grpc-web_out` and `js_out` should match otherwise the generated code may include invalid paths.
```
protoc \
--js_out="import_style=commonjs,binary:./out" \
--grpc-web_out="import_style=commonjs+dts,mode=grpcwebtext:./out" \
--simple-ts_out="./out" \
my.proto
```## Typescript Usage
Coming soon.