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