@@ -156,13 +156,7 @@ describe('ReactIncrementalUpdates', () => {
156
156
}
157
157
158
158
// Schedule some async updates
159
- if (
160
- gate (
161
- flags =>
162
- ! flags . forceConcurrentByDefaultForTesting ||
163
- flags . enableUnifiedSyncLane ,
164
- )
165
- ) {
159
+ if ( gate ( flags => ! flags . forceConcurrentByDefaultForTesting ) ) {
166
160
React . startTransition ( ( ) => {
167
161
instance . setState ( createUpdate ( 'a' ) ) ;
168
162
instance . setState ( createUpdate ( 'b' ) ) ;
@@ -189,13 +183,7 @@ describe('ReactIncrementalUpdates', () => {
189
183
} ) ;
190
184
191
185
// The sync updates should have flushed, but not the async ones.
192
- if (
193
- gate (
194
- flags =>
195
- ! flags . forceConcurrentByDefaultForTesting &&
196
- flags . enableUnifiedSyncLane ,
197
- )
198
- ) {
186
+ if ( gate ( flags => ! flags . forceConcurrentByDefaultForTesting ) ) {
199
187
assertLog ( [ 'd' , 'e' , 'f' ] ) ;
200
188
expect ( ReactNoop ) . toMatchRenderedOutput ( < span prop = "def" /> ) ;
201
189
} else {
@@ -207,40 +195,16 @@ describe('ReactIncrementalUpdates', () => {
207
195
// Now flush the remaining work. Even though e and f were already processed,
208
196
// they should be processed again, to ensure that the terminal state
209
197
// is deterministic.
210
- if (
211
- gate (
212
- flags =>
213
- ! flags . forceConcurrentByDefaultForTesting &&
214
- ! flags . enableUnifiedSyncLane ,
215
- )
216
- ) {
217
- await waitForAll ( [
218
- // Since 'g' is in a transition, we'll process 'd' separately first.
219
- // That causes us to process 'd' with 'e' and 'f' rebased.
220
- 'd' ,
221
- 'e' ,
222
- 'f' ,
223
- // Then we'll re-process everything for 'g'.
224
- 'a' ,
225
- 'b' ,
226
- 'c' ,
227
- 'd' ,
228
- 'e' ,
229
- 'f' ,
230
- 'g' ,
231
- ] ) ;
232
- } else {
233
- await waitForAll ( [
234
- // Then we'll re-process everything for 'g'.
235
- 'a' ,
236
- 'b' ,
237
- 'c' ,
238
- 'd' ,
239
- 'e' ,
240
- 'f' ,
241
- 'g' ,
242
- ] ) ;
243
- }
198
+ await waitForAll ( [
199
+ // Then we'll re-process everything for 'g'.
200
+ 'a' ,
201
+ 'b' ,
202
+ 'c' ,
203
+ 'd' ,
204
+ 'e' ,
205
+ 'f' ,
206
+ 'g' ,
207
+ ] ) ;
244
208
expect ( ReactNoop ) . toMatchRenderedOutput ( < span prop = "abcdefg" /> ) ;
245
209
} ) ;
246
210
@@ -267,13 +231,7 @@ describe('ReactIncrementalUpdates', () => {
267
231
}
268
232
269
233
// Schedule some async updates
270
- if (
271
- gate (
272
- flags =>
273
- ! flags . forceConcurrentByDefaultForTesting ||
274
- flags . enableUnifiedSyncLane ,
275
- )
276
- ) {
234
+ if ( gate ( flags => ! flags . forceConcurrentByDefaultForTesting ) ) {
277
235
React . startTransition ( ( ) => {
278
236
instance . setState ( createUpdate ( 'a' ) ) ;
279
237
instance . setState ( createUpdate ( 'b' ) ) ;
@@ -303,13 +261,7 @@ describe('ReactIncrementalUpdates', () => {
303
261
} ) ;
304
262
305
263
// The sync updates should have flushed, but not the async ones.
306
- if (
307
- gate (
308
- flags =>
309
- ! flags . forceConcurrentByDefaultForTesting &&
310
- flags . enableUnifiedSyncLane ,
311
- )
312
- ) {
264
+ if ( gate ( flags => ! flags . forceConcurrentByDefaultForTesting ) ) {
313
265
assertLog ( [ 'd' , 'e' , 'f' ] ) ;
314
266
} else {
315
267
// Update d was dropped and replaced by e.
@@ -320,13 +272,7 @@ describe('ReactIncrementalUpdates', () => {
320
272
// Now flush the remaining work. Even though e and f were already processed,
321
273
// they should be processed again, to ensure that the terminal state
322
274
// is deterministic.
323
- if (
324
- gate (
325
- flags =>
326
- ! flags . forceConcurrentByDefaultForTesting &&
327
- ! flags . enableUnifiedSyncLane ,
328
- )
329
- ) {
275
+ if ( gate ( flags => ! flags . forceConcurrentByDefaultForTesting ) ) {
330
276
await waitForAll ( [
331
277
// Since 'g' is in a transition, we'll process 'd' separately first.
332
278
// That causes us to process 'd' with 'e' and 'f' rebased.
@@ -684,25 +630,7 @@ describe('ReactIncrementalUpdates', () => {
684
630
pushToLog ( 'B' ) ,
685
631
) ;
686
632
} ) ;
687
- if ( gate ( flags => flags . enableUnifiedSyncLane ) ) {
688
- assertLog ( [ 'Committed: B' , 'Committed: BCD' , 'Committed: ABCD' ] ) ;
689
- } else {
690
- assertLog ( [
691
- // A and B are pending. B is higher priority, so we'll render that first.
692
- 'Committed: B' ,
693
- // Because A comes first in the queue, we're now in rebase mode. B must
694
- // be rebased on top of A. Also, in a layout effect, we received two new
695
- // updates: C and D. C is user-blocking and D is synchronous.
696
- //
697
- // First render the synchronous update. What we're testing here is that
698
- // B *is not dropped* even though it has lower than sync priority. That's
699
- // because we already committed it. However, this render should not
700
- // include C, because that update wasn't already committed.
701
- 'Committed: BD' ,
702
- 'Committed: BCD' ,
703
- 'Committed: ABCD' ,
704
- ] ) ;
705
- }
633
+ assertLog ( [ 'Committed: B' , 'Committed: BCD' , 'Committed: ABCD' ] ) ;
706
634
expect ( root ) . toMatchRenderedOutput ( 'ABCD' ) ;
707
635
} ) ;
708
636
@@ -744,25 +672,7 @@ describe('ReactIncrementalUpdates', () => {
744
672
pushToLog ( 'B' ) ,
745
673
) ;
746
674
} ) ;
747
- if ( gate ( flags => flags . enableUnifiedSyncLane ) ) {
748
- assertLog ( [ 'Committed: B' , 'Committed: BCD' , 'Committed: ABCD' ] ) ;
749
- } else {
750
- assertLog ( [
751
- // A and B are pending. B is higher priority, so we'll render that first.
752
- 'Committed: B' ,
753
- // Because A comes first in the queue, we're now in rebase mode. B must
754
- // be rebased on top of A. Also, in a layout effect, we received two new
755
- // updates: C and D. C is user-blocking and D is synchronous.
756
- //
757
- // First render the synchronous update. What we're testing here is that
758
- // B *is not dropped* even though it has lower than sync priority. That's
759
- // because we already committed it. However, this render should not
760
- // include C, because that update wasn't already committed.
761
- 'Committed: BD' ,
762
- 'Committed: BCD' ,
763
- 'Committed: ABCD' ,
764
- ] ) ;
765
- }
675
+ assertLog ( [ 'Committed: B' , 'Committed: BCD' , 'Committed: ABCD' ] ) ;
766
676
expect ( root ) . toMatchRenderedOutput ( 'ABCD' ) ;
767
677
} ) ;
768
678
0 commit comments