dillon1000/react
Commit
Browse files [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.
Changed paths4 files
First-parent comparisonpackages/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 ModifiedPatch
Files changed
Rendering syntax-highlighted changes…