diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 79863a2b6e86b..12ee8d30c47b8 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -fa7a447b9ce5a4f0be592fc2946380b0fa3b29c0 +c10010a6a00911fe99452bc561dd47c3e15f4eb8 diff --git a/compiled/facebook-www/ReactDOMServer-dev.classic.js b/compiled/facebook-www/ReactDOMServer-dev.classic.js index 75d1f7a29b8a5..530a21a6f3329 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.classic.js +++ b/compiled/facebook-www/ReactDOMServer-dev.classic.js @@ -19,7 +19,7 @@ if (__DEV__) { var React = require("react"); var ReactDOM = require("react-dom"); -var ReactVersion = "18.3.0-www-classic-e6e6835d"; +var ReactVersion = "18.3.0-www-classic-5070839c"; // This refers to a WWW module. var warningWWW = require("warning"); @@ -11544,10 +11544,13 @@ function spawnNewSuspendedTask(request, task, thenableState, x) { // a new task and restores the context of this task to what it was before. function renderNode(request, task, node) { - // TODO: Store segment.children.length here and reset it in case something + // Store how much we've pushed at this point so we can reset it in case something // suspended partially through writing something. - // Snapshot the current context in case something throws to interrupt the + var segment = task.blockedSegment; + var childrenLength = segment.children.length; + var chunkLength = segment.chunks.length; // Snapshot the current context in case something throws to interrupt the // process. + var previousFormatContext = task.blockedSegment.formatContext; var previousLegacyContext = task.legacyContext; var previousContext = task.context; @@ -11560,7 +11563,10 @@ function renderNode(request, task, node) { try { return renderNodeDestructive(request, task, null, node); } catch (thrownValue) { - resetHooksState(); + resetHooksState(); // Reset the write pointers to where we started. + + segment.children.length = childrenLength; + segment.chunks.length = chunkLength; var x = thrownValue === SuspenseException // This is a special type of exception used for Suspense. For historical ? // reasons, the rest of the Suspense implementation expects the thrown @@ -11839,6 +11845,9 @@ function retryTask(request, task) { currentTaskInDEV = task; } + var childrenLength = segment.children.length; + var chunkLength = segment.chunks.length; + try { // We call the destructive form that mutates this task. That way if something // suspends again, we can reuse the same task instead of spawning a new one. @@ -11858,7 +11867,10 @@ function retryTask(request, task) { segment.status = COMPLETED; finishedTask(request, task.blockedBoundary, segment); } catch (thrownValue) { - resetHooksState(); + resetHooksState(); // Reset the write pointers to where we started. + + segment.children.length = childrenLength; + segment.chunks.length = chunkLength; var x = thrownValue === SuspenseException // This is a special type of exception used for Suspense. For historical ? // reasons, the rest of the Suspense implementation expects the thrown diff --git a/compiled/facebook-www/ReactDOMServer-dev.modern.js b/compiled/facebook-www/ReactDOMServer-dev.modern.js index df93828a66cbc..06ba321e3a347 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServer-dev.modern.js @@ -19,7 +19,7 @@ if (__DEV__) { var React = require("react"); var ReactDOM = require("react-dom"); -var ReactVersion = "18.3.0-www-modern-0f7d86b7"; +var ReactVersion = "18.3.0-www-modern-80147166"; // This refers to a WWW module. var warningWWW = require("warning"); @@ -11292,10 +11292,13 @@ function spawnNewSuspendedTask(request, task, thenableState, x) { // a new task and restores the context of this task to what it was before. function renderNode(request, task, node) { - // TODO: Store segment.children.length here and reset it in case something + // Store how much we've pushed at this point so we can reset it in case something // suspended partially through writing something. - // Snapshot the current context in case something throws to interrupt the + var segment = task.blockedSegment; + var childrenLength = segment.children.length; + var chunkLength = segment.chunks.length; // Snapshot the current context in case something throws to interrupt the // process. + var previousFormatContext = task.blockedSegment.formatContext; var previousLegacyContext = task.legacyContext; var previousContext = task.context; @@ -11308,7 +11311,10 @@ function renderNode(request, task, node) { try { return renderNodeDestructive(request, task, null, node); } catch (thrownValue) { - resetHooksState(); + resetHooksState(); // Reset the write pointers to where we started. + + segment.children.length = childrenLength; + segment.chunks.length = chunkLength; var x = thrownValue === SuspenseException // This is a special type of exception used for Suspense. For historical ? // reasons, the rest of the Suspense implementation expects the thrown @@ -11587,6 +11593,9 @@ function retryTask(request, task) { currentTaskInDEV = task; } + var childrenLength = segment.children.length; + var chunkLength = segment.chunks.length; + try { // We call the destructive form that mutates this task. That way if something // suspends again, we can reuse the same task instead of spawning a new one. @@ -11606,7 +11615,10 @@ function retryTask(request, task) { segment.status = COMPLETED; finishedTask(request, task.blockedBoundary, segment); } catch (thrownValue) { - resetHooksState(); + resetHooksState(); // Reset the write pointers to where we started. + + segment.children.length = childrenLength; + segment.chunks.length = chunkLength; var x = thrownValue === SuspenseException // This is a special type of exception used for Suspense. For historical ? // reasons, the rest of the Suspense implementation expects the thrown diff --git a/compiled/facebook-www/ReactDOMServer-prod.classic.js b/compiled/facebook-www/ReactDOMServer-prod.classic.js index 69478b9048665..58cf14d6216b8 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.classic.js +++ b/compiled/facebook-www/ReactDOMServer-prod.classic.js @@ -3298,7 +3298,10 @@ function renderChildrenArray(request, task, children) { } } function renderNode(request, task, node) { - var previousFormatContext = task.blockedSegment.formatContext, + var segment = task.blockedSegment, + childrenLength = segment.children.length, + chunkLength = segment.chunks.length, + previousFormatContext = task.blockedSegment.formatContext, previousLegacyContext = task.legacyContext, previousContext = task.context; try { @@ -3306,6 +3309,8 @@ function renderNode(request, task, node) { } catch (thrownValue) { if ( (resetHooksState(), + (segment.children.length = childrenLength), + (segment.chunks.length = chunkLength), (node = thrownValue === SuspenseException ? getSuspendedThenable() @@ -3313,36 +3318,36 @@ function renderNode(request, task, node) { "object" === typeof node && null !== node && "function" === typeof node.then) - ) { - var thenableState$15 = getThenableStateAfterSuspending(), - segment = task.blockedSegment, - newSegment = createPendingSegment( + ) + (segment = getThenableStateAfterSuspending()), + (childrenLength = task.blockedSegment), + (chunkLength = createPendingSegment( request, - segment.chunks.length, + childrenLength.chunks.length, null, - segment.formatContext, - segment.lastPushedText, + childrenLength.formatContext, + childrenLength.lastPushedText, !0 - ); - segment.children.push(newSegment); - segment.lastPushedText = !1; - request = createTask( - request, - thenableState$15, - task.node, - task.blockedBoundary, - newSegment, - task.abortSet, - task.legacyContext, - task.context, - task.treeContext - ).ping; - node.then(request, request); - task.blockedSegment.formatContext = previousFormatContext; - task.legacyContext = previousLegacyContext; - task.context = previousContext; - switchContext(previousContext); - } else + )), + childrenLength.children.push(chunkLength), + (childrenLength.lastPushedText = !1), + (request = createTask( + request, + segment, + task.node, + task.blockedBoundary, + chunkLength, + task.abortSet, + task.legacyContext, + task.context, + task.treeContext + ).ping), + node.then(request, request), + (task.blockedSegment.formatContext = previousFormatContext), + (task.legacyContext = previousLegacyContext), + (task.context = previousContext), + switchContext(previousContext); + else throw ( ((task.blockedSegment.formatContext = previousFormatContext), (task.legacyContext = previousLegacyContext), @@ -3447,6 +3452,8 @@ function performWork(request$jscomp$1) { var segment = task.blockedSegment; if (0 === segment.status) { switchContext(task.context); + var childrenLength = segment.children.length, + chunkLength = segment.chunks.length; try { var prevThenableState = task.thenableState; task.thenableState = null; @@ -3465,6 +3472,8 @@ function performWork(request$jscomp$1) { finishedTask(request, task.blockedBoundary, segment); } catch (thrownValue) { resetHooksState(); + segment.children.length = childrenLength; + segment.chunks.length = chunkLength; var x = thrownValue === SuspenseException ? getSuspendedThenable() @@ -4002,4 +4011,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "18.3.0-www-classic-42ee674f"; +exports.version = "18.3.0-www-classic-de54f0a0"; diff --git a/compiled/facebook-www/ReactDOMServer-prod.modern.js b/compiled/facebook-www/ReactDOMServer-prod.modern.js index 57af26c600437..d5171d429de6a 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.modern.js +++ b/compiled/facebook-www/ReactDOMServer-prod.modern.js @@ -3196,7 +3196,10 @@ function renderChildrenArray(request, task, children) { } } function renderNode(request, task, node) { - var previousFormatContext = task.blockedSegment.formatContext, + var segment = task.blockedSegment, + childrenLength = segment.children.length, + chunkLength = segment.chunks.length, + previousFormatContext = task.blockedSegment.formatContext, previousLegacyContext = task.legacyContext, previousContext = task.context; try { @@ -3204,6 +3207,8 @@ function renderNode(request, task, node) { } catch (thrownValue) { if ( (resetHooksState(), + (segment.children.length = childrenLength), + (segment.chunks.length = chunkLength), (node = thrownValue === SuspenseException ? getSuspendedThenable() @@ -3211,36 +3216,36 @@ function renderNode(request, task, node) { "object" === typeof node && null !== node && "function" === typeof node.then) - ) { - var thenableState$15 = getThenableStateAfterSuspending(), - segment = task.blockedSegment, - newSegment = createPendingSegment( + ) + (segment = getThenableStateAfterSuspending()), + (childrenLength = task.blockedSegment), + (chunkLength = createPendingSegment( request, - segment.chunks.length, + childrenLength.chunks.length, null, - segment.formatContext, - segment.lastPushedText, + childrenLength.formatContext, + childrenLength.lastPushedText, !0 - ); - segment.children.push(newSegment); - segment.lastPushedText = !1; - request = createTask( - request, - thenableState$15, - task.node, - task.blockedBoundary, - newSegment, - task.abortSet, - task.legacyContext, - task.context, - task.treeContext - ).ping; - node.then(request, request); - task.blockedSegment.formatContext = previousFormatContext; - task.legacyContext = previousLegacyContext; - task.context = previousContext; - switchContext(previousContext); - } else + )), + childrenLength.children.push(chunkLength), + (childrenLength.lastPushedText = !1), + (request = createTask( + request, + segment, + task.node, + task.blockedBoundary, + chunkLength, + task.abortSet, + task.legacyContext, + task.context, + task.treeContext + ).ping), + node.then(request, request), + (task.blockedSegment.formatContext = previousFormatContext), + (task.legacyContext = previousLegacyContext), + (task.context = previousContext), + switchContext(previousContext); + else throw ( ((task.blockedSegment.formatContext = previousFormatContext), (task.legacyContext = previousLegacyContext), @@ -3345,6 +3350,8 @@ function performWork(request$jscomp$1) { var segment = task.blockedSegment; if (0 === segment.status) { switchContext(task.context); + var childrenLength = segment.children.length, + chunkLength = segment.chunks.length; try { var prevThenableState = task.thenableState; task.thenableState = null; @@ -3363,6 +3370,8 @@ function performWork(request$jscomp$1) { finishedTask(request, task.blockedBoundary, segment); } catch (thrownValue) { resetHooksState(); + segment.children.length = childrenLength; + segment.chunks.length = chunkLength; var x = thrownValue === SuspenseException ? getSuspendedThenable() @@ -3900,4 +3909,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "18.3.0-www-modern-a116db68"; +exports.version = "18.3.0-www-modern-ef656b14"; diff --git a/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js b/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js index cce6018739417..19ba0a9a664a8 100644 --- a/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js @@ -11181,10 +11181,13 @@ function spawnNewSuspendedTask(request, task, thenableState, x) { // a new task and restores the context of this task to what it was before. function renderNode(request, task, node) { - // TODO: Store segment.children.length here and reset it in case something + // Store how much we've pushed at this point so we can reset it in case something // suspended partially through writing something. - // Snapshot the current context in case something throws to interrupt the + var segment = task.blockedSegment; + var childrenLength = segment.children.length; + var chunkLength = segment.chunks.length; // Snapshot the current context in case something throws to interrupt the // process. + var previousFormatContext = task.blockedSegment.formatContext; var previousLegacyContext = task.legacyContext; var previousContext = task.context; @@ -11197,7 +11200,10 @@ function renderNode(request, task, node) { try { return renderNodeDestructive(request, task, null, node); } catch (thrownValue) { - resetHooksState(); + resetHooksState(); // Reset the write pointers to where we started. + + segment.children.length = childrenLength; + segment.chunks.length = chunkLength; var x = thrownValue === SuspenseException // This is a special type of exception used for Suspense. For historical ? // reasons, the rest of the Suspense implementation expects the thrown @@ -11476,6 +11482,9 @@ function retryTask(request, task) { currentTaskInDEV = task; } + var childrenLength = segment.children.length; + var chunkLength = segment.chunks.length; + try { // We call the destructive form that mutates this task. That way if something // suspends again, we can reuse the same task instead of spawning a new one. @@ -11495,7 +11504,10 @@ function retryTask(request, task) { segment.status = COMPLETED; finishedTask(request, task.blockedBoundary, segment); } catch (thrownValue) { - resetHooksState(); + resetHooksState(); // Reset the write pointers to where we started. + + segment.children.length = childrenLength; + segment.chunks.length = chunkLength; var x = thrownValue === SuspenseException // This is a special type of exception used for Suspense. For historical ? // reasons, the rest of the Suspense implementation expects the thrown diff --git a/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js b/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js index 99f65e9478a81..42d2f8b237f7d 100644 --- a/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js +++ b/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js @@ -3146,7 +3146,10 @@ function renderChildrenArray(request, task, children) { } } function renderNode(request, task, node) { - var previousFormatContext = task.blockedSegment.formatContext, + var segment = task.blockedSegment, + childrenLength = segment.children.length, + chunkLength = segment.chunks.length, + previousFormatContext = task.blockedSegment.formatContext, previousLegacyContext = task.legacyContext, previousContext = task.context; try { @@ -3154,6 +3157,8 @@ function renderNode(request, task, node) { } catch (thrownValue) { if ( (resetHooksState(), + (segment.children.length = childrenLength), + (segment.chunks.length = chunkLength), (node = thrownValue === SuspenseException ? getSuspendedThenable() @@ -3161,36 +3166,36 @@ function renderNode(request, task, node) { "object" === typeof node && null !== node && "function" === typeof node.then) - ) { - var thenableState$15 = getThenableStateAfterSuspending(), - segment = task.blockedSegment, - newSegment = createPendingSegment( + ) + (segment = getThenableStateAfterSuspending()), + (childrenLength = task.blockedSegment), + (chunkLength = createPendingSegment( request, - segment.chunks.length, + childrenLength.chunks.length, null, - segment.formatContext, - segment.lastPushedText, + childrenLength.formatContext, + childrenLength.lastPushedText, !0 - ); - segment.children.push(newSegment); - segment.lastPushedText = !1; - request = createTask( - request, - thenableState$15, - task.node, - task.blockedBoundary, - newSegment, - task.abortSet, - task.legacyContext, - task.context, - task.treeContext - ).ping; - node.then(request, request); - task.blockedSegment.formatContext = previousFormatContext; - task.legacyContext = previousLegacyContext; - task.context = previousContext; - switchContext(previousContext); - } else + )), + childrenLength.children.push(chunkLength), + (childrenLength.lastPushedText = !1), + (request = createTask( + request, + segment, + task.node, + task.blockedBoundary, + chunkLength, + task.abortSet, + task.legacyContext, + task.context, + task.treeContext + ).ping), + node.then(request, request), + (task.blockedSegment.formatContext = previousFormatContext), + (task.legacyContext = previousLegacyContext), + (task.context = previousContext), + switchContext(previousContext); + else throw ( ((task.blockedSegment.formatContext = previousFormatContext), (task.legacyContext = previousLegacyContext), @@ -3717,6 +3722,8 @@ exports.renderNextChunk = function (stream) { var segment = task.blockedSegment; if (0 === segment.status) { switchContext(task.context); + var childrenLength = segment.children.length, + chunkLength = segment.chunks.length; try { var prevThenableState = task.thenableState; task.thenableState = null; @@ -3734,6 +3741,8 @@ exports.renderNextChunk = function (stream) { finishedTask(request, task.blockedBoundary, segment); } catch (thrownValue) { resetHooksState(); + segment.children.length = childrenLength; + segment.chunks.length = chunkLength; var x = thrownValue === SuspenseException ? getSuspendedThenable()