SIGN IN SIGN UP

[Flight] Make byteLengthOfChunk Optional (#30130)

We use this to encode the binary length of a large string without
escaping it. This is really kind of optional though. This lets a Server
that can't encode strings but just pass them along able to emit RSC -
albeit a less optimal format.

The only build we have that does that today is react-html but the FB
version of Flight had a similar constraint.

It's still possible to support binary data as long as
byteLengthOfBinaryChunk is implemented which doesn't require a text
encoder. Many streams (including Node streams) support binary OR string
chunks.
S
Sebastian Markbåge committed
2e72ea8401df491c1c6aa7af80419af8e21d8cc6
Parent: 58af67a
Committed by GitHub <noreply@github.com> on 6/28/2024, 5:42:17 PM