diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index ffb9c9016f33a..ef8c9de32deed 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -d1547defe34cee6326a61059148afc83228d8ecf +2acfb7b60922bdc8376dd144ca7bc532df78254b diff --git a/compiled/facebook-www/ReactFlightDOMClient-dev.modern.js b/compiled/facebook-www/ReactFlightDOMClient-dev.modern.js index b235c2c658cc0..ff5ddc5206efc 100644 --- a/compiled/facebook-www/ReactFlightDOMClient-dev.modern.js +++ b/compiled/facebook-www/ReactFlightDOMClient-dev.modern.js @@ -839,6 +839,21 @@ if (__DEV__) { return undefined; } + case "K": { + // FormData + var _id7 = parseInt(value.slice(2), 16); + + var _data3 = getOutlinedModel(response, _id7); + + var formData = new FormData(); + + for (var i = 0; i < _data3.length; i++) { + formData.append(_data3[i][0], _data3[i][1]); + } + + return formData; + } + case "I": { // $Infinity return Infinity; @@ -891,9 +906,9 @@ if (__DEV__) { default: { // We assume that anything else is a reference ID. - var _id7 = parseInt(value.slice(1), 16); + var _id8 = parseInt(value.slice(1), 16); - var _chunk2 = getChunk(response, _id7); + var _chunk2 = getChunk(response, _id8); switch (_chunk2.status) { case RESOLVED_MODEL: diff --git a/compiled/facebook-www/ReactFlightDOMClient-prod.modern.js b/compiled/facebook-www/ReactFlightDOMClient-prod.modern.js index 0bd061730aba5..2869831bc1599 100644 --- a/compiled/facebook-www/ReactFlightDOMClient-prod.modern.js +++ b/compiled/facebook-www/ReactFlightDOMClient-prod.modern.js @@ -296,6 +296,13 @@ function parseModelString(response, parentObject, key, value) { ); case "B": return; + case "K": + parentObject = parseInt(value.slice(2), 16); + response = getOutlinedModel(response, parentObject); + parentObject = new FormData(); + for (key = 0; key < response.length; key++) + parentObject.append(response[key][0], response[key][1]); + return parentObject; case "I": return Infinity; case "-": diff --git a/compiled/facebook-www/ReactFlightDOMServer-dev.modern.js b/compiled/facebook-www/ReactFlightDOMServer-dev.modern.js index 5a1a86f8f854e..8b8d787870098 100644 --- a/compiled/facebook-www/ReactFlightDOMServer-dev.modern.js +++ b/compiled/facebook-www/ReactFlightDOMServer-dev.modern.js @@ -2032,6 +2032,12 @@ if (__DEV__) { return "$Q" + id.toString(16); } + function serializeFormData(request, formData) { + var entries = Array.from(formData.entries()); + var id = outlineModel(request, entries); + return "$K" + id.toString(16); + } + function serializeSet(request, set) { var entries = Array.from(set); @@ -2338,6 +2344,10 @@ if (__DEV__) { if (value instanceof Set) { return serializeSet(request, value); + } // TODO: FormData is not available in old Node. Remove the typeof later. + + if (typeof FormData === "function" && value instanceof FormData) { + return serializeFormData(request, value); } var iteratorFn = getIteratorFn(value); @@ -2730,6 +2740,10 @@ if (__DEV__) { if (value instanceof Set) { return serializeSet(request, value); + } // TODO: FormData is not available in old Node. Remove the typeof later. + + if (typeof FormData === "function" && value instanceof FormData) { + return serializeFormData(request, value); } var iteratorFn = getIteratorFn(value); diff --git a/compiled/facebook-www/ReactFlightDOMServer-prod.modern.js b/compiled/facebook-www/ReactFlightDOMServer-prod.modern.js index dacda1a2eb07a..a05063b08cc6c 100644 --- a/compiled/facebook-www/ReactFlightDOMServer-prod.modern.js +++ b/compiled/facebook-www/ReactFlightDOMServer-prod.modern.js @@ -862,6 +862,11 @@ function renderModelDestructive( parentPropertyName.set(parent, -1)); return "$W" + outlineModel(request, value).toString(16); } + if ("function" === typeof FormData && value instanceof FormData) + return ( + (value = Array.from(value.entries())), + "$K" + outlineModel(request, value).toString(16) + ); null === value || "object" !== typeof value ? (parent = null) : ((parent =