Re: [whatwg/fetch] Body.json reviver (#104)

Same platform feature (JSON parsing), so default should be same/similar API and capabilities, see https://en.wikipedia.org/wiki/Principle_of_least_astonishment
The justification is on you: why a _different_ API?

The only justification I can see in this thread is "code is written in C++ so can't use a JS callback", which is not enough in my opinion. You can have a `.json()` C++ implementation and `.json(reviver)` in JS.

Here's some fan-fiction: jods upgrades his old code.
"Hey there's this cool new API `fetch` to grab data from the server, it even has some deserialization built-in!
I'm gonna replace my ugly `XmlHttpRequest` code (includes a reviver) with a one liner, so cool."

nope -- can't do. New APIs have a smaller feature-set than old ones.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/104#issuecomment-395093494

Received on Wednesday, 6 June 2018 14:42:45 UTC