From 920a7e8ba6d029042e73df94c0041ee206639dbe Mon Sep 17 00:00:00 2001 From: Josh Story Date: Fri, 20 Oct 2023 10:42:27 -0700 Subject: [PATCH] Update React from a41957507 to d803f519e (#57015) ## React upstream Changes - https://github.com/facebook/react/pull/27542 - https://github.com/facebook/react/pull/27551 - https://github.com/facebook/react/pull/27537 - https://github.com/facebook/react/pull/27549 - https://github.com/facebook/react/pull/27544 - https://github.com/facebook/react/pull/27543 - https://github.com/facebook/react/pull/27541 - https://github.com/facebook/react/pull/27538 - https://github.com/facebook/react/pull/27536 --- package.json | 20 +- ...t-dom-server-legacy.browser.development.js | 21 +- ...om-server-legacy.browser.production.min.js | 4 +- ...eact-dom-server-legacy.node.development.js | 21 +- ...t-dom-server-legacy.node.production.min.js | 4 +- ...t-dom-server-rendering-stub.development.js | 2 +- ...om-server-rendering-stub.production.min.js | 2 +- .../react-dom-server.browser.development.js | 24 +- ...react-dom-server.browser.production.min.js | 78 ++-- .../cjs/react-dom-server.edge.development.js | 24 +- .../react-dom-server.edge.production.min.js | 84 ++--- .../cjs/react-dom-server.node.development.js | 18 +- .../react-dom-server.node.production.min.js | 6 +- .../react-dom-unstable_testing.development.js | 2 +- ...act-dom-unstable_testing.production.min.js | 6 +- .../cjs/react-dom.development.js | 2 +- .../cjs/react-dom.production.min.js | 6 +- .../cjs/react-dom.profiling.min.js | 6 +- .../react-dom-experimental/package.json | 4 +- ...t-dom-server-legacy.browser.development.js | 21 +- ...om-server-legacy.browser.production.min.js | 4 +- ...eact-dom-server-legacy.node.development.js | 21 +- ...t-dom-server-legacy.node.production.min.js | 6 +- ...t-dom-server-rendering-stub.development.js | 2 +- ...om-server-rendering-stub.production.min.js | 2 +- .../react-dom-server.browser.development.js | 20 +- ...react-dom-server.browser.production.min.js | 8 +- .../cjs/react-dom-server.edge.development.js | 20 +- .../react-dom-server.edge.production.min.js | 8 +- .../cjs/react-dom-server.node.development.js | 18 +- .../react-dom-server.node.production.min.js | 6 +- .../react-dom/cjs/react-dom.development.js | 2 +- .../react-dom/cjs/react-dom.production.min.js | 6 +- .../react-dom/cjs/react-dom.profiling.min.js | 6 +- .../next/src/compiled/react-dom/package.json | 4 +- .../cjs/react.development.js | 2 +- .../cjs/react.production.min.js | 2 +- .../cjs/react.shared-subset.development.js | 2 +- .../cjs/react.shared-subset.production.min.js | 2 +- ...om-turbopack-client.browser.development.js | 37 +- ...turbopack-client.browser.production.min.js | 33 +- ...r-dom-turbopack-client.edge.development.js | 46 ++- ...om-turbopack-client.edge.production.min.js | 48 +-- ...r-dom-turbopack-client.node.development.js | 37 +- ...om-turbopack-client.node.production.min.js | 21 +- ...opack-client.node.unbundled.development.js | 37 +- ...ck-client.node.unbundled.production.min.js | 62 ++-- ...om-turbopack-server.browser.development.js | 217 ++++++++--- ...turbopack-server.browser.production.min.js | 116 +++--- ...r-dom-turbopack-server.edge.development.js | 217 ++++++++--- ...om-turbopack-server.edge.production.min.js | 120 ++++--- ...r-dom-turbopack-server.node.development.js | 217 ++++++++--- ...om-turbopack-server.node.production.min.js | 114 +++--- ...opack-server.node.unbundled.development.js | 217 ++++++++--- ...ck-server.node.unbundled.production.min.js | 112 +++--- .../package.json | 4 +- ...om-turbopack-client.browser.development.js | 37 +- ...turbopack-client.browser.production.min.js | 43 +-- ...r-dom-turbopack-client.edge.development.js | 46 ++- ...om-turbopack-client.edge.production.min.js | 56 +-- ...r-dom-turbopack-client.node.development.js | 37 +- ...om-turbopack-client.node.production.min.js | 11 +- ...opack-client.node.unbundled.development.js | 37 +- ...ck-client.node.unbundled.production.min.js | 13 +- ...om-turbopack-server.browser.development.js | 339 +++++++----------- ...turbopack-server.browser.production.min.js | 125 +++---- ...r-dom-turbopack-server.edge.development.js | 339 +++++++----------- ...om-turbopack-server.edge.production.min.js | 125 +++---- ...r-dom-turbopack-server.node.development.js | 339 +++++++----------- ...om-turbopack-server.node.production.min.js | 139 +++---- ...opack-server.node.unbundled.development.js | 339 +++++++----------- ...ck-server.node.unbundled.production.min.js | 133 +++---- .../react-server-dom-turbopack/package.json | 4 +- ...-dom-webpack-client.browser.development.js | 37 +- ...m-webpack-client.browser.production.min.js | 33 +- ...ver-dom-webpack-client.edge.development.js | 46 ++- ...-dom-webpack-client.edge.production.min.js | 48 +-- ...ver-dom-webpack-client.node.development.js | 37 +- ...-dom-webpack-client.node.production.min.js | 21 +- ...bpack-client.node.unbundled.development.js | 37 +- ...ck-client.node.unbundled.production.min.js | 62 ++-- ...-dom-webpack-server.browser.development.js | 217 ++++++++--- ...m-webpack-server.browser.production.min.js | 118 +++--- ...ver-dom-webpack-server.edge.development.js | 217 ++++++++--- ...-dom-webpack-server.edge.production.min.js | 120 ++++--- ...ver-dom-webpack-server.node.development.js | 217 ++++++++--- ...-dom-webpack-server.node.production.min.js | 112 +++--- ...bpack-server.node.unbundled.development.js | 217 ++++++++--- ...ck-server.node.unbundled.production.min.js | 110 +++--- .../package.json | 4 +- ...-dom-webpack-client.browser.development.js | 37 +- ...m-webpack-client.browser.production.min.js | 43 +-- ...ver-dom-webpack-client.edge.development.js | 46 ++- ...-dom-webpack-client.edge.production.min.js | 56 +-- ...ver-dom-webpack-client.node.development.js | 37 +- ...-dom-webpack-client.node.production.min.js | 11 +- ...bpack-client.node.unbundled.development.js | 37 +- ...ck-client.node.unbundled.production.min.js | 13 +- ...-dom-webpack-server.browser.development.js | 339 +++++++----------- ...m-webpack-server.browser.production.min.js | 127 +++---- ...ver-dom-webpack-server.edge.development.js | 339 +++++++----------- ...-dom-webpack-server.edge.production.min.js | 127 +++---- ...ver-dom-webpack-server.node.development.js | 339 +++++++----------- ...-dom-webpack-server.node.production.min.js | 143 ++++---- ...bpack-server.node.unbundled.development.js | 339 +++++++----------- ...ck-server.node.unbundled.production.min.js | 137 +++---- .../react-server-dom-webpack/package.json | 4 +- .../compiled/react/cjs/react.development.js | 2 +- .../react/cjs/react.production.min.js | 2 +- .../cjs/react.shared-subset.development.js | 2 +- .../cjs/react.shared-subset.production.min.js | 2 +- pnpm-lock.yaml | 104 +++--- 112 files changed, 4499 insertions(+), 3753 deletions(-) diff --git a/package.json b/package.json index 53f56641fbdcc..71f8a7e73a484 100644 --- a/package.json +++ b/package.json @@ -194,16 +194,16 @@ "random-seed": "0.3.0", "react": "18.2.0", "react-17": "npm:react@17.0.2", - "react-builtin": "npm:react@18.3.0-canary-a41957507-20231017", + "react-builtin": "npm:react@18.3.0-canary-d803f519e-20231020", "react-dom": "18.2.0", "react-dom-17": "npm:react-dom@17.0.2", - "react-dom-builtin": "npm:react-dom@18.3.0-canary-a41957507-20231017", - "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-a41957507-20231017", - "react-experimental-builtin": "npm:react@0.0.0-experimental-a41957507-20231017", - "react-server-dom-turbopack": "18.3.0-canary-a41957507-20231017", - "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-a41957507-20231017", - "react-server-dom-webpack": "18.3.0-canary-a41957507-20231017", - "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-a41957507-20231017", + "react-dom-builtin": "npm:react-dom@18.3.0-canary-d803f519e-20231020", + "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-d803f519e-20231020", + "react-experimental-builtin": "npm:react@0.0.0-experimental-d803f519e-20231020", + "react-server-dom-turbopack": "18.3.0-canary-d803f519e-20231020", + "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-d803f519e-20231020", + "react-server-dom-webpack": "18.3.0-canary-d803f519e-20231020", + "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-d803f519e-20231020", "react-ssr-prepass": "1.0.8", "react-virtualized": "9.22.3", "relay-compiler": "13.0.2", @@ -213,8 +213,8 @@ "resolve-from": "5.0.0", "sass": "1.54.0", "satori": "0.10.6", - "scheduler-builtin": "npm:scheduler@0.24.0-canary-a41957507-20231017", - "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-a41957507-20231017", + "scheduler-builtin": "npm:scheduler@0.24.0-canary-d803f519e-20231020", + "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-d803f519e-20231020", "seedrandom": "3.0.5", "selenium-webdriver": "4.0.0-beta.4", "semver": "7.3.7", diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js index 0fa29c5711881..d931cac2fd243 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") { var React = require("next/dist/compiled/react-experimental"); var ReactDOM = require('react-dom'); -var ReactVersion = '18.3.0-experimental-a41957507-20231017'; +var ReactVersion = '18.3.0-experimental-d803f519e-20231020'; var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; @@ -11256,7 +11256,10 @@ function flushCompletedQueues(request, destination) { } // We're done. - close(destination); + close(destination); // We need to stop flowing now because we do not want any async contexts which might call + // float methods to initiate any flushes after this point + + stopFlowing(request); } } } @@ -11276,10 +11279,17 @@ function enqueueFlush(request) { request.pingedTasks.length === 0 && // If there is no destination there is nothing we can flush to. A flush will // happen when we start flowing again request.destination !== null) { - var destination = request.destination; request.flushScheduled = true; scheduleWork(function () { - return flushCompletedQueues(request, destination); + // We need to existence check destination again here because it might go away + // in between the enqueueFlush call and the work execution + var destination = request.destination; + + if (destination) { + flushCompletedQueues(request, destination); + } else { + request.flushScheduled = false; + } }); } } @@ -11309,6 +11319,9 @@ function startFlowing(request, destination) { fatalError(request, error); } } +function stopFlowing(request) { + request.destination = null; +} // This is called to early terminate a request. It puts all pending boundaries in client rendered state. function abort(request, reason) { try { diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.min.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.min.js index 2c549a83c8060..2f966742637a4 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.min.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.min.js @@ -188,8 +188,8 @@ b);q.highImagePreloads.clear();q.styles.forEach(lc,b);q.scripts.forEach(K,b);q.s ba?(q.push(V.startInlineScript),0===(A.instructions&4)?(A.instructions|=4,q.push('$RX=function(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};;$RX("')):q.push('$RX("')):q.push('')){a.destination=null;c++;O.splice(0,c);return}}O.splice(0,c);var W=a.completedBoundaries;for(c=0;c")),a.hasHtml&&(b.push(""))),b.push(null))}}function oc(a){if(!1===a.flushScheduled&&0===a.pingedTasks.length&&null!==a.destination){var b=a.destination;a.flushScheduled=!0;Oe(a,b)}} +0===a.clientRenderedBoundaries.length&&0===a.completedBoundaries.length&&(a.flushScheduled=!1,null===a.trackedPostpones&&(c=a.resumableState,c.hasBody&&(b.push("")),c.hasHtml&&(b.push(""))),b.push(null),a.destination=null)}}function oc(a){if(!1===a.flushScheduled&&0===a.pingedTasks.length&&null!==a.destination){a.flushScheduled=!0;var b=a.destination;b?Oe(a,b):a.flushScheduled=!1}} function Ue(a,b){try{var c=a.abortableTasks;if(0"):!p.push('">')){a.destination=null;c++;N.splice(0,c);return}}N.splice(0,c);var V=a.completedBoundaries;for(c=0;c")),a.hasHtml&&(b.push(""))),b.push(null))}}function pc(a){if(!1===a.flushScheduled&&0===a.pingedTasks.length&&null!==a.destination){var b=a.destination;a.flushScheduled=!0;Pe(a,b)}} +0===a.clientRenderedBoundaries.length&&0===a.completedBoundaries.length&&(a.flushScheduled=!1,null===a.trackedPostpones&&(c=a.resumableState,c.hasBody&&(b.push("")),c.hasHtml&&(b.push(""))),b.push(null),a.destination=null)}}function pc(a){if(!1===a.flushScheduled&&0===a.pingedTasks.length&&null!==a.destination){a.flushScheduled=!0;var b=a.destination;b?Pe(a,b):a.flushScheduled=!1}} function Ve(a,b){if(1===a.status)a.status=2,b.destroy(a.fatalError);else if(2!==a.status&&null===a.destination){a.destination=b;try{Pe(a,b)}catch(c){W(a,c),Ae(a,c)}}}function We(a,b){try{var c=a.abortableTasks;if(0'),cb=A("