@@ -15,7 +15,6 @@ import {
15
15
enableBinaryFlight ,
16
16
enablePostpone ,
17
17
enableTaint ,
18
- enableServerComponentKeys ,
19
18
enableRefAsProp ,
20
19
enableServerComponentLogs ,
21
20
} from 'shared/ReactFeatureFlags' ;
@@ -993,7 +992,7 @@ function renderFragment(
993
992
task : Task ,
994
993
children : $ReadOnlyArray < ReactClientValue > ,
995
994
): ReactJSONValue {
996
- if ( enableServerComponentKeys && task . keyPath !== null ) {
995
+ if ( task . keyPath !== null ) {
997
996
// We have a Server Component that specifies a key but we're now splitting
998
997
// the tree using a fragment.
999
998
const fragment = [
@@ -1052,7 +1051,7 @@ function renderAsyncFragment(
1052
1051
children: $AsyncIterable< ReactClientValue , ReactClientValue , void > ,
1053
1052
getAsyncIterator: () => $AsyncIterator < any , any , any > ,
1054
1053
): ReactJSONValue {
1055
- if ( enableServerComponentKeys && task . keyPath !== null ) {
1054
+ if ( task . keyPath !== null ) {
1056
1055
// We have a Server Component that specifies a key but we're now splitting
1057
1056
// the tree using a fragment.
1058
1057
const fragment = [
@@ -1095,11 +1094,6 @@ function renderClientElement(
1095
1094
props : any ,
1096
1095
owner : null | ReactComponentInfo , // DEV-only
1097
1096
) : ReactJSONValue {
1098
- if ( ! enableServerComponentKeys ) {
1099
- return __DEV__
1100
- ? [ REACT_ELEMENT_TYPE , type , key , props , owner ]
1101
- : [ REACT_ELEMENT_TYPE , type , key , props ] ;
1102
- }
1103
1097
// We prepend the terminal client element that actually gets serialized with
1104
1098
// the keys of any Server Components which are not serialized.
1105
1099
const keyPath = task . keyPath ;
@@ -1266,7 +1260,7 @@ function createTask(
1266
1260
if ( typeof model === 'object' && model !== null ) {
1267
1261
// If we're about to write this into a new task we can assign it an ID early so that
1268
1262
// any other references can refer to the value we're about to write.
1269
- if ( enableServerComponentKeys && ( keyPath !== null || implicitSlot ) ) {
1263
+ if ( keyPath !== null || implicitSlot ) {
1270
1264
// If we're in some kind of context we can't necessarily reuse this object depending
1271
1265
// what parent components are used.
1272
1266
} else {
@@ -1756,10 +1750,7 @@ function renderModelDestructive(
1756
1750
const writtenObjects = request . writtenObjects ;
1757
1751
const existingId = writtenObjects . get ( value ) ;
1758
1752
if ( existingId !== undefined ) {
1759
- if (
1760
- enableServerComponentKeys &&
1761
- ( task . keyPath !== null || task . implicitSlot )
1762
- ) {
1753
+ if ( task . keyPath !== null || task . implicitSlot ) {
1763
1754
// If we're in some kind of context we can't reuse the result of this render or
1764
1755
// previous renders of this element. We only reuse elements if they're not wrapped
1765
1756
// by another Server Component.
@@ -1889,10 +1880,7 @@ function renderModelDestructive(
1889
1880
// $FlowFixMe[method-unbinding]
1890
1881
if ( typeof value . then === 'function' ) {
1891
1882
if ( existingId !== undefined ) {
1892
- if (
1893
- enableServerComponentKeys &&
1894
- ( task . keyPath !== null || task . implicitSlot )
1895
- ) {
1883
+ if ( task . keyPath !== null || task . implicitSlot ) {
1896
1884
// If we're in some kind of context we can't reuse the result of this render or
1897
1885
// previous renders of this element. We only reuse Promises if they're not wrapped
1898
1886
// by another Server Component.
0 commit comments