dillon1000/react

Commit

[Flight Reply] Encode FormData (#26663)

Builds on top of https://github.com/facebook/react/pull/26661

This lets you pass FormData objects through the Flight Reply
serialization. It does that by prefixing each entry with the ID of the
reference and then the decoding side creates a new FormData object
containing only those fields (without the prefix).

Ideally this should be more generic. E.g. you should be able to pass
Blobs, Streams and Typed Arrays by reference inside plain objects too.
You should also be able to send Blobs and FormData in the regular Flight
serialization too so that they can go both directions. They should be
symmetrical. We'll get around to adding more of those features in the
Flight protocol as we go.

---------

Co-authored-by: Sophie Alpert <[email protected]>
Browse files
Changed paths10 files
First-parent comparison
M fixtures/flight/src/App.js ModifiedA fixtures/flight/src/Form.js AddedM fixtures/flight/src/actions.js ModifiedM packages/react-client/src/ReactFlightReplyClient.js ModifiedM packages/react-server-dom-webpack/src/ReactFlightDOMClientBrowser.js ModifiedM packages/react-server-dom-webpack/src/ReactFlightDOMServerBrowser.js ModifiedM packages/react-server-dom-webpack/src/ReactFlightDOMServerEdge.js ModifiedM packages/react-server-dom-webpack/src/ReactFlightDOMServerNode.js ModifiedM packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMReply-test.js ModifiedM packages/react-server/src/ReactFlightReplyServer.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…