[Flight] Don't serialize toJSON in Debug path and omit wide arrays (#34759)
There's a couple of issues with serializing Buffer in the debug renders. For one, the Node.js Buffer has a `toJSON` on it which turns the binary data into a JSON array which is very inefficient to serialize compared to the real buffer. For debug info we never really want to resolve these and unlike the regular render we can't error. So this uses the trick where we read the original value. It's still unfortunate that this intermediate gets created at all but at least now we're not serializing it. Second, we have a limit on depth of objects but we didn't have a limit on width like large arrays or typed arrays. This omits large arrays from the payload when possible and make them deferred when there's a debug channel. DiffTrain build for [3025aa39649ef5106c34cc7896a63d63b2edee91](https://github.com/facebook/react/commit/3025aa39649ef5106c34cc7896a63d63b2edee91)
S
sebmarkbage committed
3c5cf7ffadbe42980889c361dec11c9de75b93f0
Parent: 5e93f76