News for hackers. Stuff that matters.
Re:gRPC-Web: Moving past REST+JSON towards type-safe Web APIs by aristidb on Thursday April 27, 2017 @07:17AM (#14210649)
"protocol buffers which have zero backwards compatibility"

Either I misunderstand you, or this is _remarkably_ wrong: Protocol buffers were designed to make it easy to define protocols which are both backward and forward compatible.

Re:gRPC-Web: Moving past REST+JSON towards type-safe Web APIs by andrewingram on Thursday April 27, 2017 @07:58AM (#14210788)
My understanding is the same. Though I had also come to believe that the primary way to achieve this is via loose constraints, i.e. required fields should be used VERY sparingly.

This compatibility pattern also leads me to conclude that protocol buffers aren't a suitable model for generating a client-side type system. You'll just end up with structures where everything is a Maybe type, so you end up needing tons of bespoke client-side code to handle the possible permutations.

You need a layer on top of of them to express the true type system suitable for clients, and I believe GraphQL does a great job of this (but I hasten to add that even GraphQL's type system is relatively limited and isn't a magic bullet).

Re:gRPC-Web: Moving past REST+JSON towards type-safe Web APIs by vardump on Thursday April 27, 2017 @08:05AM (#14210818)
gRPC is based on protobuf3, which doesn't support "required" or "optional" in the first place.
Re:gRPC-Web: Moving past REST+JSON towards type-safe Web APIs by andrewingram on Thursday April 27, 2017 @08:27AM (#14210927)
so everything is optional?
Re:gRPC-Web: Moving past REST+JSON towards type-safe Web APIs by euyyn on Thursday April 27, 2017 @01:09PM (#14213082)
Except primitive types. So this is avoided:

> You'll just end up with structures where everything is a Maybe type, so you end up needing tons of bespoke client-side code to handle the possible permutations.

Absent primitive values default to zero, while absent message fields are mapped to what makes most sense in the specific programming language (in most of them, "null" or "nil").

Re:gRPC-Web: Moving past REST+JSON towards type-safe Web APIs by beastman82 on Thursday April 27, 2017 @08:43AM (#14210991)
yes