3 ms·
For my current job, I speced out what was needed for an RPC solution. I ended up basically coming up with what JSON-RPC provides but was missing a few things.
by erdaniels 4y ago
For my current job, I speced out what was needed for an RPC solution. I ended up basically coming up with what JSON-RPC provides but was missing a few things.
1. Binary support for non-web clients
2. Robust code generation
3. First-class cancellation/deadline concepts
4. More guidance around a standard HTTP transport; kind of related to 2
5. Simple schema/type definitions to assist in code generation and API ecosystems
Ultimately, we went with gRPC and it has been pretty nice. The code generation is mostly good and where it isn't, we can make our own wrapping code. There have definitely been some downsides and gotchas when it comes to the servers, specifically around client streaming and bi-di requests. Also, grpc-web is really not great and is the biggest downside so far. Overall though, it feels worth it for our use case. Protobuf has been great.
- blank_fan_pill 4y agowhat have you not liked about grpc-web?
- vyrotek 4y agoPersonally, I find gRPC-Web very attractive but the current state of TypeScript/JS code-gen is very confusing and lacking. I would love something like https://orval.dev https://orval.dev for gRPC-web. Have I missed something or is it just early to expect it? I tried a few libraries but couldn't get them to work or would generate unappealing results. I believe I'm hitting this issue with my local experiments. https://github.com/grpc/grpc-web/issues/535 https://github.com/grpc/grpc-web/issues/535 UPDATE: I was able to get something working with these from a ReactJS app! Server: https://learn.microsoft.com/en-us/aspnet/core/grpc/grpcweb https://learn.microsoft.com/en-us/aspnet/core/grpc/grpcweb Client TS Gen: https://github.com/timostamm/protobuf-ts https://github.com/timostamm/protobuf-ts
- erdaniels 4y agoAh you should check out https://github.com/bufbuild/protobuf-es https://github.com/bufbuild/protobuf-es which feels great so far. Then there's connect by the same buf people but it has a grpc-web option https://connect.build/docs/web/getting-started/ https://connect.build/docs/web/getting-started/. The amount of code generated is also tiny, which I love.
- erdaniels 4y agoUltimately just the fact that we can't use standard browser dev tools to introspect requests. There are some plugins but they have not worked reliably for me.
- Palmik 4y agoAs for better gRPC-web, you might want to look into connect-web https://github.com/bufbuild/connect-web https://github.com/bufbuild/connect-web