@@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
17
17
var React = require ( "next/dist/compiled/react-experimental" ) ;
18
18
var ReactDOM = require ( 'react-dom' ) ;
19
19
20
- var ReactVersion = '18.3.0-experimental-d900fadbf-20230929 ' ;
20
+ var ReactVersion = '18.3.0-experimental-db69f95e4-20231002 ' ;
21
21
22
22
var ReactSharedInternals = React . __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ;
23
23
@@ -8983,11 +8983,7 @@ function replaySuspenseBoundary(request, task, keyPath, props, id, childNodes, c
8983
8983
8984
8984
try {
8985
8985
// We use the safe form because we don't handle suspending here. Only error handling.
8986
- if ( typeof childSlots === 'number' ) {
8987
- resumeNode ( request , task , childSlots , content , - 1 ) ;
8988
- } else {
8989
- renderNode ( request , task , content , - 1 ) ;
8990
- }
8986
+ renderNode ( request , task , content , - 1 ) ;
8991
8987
8992
8988
if ( task . replay . pendingTasks === 1 && task . replay . nodes . length > 0 ) {
8993
8989
throw new Error ( "Couldn't find all resumable slots by key/index during replaying. " + "The tree doesn't match so React will fallback to client rendering." ) ;
@@ -9038,24 +9034,15 @@ function replaySuspenseBoundary(request, task, keyPath, props, id, childNodes, c
9038
9034
task . keyPath = prevKeyPath ;
9039
9035
}
9040
9036
9041
- var fallbackKeyPath = [ keyPath [ 0 ] , 'Suspense Fallback' , keyPath [ 2 ] ] ;
9042
- var suspendedFallbackTask ; // We create suspended task for the fallback because we don't want to actually work
9037
+ var fallbackKeyPath = [ keyPath [ 0 ] , 'Suspense Fallback' , keyPath [ 2 ] ] ; // We create suspended task for the fallback because we don't want to actually work
9043
9038
// on it yet in case we finish the main content, so we queue for later.
9044
9039
9045
- if ( typeof fallbackSlots === 'number' ) {
9046
- // Resuming directly in the fallback.
9047
- var resumedSegment = createPendingSegment ( request , 0 , null , task . formatContext , false , false ) ;
9048
- resumedSegment . id = fallbackSlots ;
9049
- resumedSegment . parentFlushed = true ;
9050
- suspendedFallbackTask = createRenderTask ( request , null , fallback , - 1 , parentBoundary , resumedSegment , fallbackAbortSet , fallbackKeyPath , task . formatContext , task . legacyContext , task . context , task . treeContext ) ;
9051
- } else {
9052
- var fallbackReplay = {
9053
- nodes : fallbackNodes ,
9054
- slots : fallbackSlots ,
9055
- pendingTasks : 0
9056
- } ;
9057
- suspendedFallbackTask = createReplayTask ( request , null , fallbackReplay , fallback , - 1 , parentBoundary , fallbackAbortSet , fallbackKeyPath , task . formatContext , task . legacyContext , task . context , task . treeContext ) ;
9058
- }
9040
+ var fallbackReplay = {
9041
+ nodes : fallbackNodes ,
9042
+ slots : fallbackSlots ,
9043
+ pendingTasks : 0
9044
+ } ;
9045
+ var suspendedFallbackTask = createReplayTask ( request , null , fallbackReplay , fallback , - 1 , parentBoundary , fallbackAbortSet , fallbackKeyPath , task . formatContext , task . legacyContext , task . context , task . treeContext ) ;
9059
9046
9060
9047
{
9061
9048
suspendedFallbackTask . componentStack = task . componentStack ;
@@ -9605,37 +9592,6 @@ function resumeNode(request, task, segmentId, node, childIndex) {
9605
9592
}
9606
9593
}
9607
9594
9608
- function resumeElement ( request , task , keyPath , segmentId , prevThenableState , type , props , ref ) {
9609
- var prevReplay = task . replay ;
9610
- var blockedBoundary = task . blockedBoundary ;
9611
- var resumedSegment = createPendingSegment ( request , 0 , null , task . formatContext , false , false ) ;
9612
- resumedSegment . id = segmentId ;
9613
- resumedSegment . parentFlushed = true ;
9614
-
9615
- try {
9616
- // Convert the current ReplayTask to a RenderTask.
9617
- var renderTask = task ;
9618
- renderTask . replay = null ;
9619
- renderTask . blockedSegment = resumedSegment ;
9620
- renderElement ( request , task , keyPath , prevThenableState , type , props , ref ) ;
9621
- resumedSegment . status = COMPLETED ;
9622
-
9623
- if ( blockedBoundary === null ) {
9624
- request . completedRootSegment = resumedSegment ;
9625
- } else {
9626
- queueCompletedSegment ( blockedBoundary , resumedSegment ) ;
9627
-
9628
- if ( blockedBoundary . parentFlushed ) {
9629
- request . partialBoundaries . push ( blockedBoundary ) ;
9630
- }
9631
- }
9632
- } finally {
9633
- // Restore to a ReplayTask.
9634
- task . replay = prevReplay ;
9635
- task . blockedSegment = null ;
9636
- }
9637
- }
9638
-
9639
9595
function replayElement ( request , task , keyPath , prevThenableState , name , keyOrIndex , childIndex , type , props , ref , replay ) {
9640
9596
// We're replaying. Find the path to follow.
9641
9597
var replayNodes = replay . nodes ;
@@ -9664,12 +9620,7 @@ function replayElement(request, task, keyPath, prevThenableState, name, keyOrInd
9664
9620
} ;
9665
9621
9666
9622
try {
9667
- if ( typeof childSlots === 'number' ) {
9668
- // Matched a resumable element.
9669
- resumeElement ( request , task , keyPath , childSlots , prevThenableState , type , props , ref ) ;
9670
- } else {
9671
- renderElement ( request , task , keyPath , prevThenableState , type , props , ref ) ;
9672
- }
9623
+ renderElement ( request , task , keyPath , prevThenableState , type , props , ref ) ;
9673
9624
9674
9625
if ( task . replay . pendingTasks === 1 && task . replay . nodes . length > 0 // TODO check remaining slots
9675
9626
) {
@@ -9758,8 +9709,15 @@ prevThenableState, node, childIndex) {
9758
9709
9759
9710
9760
9711
function renderNodeDestructiveImpl ( request , task , prevThenableState , node , childIndex ) {
9761
- // Stash the node we're working on. We'll pick up from this task in case
9712
+ if ( task . replay !== null && typeof task . replay . slots === 'number' ) {
9713
+ // TODO: Figure out a cheaper place than this hot path to do this check.
9714
+ var resumeSegmentID = task . replay . slots ;
9715
+ resumeNode ( request , task , resumeSegmentID , node , childIndex ) ;
9716
+ return ;
9717
+ } // Stash the node we're working on. We'll pick up from this task in case
9762
9718
// something suspends.
9719
+
9720
+
9763
9721
task . node = node ;
9764
9722
task . childIndex = childIndex ; // Handle object types
9765
9723
0 commit comments