3 ms·
Why nobody ever mentions JSONRPC 2.0 over WebSockets? It's one page doc simple, debuggable, supports realtime notifications, is bidirectional, works on browser
by mirekrusin 4y ago
Why nobody ever mentions JSONRPC 2.0 over WebSockets? It's one page doc simple, debuggable, supports realtime notifications, is bidirectional, works on browser and your internal apis in pretty much any language and probably fits 99.9% of projects for their requirements. JSON encoding/decoding is extremely fast in any language due to its pervasive usage.
- Kinrany 4y agoMakes more sense to compare it to gRPC at least: REST is not a standard, and JSON-over-HTTP doesn't offer enough to be worth a discussion. Does JSONRPC have tooling for generating clients or API documentation?
- mirekrusin 4y agoClient is something like 20 LoC in js with `ws` npm? You mean typed client with runtime assertions, cross language spec etc, right? That's what I mean, people should be discussing jsonrpc with joi vs zod vs jsonschema, their runtime overhead, cross language support, codegen support etc. Short answer is whatever currently we have for json will work. There is no point in complicating things.