Simplify tRPC Request/Response/Message Interfaces
See original GitHub issueOriginally posted by @KATT
See @jlalmes’ PR https://github.com/trpc/trpc/pull/1759
Potential things. Not definitive, just ideas.
Remove unused fields
Before:
[ { "id": null, "result": { "type": "data", "data": { "id": "1", "title": "Hello tRPC", "body": "..." // ... } } }, ]
After:
[ { "result": { "data": { "id": "1", "title": "Hello tRPC", "body": "..." // ... } } }, ]
Changed response to a mapped object
Potential ease of allowing for streaming… maybe we could start sending response as procedures are finalised and not wait for all of them to be finalized before returning… but it also breaks HTTP-codes so not sure.
Probably not a good idea, just a thought
{ // 0 means index 0 of the batch "0": { "id": null, "result": { "type": "data", "data": { "id": "1", "title": "Hello tRPC", "body": "..." // ... } } }, ]
Remove JSONRPC
Remove JSNORPC stuff on the request/response for internal requests…
Issue Analytics
- State:
- Created a year ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Introduction to gRPC
This page introduces you to gRPC and protocol buffers. gRPC can use protocol buffers as both its Interface Definition Language (IDL) and as...
Read more >1. Introduction to gRPC - gRPC: Up and Running [Book]
Inter-process communications are usually implemented using message passing with a synchronous request-response style or asynchronous event-driven styles.
Read more >gRPC Tutorial: Using gRPC for Remote Procedural Calls
This guide shows how you can use gRPC, a open source remote procedure call framework which enables cross-platform communications between ...
Read more >What is gRPC? Meaning, Architecture, Advantages ⚔️
gRPC is one of the latest developer approaches to API design that promises to solve problems that other design styles have failed to...
Read more >Consider gRPC for Mobile APIs - Medium
gRPC and Protobuf precisely define an API service and auto generate iOS and Android client libraries. We evaluate gRPC request-response, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s a good idea and I was thinking about that for a while but I probably will want to decorate responses with extra metadata in the future.
One of the ideas I’ve been toying with is an edge-cached tRPC service that could work a bit like GraphCDN - for that to work I would need to provide caching hints for each individual procedure.
Thanks @sachinraja! Understood 👍