From 7b39531bc11e5e0c27db9fa0ceafc847b9dcf6c5 Mon Sep 17 00:00:00 2001 From: sebmarkbage Date: Tue, 25 Apr 2023 11:43:52 -0700 Subject: [PATCH] Fix File Upload in Node.js (#26700) Summary: Use the Blob constructor + append with filename instead of File constructor. Node.js doesn't expose a global File constructor but does support it in this form. Queue fields until we get the 'end' event from the previous file. We rely on previous files being available by the time a field is resolved. However, since the 'end' event in Readable is fired after two micro-tasks, these are not resolved in order. I use a queue of the fields while we're still waiting on files to finish. This still doesn't resolve files and fields in order relative to each other but that doesn't matter for our usage. DiffTrain build for commit https://github.com/facebook/react/commit/a21d1475ffd7225a463f2d0c0c9b732c8dd795eb. Changelog: [Internal] Reviewed By: poteto Differential Revision: D45238341 fbshipit-source-id: d4ce8cf0201a231263c753989267e85f92908b9e --- packages/react-native/Libraries/Renderer/REVISION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/Renderer/REVISION b/packages/react-native/Libraries/Renderer/REVISION index 46f23e1397a..7a86f423885 100644 --- a/packages/react-native/Libraries/Renderer/REVISION +++ b/packages/react-native/Libraries/Renderer/REVISION @@ -1 +1 @@ -36e4cbe2e918ec9c8a7abbfda28898c835361fb2 +a21d1475ffd7225a463f2d0c0c9b732c8dd795eb