File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
packages/react-server/src Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1192,12 +1192,16 @@ function renderModelDestructive(
11921192 // but that is able to reuse the same task if we're already in one but then that
11931193 // will be a lazy future value rather than guaranteed to exist but maybe that's good.
11941194 const newId = outlineModel ( request , ( value : any ) ) ;
1195- return serializeLazyID ( newId ) ;
1195+ return serializeByValueID ( newId ) ;
11961196 } else {
11971197 // We've already emitted this as an outlined object, so we can refer to that by its
1198- // existing ID. We use a lazy reference since, unlike plain objects, elements might
1199- // suspend so it might not have emitted yet even if we have the ID for it.
1200- return serializeLazyID ( existingId ) ;
1198+ // existing ID. TODO: We should use a lazy reference since, unlike plain objects,
1199+ // elements might suspend so it might not have emitted yet even if we have the ID for
1200+ // it. However, this creates an extra wrapper when it's not needed. We should really
1201+ // detect whether this already was emitted and synchronously available. In that
1202+ // case we can refer to it synchronously and only make it lazy otherwise.
1203+ // We currently don't have a data structure that lets us see that though.
1204+ return serializeByValueID ( existingId ) ;
12011205 }
12021206 } else {
12031207 // This is the first time we've seen this object. We may never see it again
You can’t perform that action at this time.
0 commit comments