grpc-web VS ts-proto

Compare grpc-web vs ts-proto and see what are their differences.

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
grpc-web ts-proto
33 8
8,301 1,913
1.2% -
6.5 9.0
10 days ago 5 days ago
JavaScript TypeScript
Apache License 2.0 Apache License 2.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

grpc-web

Posts with mentions or reviews of grpc-web. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-08-14.
  • Ask HN: WebSocket server transforming channel subscriptions to gRPC streams
    2 projects | news.ycombinator.com | 14 Aug 2023
    * Additionally, client can stream data to the backend server (if bidirectional GRPC streams are used). I.e. client sends WebSocket messages, those will be transformed to GRPC messages by WebSocket server and delivered to the application backend.

    As a result we have a system which allows to quickly create individual streams by using strict GRPC contract but terminating connections over WebSocket transport. So it works well in web browsers. After that no need to write WebSocket protocol, client implementation, handle WebSocket connection. This all will be solved by a suggested WebSocket server and its client SDKs.

    The mechanics is similar to Websocketd (https://github.com/joewalnes/websocketd), but instead of creating OS processes we create GRPC streams. The difference from grpc-web (https://github.com/grpc/grpc-web) is that we provide streaming capabilities but not exposing GRPC contract to the client - just allowing to stream any data as payload (both binary and text) with some wrappers from our client SDKs side for managing subscriptions. I.e. it's not native GRPC streams on the client side - we expose just Connection/Subscription object to stream in both directions. GRPC streams used only for communication between WebSocket server and backend. To mention - grpc-web does not support all kinds of streaming now (https://github.com/grpc/grpc-web#streaming-support) while proposed solution can. This all should provide a cross-platform way to quickly write streaming apps due to client SDKs and language-agnostic nature of GRPC.

    I personally see both pros and cons in this scheme (without concentrating on both too much here to keep the question short). I spent some time thinking about this myself, already have some working prototypes – but turned out need more opinions before moving forward with the idea and releasing this, kinda lost in doubts.

    My main question - whether this seems interesting for someone here? Do you find this useful and see practical value?

  • Build and Deploy a gRPC-Web App Using Rust Tonic and React
    7 projects | dev.to | 19 Jul 2023
    By default, web browsers do not support gRPC, but we will use gRPC-web to make it possible.
  • Lemmy v0.18.0 Release - A reddit alternative written in Rust.
    2 projects | /r/rust | 23 Jun 2023
    You just have to use a library implementation for JavaScript https://github.com/grpc/grpc-web
  • Full Stack Forays with Go and gRPC
    5 projects | dev.to | 5 Jun 2023
    TypeScript support remains an experimental feature of gRPC.
  • Seeking Opinion: Choosing Between Gateway and Envoy Proxy for Our Microservices Architecture
    1 project | /r/SoftwareEngineering | 2 Jun 2023
  • Introducing Tempo: low latency, cross-platform, end-to-end typesafe APIs
    12 projects | /r/programming | 2 May 2023
    The gRPC-Web protocol supports HTTP/1 and can be used from a browser.
  • gRPC on the client side
    9 projects | dev.to | 16 Mar 2023
    -- grpc-web
  • Introduction to gRPC
    1 project | dev.to | 12 Mar 2023
    gRPC is mainly used in server-to-server communication, but it can also be used in client-to-server communication. gRPC-web is a gRPC implementation for web browsers. It is a JavaScript library that allows you to call gRPC services from a web browser. It supports Unary and Streaming Server API calls.
  • gRPC vs REST: Comparing API Styles in Practice
    6 projects | dev.to | 21 Feb 2023
    Since we're using Envoy, there's one more neat trick that we can employ. It turns out that Envoy also support gRPC-Web out of the box, a JavaScript client designed to support gRPC communication from the browser! That means that we can send gRPC messages over HTTP/1.1 as base64 encoded strings or as binary protobufs. Messages will be sent through our proxy and on to our backend service. The advantage of this is smaller and more efficient wire communication which should lead to better performance.
  • Understanding gRPC Concepts, Use Cases & Best Practices
    9 projects | dev.to | 15 Jan 2023
    protoc-gen-grpc-web — a plugin that allows our front end to communicate with the backend using gRPC calls. A separate blog post on this coming up in the future.

ts-proto

Posts with mentions or reviews of ts-proto. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-05-03.
  • Deno-first implementation of protobuf Reader and Writer
    2 projects | /r/Deno | 3 May 2023
    I created it so that I could use `protoc` and `ts-proto` to convert the otel proto files into typescript files.
  • Is TypeScript actually worth It?
    12 projects | news.ycombinator.com | 12 Jan 2023
    Re libraries incompatible with certain typescript versions - e.g. protobufjs fix - it’s been my experience that you want to try and only use compilers specific to each library and compile libraries separately. It’s unfortunate but the JS community often tries to run all JS for a project through the same single compiler tool chain, using one global version of the compiler instead of relying on and effectively linking the JS output for each library. Unless you routinely rewrite third-party libraries to match your toolchain’s expectations, you’re going to have a hard time doing that.

    For a library that generates code, that’s a special case, as the code it generates must target a particular language version. You have three choices: 1. Upstream a fix as you propose; 2. Side-by-side install both TS 4.6 and TS 4.7 using workspaces or sub-projects and have some of your code compile with 4.6 and then link the results or 3. Find a replacement that is updated to 4.7. For example, https://github.com/stephenh/ts-proto has 4.7 support listed in its readme.

  • Protobuf-ES: The Protocol Buffers TypeScript/JavaScript runtime we all deserve
    14 projects | news.ycombinator.com | 31 Oct 2022
  • [help] Tonic-build: how to generate generic service definition?
    4 projects | /r/rust | 13 Jun 2022
    With ts-proto, I can pass a --ts_proto_opt=outputServices=generic-definitions as a flag to protoc to generate "generic service definitions". These definitions contain descriptors for each method, which allows to generate server and client stubs at runtime, and also generate strong types for them at compile time.
  • Connect: A Better gRPC
    10 projects | news.ycombinator.com | 1 Jun 2022
    Curious to see their typescript implementation and how it compares with https://github.com/stephenh/ts-proto which works great for grpc-web.
  • Why isn't gRPC used more for browser to api transport over REST / graphql?
    8 projects | /r/webdev | 2 Apr 2022
    I'm planning on modding https://github.com/stephenh/ts-proto to use https://github.com/ianstormtaylor/superstruct on the client.
  • React Native + gRPC 2021
    2 projects | /r/reactnative | 14 Apr 2021
    We also use protobufs and typescript, so we use ts-proto for codegen + binding to grpc services.
  • Typescript clients for invoking Protobuf services over HTTP
    2 projects | /r/typescript | 13 Mar 2021
    Fwiw I maintain ts-proto (https://github.com/stephenh/ts-proto/) and it'd be cool to have the functionality you're building supported in ts-proto at somepoint, if you're curious/want to poke around/etc. :-) Right now there is grpc support via the improbable-eng grpcwebproxy, but supporting GCP's transcoding as well would be great.

What are some alternatives?

When comparing grpc-web and ts-proto you can also consider the following projects:

ngx-grpc - Angular gRPC framework

protobuf-ts - Protobuf and RPC for TypeScript

grpc-over-webrtc - gRPC over WebRTC

protoc-gen-typescript-http - Generate types and service clients from protobuf definitions annotated with http rules.

grpcurl - Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers

protobuf-es - Protocol Buffers for ECMAScript. The only JavaScript Protobuf library that is fully-compliant with Protobuf conformance tests.

buf - The best way of working with Protocol Buffers.

deno-pbf - Deno pbf port of https://github.com/mapbox/pbf

webrpc - webrpc is a schema-driven approach to writing backend services for modern Web apps and networks

grpc-web - gRPC Web implementation for Golang and TypeScript

evans - Evans: more expressive universal gRPC client

rpc_ts - Remote Procedure Calls in TypeScript made simple 🤞