News for hackers. Stuff that matters.
Re:Why We’re Switching to gRPC by stephenr on Monday May 27, 2019 @02:09PM (#20024100)
you’d probably need to do some tricks to get it to parse in a browser.

Editing, because I can’t reply: I was specifically going to mention SSE/EventSource but expected an immediate “not everything is a browser” response.

Editing the 2nd: yep, that’s kinda what I meant by “tricks” - essentially splitting out chunks to pass to the json parser.

Re:Why We’re Switching to gRPC by jwalton on Monday May 27, 2019 @02:16PM (#20024149)
See my edited example above; you can stream data to this, it'll stream nicely to the browser. This uses "\n"s at the end of every line, which means you can write a very simple streaming parser client side, because you can just split the input at "\n," to get nice JSON bits, but there's certainly JSON streaming libraries on NPM that will parse this for you more "properly". And, it parses with a normal JSON parser too.
Re:Why We’re Switching to gRPC by pbedat on Monday May 27, 2019 @02:22PM (#20024197)
Modern browsers understand text/event-stream so no need for dirty tricks ;)