@@ -3927,18 +3927,9 @@ function emitChunk(
3927
3927
return ;
3928
3928
}
3929
3929
// For anything else we need to try to serialize it using JSON.
3930
- // We stash the outer parent size so we can restore it when we exit.
3931
- const parentSerializedSize = serializedSize ;
3932
- // We don't reset the serialized size counter from reentry because that indicates that we
3933
- // are outlining a model and we actually want to include that size into the parent since
3934
- // it will still block the parent row. It only restores to zero at the top of the stack.
3935
- try {
3936
- // $FlowFixMe[incompatible-type] stringify can return null for undefined but we never do
3937
- const json : string = stringify ( value , task . toJSON ) ;
3938
- emitModelChunk ( request , task . id , json ) ;
3939
- } finally {
3940
- serializedSize = parentSerializedSize ;
3941
- }
3930
+ // $FlowFixMe[incompatible-type] stringify can return null for undefined but we never do
3931
+ const json : string = stringify ( value , task . toJSON ) ;
3932
+ emitModelChunk ( request , task . id , json ) ;
3942
3933
}
3943
3934
3944
3935
function erroredTask ( request : Request , task : Task , error : mixed ) : void {
@@ -3976,6 +3967,11 @@ function retryTask(request: Request, task: Task): void {
3976
3967
const prevDebugID = debugID ;
3977
3968
task . status = RENDERING ;
3978
3969
3970
+ // We stash the outer parent size so we can restore it when we exit.
3971
+ const parentSerializedSize = serializedSize ;
3972
+ // We don't reset the serialized size counter from reentry because that indicates that we
3973
+ // are outlining a model and we actually want to include that size into the parent since
3974
+ // it will still block the parent row. It only restores to zero at the top of the stack.
3979
3975
try {
3980
3976
// Track the root so we know that we have to emit this object even though it
3981
3977
// already has an ID. This is needed because we might see this object twice
@@ -4087,6 +4083,7 @@ function retryTask(request: Request, task: Task): void {
4087
4083
if ( __DEV__ ) {
4088
4084
debugID = prevDebugID ;
4089
4085
}
4086
+ serializedSize = parentSerializedSize ;
4090
4087
}
4091
4088
}
4092
4089
@@ -4099,9 +4096,11 @@ function tryStreamTask(request: Request, task: Task): void {
4099
4096
// so that we instead outline the row to get a new debugID if needed.
4100
4097
debugID = null ;
4101
4098
}
4099
+ const parentSerializedSize = serializedSize ;
4102
4100
try {
4103
4101
emitChunk ( request , task , task . model ) ;
4104
4102
} finally {
4103
+ serializedSize = parentSerializedSize ;
4105
4104
if ( __DEV__ ) {
4106
4105
debugID = prevDebugID ;
4107
4106
}
0 commit comments