dillon1000/react

Commit

[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.
Browse files
Changed paths4 files
First-parent comparison
M packages/react-dom-bindings/src/server/ReactDOMLegacyServerStreamConfig.js ModifiedM packages/react-html/src/__tests__/ReactHTMLClient-test.js ModifiedM packages/react-html/src/__tests__/ReactHTMLServer-test.js ModifiedM packages/react-server/src/ReactFlightServer.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…