Skip to content

Commit 9cc468e

Browse files
committed
rename enableOffscreen to enableActivity
1 parent 0ecea78 commit 9cc468e

File tree

8 files changed

+46
-46
lines changed

8 files changed

+46
-46
lines changed

packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3151,7 +3151,7 @@ describe('ReactDOMServerPartialHydration', () => {
31513151
expect(ref.current.innerHTML).toBe('Hidden child');
31523152
});
31533153

3154-
// @gate enableOffscreen
3154+
// @gate enableActivity
31553155
it('a visible Activity component acts like a fragment', async () => {
31563156
const ref = React.createRef();
31573157

@@ -3187,7 +3187,7 @@ describe('ReactDOMServerPartialHydration', () => {
31873187
expect(ref.current).toBe(span);
31883188
});
31893189

3190-
// @gate enableOffscreen
3190+
// @gate enableActivity
31913191
it('a hidden Activity component is skipped over during server rendering', async () => {
31923192
const visibleRef = React.createRef();
31933193

packages/react-reconciler/src/__tests__/ReactCache-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1576,7 +1576,7 @@ describe('ReactCache', () => {
15761576
expect(root).toMatchRenderedOutput('Bye!');
15771577
});
15781578

1579-
// @gate enableOffscreen
1579+
// @gate enableActivity
15801580
// @gate enableCache
15811581
test('prerender a new cache boundary inside an Activity tree', async () => {
15821582
function App({prerenderMore}) {

packages/react-reconciler/src/__tests__/ReactDeferredValue-test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ describe('ReactDeferredValue', () => {
569569
});
570570

571571
// @gate enableUseDeferredValueInitialArg
572-
// @gate enableOffscreen
572+
// @gate enableActivity
573573
it('useDeferredValue can spawn a deferred task while prerendering a hidden tree', async () => {
574574
function App() {
575575
const text = useDeferredValue('Final', 'Preview');
@@ -616,7 +616,7 @@ describe('ReactDeferredValue', () => {
616616
});
617617

618618
// @gate enableUseDeferredValueInitialArg
619-
// @gate enableOffscreen
619+
// @gate enableActivity
620620
it('useDeferredValue can prerender the initial value inside a hidden tree', async () => {
621621
function App({text}) {
622622
const renderedText = useDeferredValue(text, `Preview [${text}]`);
@@ -675,7 +675,7 @@ describe('ReactDeferredValue', () => {
675675
});
676676

677677
// @gate enableUseDeferredValueInitialArg
678-
// @gate enableOffscreen
678+
// @gate enableActivity
679679
it(
680680
'useDeferredValue skips the preview state when revealing a hidden tree ' +
681681
'if the final value is referentially identical',
@@ -716,7 +716,7 @@ describe('ReactDeferredValue', () => {
716716
);
717717

718718
// @gate enableUseDeferredValueInitialArg
719-
// @gate enableOffscreen
719+
// @gate enableActivity
720720
it(
721721
'useDeferredValue does not skip the preview state when revealing a ' +
722722
'hidden tree if the final value is different from the currently rendered one',
@@ -761,7 +761,7 @@ describe('ReactDeferredValue', () => {
761761
},
762762
);
763763

764-
// @gate enableOffscreen
764+
// @gate enableActivity
765765
it(
766766
'useDeferredValue does not show "previous" value when revealing a hidden ' +
767767
'tree (no initial value)',

packages/react-reconciler/src/__tests__/ReactOffscreen-test.js

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ describe('ReactOffscreen', () => {
209209
);
210210
});
211211

212-
// @gate enableOffscreen
212+
// @gate enableActivity
213213
it('mounts without layout effects when hidden', async () => {
214214
function Child({text}) {
215215
useLayoutEffect(() => {
@@ -247,7 +247,7 @@ describe('ReactOffscreen', () => {
247247
expect(root).toMatchRenderedOutput(<span prop="Child" />);
248248
});
249249

250-
// @gate enableOffscreen
250+
// @gate enableActivity
251251
it('mounts/unmounts layout effects when visibility changes (starting visible)', async () => {
252252
function Child({text}) {
253253
useLayoutEffect(() => {
@@ -293,7 +293,7 @@ describe('ReactOffscreen', () => {
293293
expect(root).toMatchRenderedOutput(<span prop="Child" />);
294294
});
295295

296-
// @gate enableOffscreen
296+
// @gate enableActivity
297297
it('nested offscreen does not call componentWillUnmount when hidden', async () => {
298298
// This is a bug that appeared during production test of <unstable_Activity />.
299299
// It is a very specific scenario with nested Offscreens. The inner offscreen
@@ -397,7 +397,7 @@ describe('ReactOffscreen', () => {
397397
assertLog(['child']);
398398
});
399399

400-
// @gate enableOffscreen
400+
// @gate enableActivity
401401
it('mounts/unmounts layout effects when visibility changes (starting hidden)', async () => {
402402
function Child({text}) {
403403
useLayoutEffect(() => {
@@ -444,7 +444,7 @@ describe('ReactOffscreen', () => {
444444
expect(root).toMatchRenderedOutput(<span hidden={true} prop="Child" />);
445445
});
446446

447-
// @gate enableOffscreen
447+
// @gate enableActivity
448448
it('hides children of offscreen after layout effects are destroyed', async () => {
449449
const root = ReactNoop.createRoot();
450450
function Child({text}) {
@@ -531,7 +531,7 @@ describe('ReactOffscreen', () => {
531531
assertLog(['Unmount layout']);
532532
});
533533

534-
// @gate enableOffscreen
534+
// @gate enableActivity
535535
it('hides new insertions into an already hidden tree', async () => {
536536
const root = ReactNoop.createRoot();
537537
await act(() => {
@@ -561,7 +561,7 @@ describe('ReactOffscreen', () => {
561561
);
562562
});
563563

564-
// @gate enableOffscreen
564+
// @gate enableActivity
565565
it('hides updated nodes inside an already hidden tree', async () => {
566566
const root = ReactNoop.createRoot();
567567
await act(() => {
@@ -607,7 +607,7 @@ describe('ReactOffscreen', () => {
607607
expect(root).toMatchRenderedOutput(<span>Hi</span>);
608608
});
609609

610-
// @gate enableOffscreen
610+
// @gate enableActivity
611611
it('revealing a hidden tree at high priority does not cause tearing', async () => {
612612
// When revealing an offscreen tree, we need to include updates that were
613613
// previously deferred because the tree was hidden, even if they are lower
@@ -741,7 +741,7 @@ describe('ReactOffscreen', () => {
741741
expect(areOuterAndInnerConsistent()).toBe(true);
742742
});
743743

744-
// @gate enableOffscreen
744+
// @gate enableActivity
745745
it('regression: Activity instance is sometimes null during setState', async () => {
746746
let setState;
747747
function Child() {
@@ -789,7 +789,7 @@ describe('ReactOffscreen', () => {
789789
expect(root).toMatchRenderedOutput(null);
790790
});
791791

792-
// @gate enableOffscreen
792+
// @gate enableActivity
793793
it('class component setState callbacks do not fire until tree is visible', async () => {
794794
const root = ReactNoop.createRoot();
795795

@@ -841,7 +841,7 @@ describe('ReactOffscreen', () => {
841841
expect(root).toMatchRenderedOutput(<span prop="C" />);
842842
});
843843

844-
// @gate enableOffscreen
844+
// @gate enableActivity
845845
it('does not call componentDidUpdate when reappearing a hidden class component', async () => {
846846
class Child extends React.Component {
847847
componentDidMount() {
@@ -891,7 +891,7 @@ describe('ReactOffscreen', () => {
891891
assertLog(['componentDidMount']);
892892
});
893893

894-
// @gate enableOffscreen
894+
// @gate enableActivity
895895
it(
896896
'when reusing old components (hidden -> visible), layout effects fire ' +
897897
'with same timing as if it were brand new',
@@ -944,7 +944,7 @@ describe('ReactOffscreen', () => {
944944
},
945945
);
946946

947-
// @gate enableOffscreen
947+
// @gate enableActivity
948948
it(
949949
'when reusing old components (hidden -> visible), layout effects fire ' +
950950
'with same timing as if it were brand new (includes setState callback)',
@@ -1007,7 +1007,7 @@ describe('ReactOffscreen', () => {
10071007
},
10081008
);
10091009

1010-
// @gate enableOffscreen
1010+
// @gate enableActivity
10111011
it('defer passive effects when prerendering a new Activity tree', async () => {
10121012
function Child({label}) {
10131013
useEffect(() => {
@@ -1125,7 +1125,7 @@ describe('ReactOffscreen', () => {
11251125
assertLog(['Shell', 'More']);
11261126
});
11271127

1128-
// @gate enableOffscreen
1128+
// @gate enableActivity
11291129
it('passive effects are connected and disconnected when the visibility changes', async () => {
11301130
function Child({step}) {
11311131
useEffect(() => {
@@ -1182,7 +1182,7 @@ describe('ReactOffscreen', () => {
11821182
expect(root).toMatchRenderedOutput(<span prop={2} />);
11831183
});
11841184

1185-
// @gate enableOffscreen
1185+
// @gate enableActivity
11861186
it('passive effects are unmounted on hide in the same order as during a deletion: parent before child', async () => {
11871187
function Child({label}) {
11881188
useEffect(() => {
@@ -1240,7 +1240,7 @@ describe('ReactOffscreen', () => {
12401240
// Re-enable this test once we add this ability. For example, we'll likely add
12411241
// either an option or a heuristic to mount passive effects inside a hidden
12421242
// tree after a delay.
1243-
// @gate enableOffscreen
1243+
// @gate enableActivity
12441244
it.skip("don't defer passive effects when prerendering in a tree whose effects are already connected", async () => {
12451245
function Child({label}) {
12461246
useEffect(() => {
@@ -1296,7 +1296,7 @@ describe('ReactOffscreen', () => {
12961296
]);
12971297
});
12981298

1299-
// @gate enableOffscreen
1299+
// @gate enableActivity
13001300
it('does not mount effects when prerendering a nested Activity boundary', async () => {
13011301
function Child({label}) {
13021302
useEffect(() => {
@@ -1374,7 +1374,7 @@ describe('ReactOffscreen', () => {
13741374
);
13751375
});
13761376

1377-
// @gate enableOffscreen
1377+
// @gate enableActivity
13781378
it('reveal an outer Activity boundary without revealing an inner one', async () => {
13791379
function Child({label}) {
13801380
useEffect(() => {
@@ -1441,7 +1441,7 @@ describe('ReactOffscreen', () => {
14411441
});
14421442

14431443
describe('manual interactivity', () => {
1444-
// @gate enableOffscreen
1444+
// @gate enableActivity
14451445
it('should attach ref only for mode null', async () => {
14461446
let offscreenRef;
14471447

@@ -1485,7 +1485,7 @@ describe('ReactOffscreen', () => {
14851485
expect(offscreenRef.current).not.toBeNull();
14861486
});
14871487

1488-
// @gate enableOffscreen
1488+
// @gate enableActivity
14891489
it('should lower update priority for detached Activity', async () => {
14901490
let updateChildState;
14911491
let updateHighPriorityComponentState;
@@ -1595,7 +1595,7 @@ describe('ReactOffscreen', () => {
15951595
});
15961596
});
15971597

1598-
// @gate enableOffscreen
1598+
// @gate enableActivity
15991599
it('defers detachment if called during commit', async () => {
16001600
let updateChildState;
16011601
let updateHighPriorityComponentState;
@@ -1702,7 +1702,7 @@ describe('ReactOffscreen', () => {
17021702
});
17031703
});
17041704

1705-
// @gate enableOffscreen
1705+
// @gate enableActivity
17061706
it('should detach ref if Activity is unmounted', async () => {
17071707
let offscreenRef;
17081708

@@ -1740,7 +1740,7 @@ describe('ReactOffscreen', () => {
17401740
expect(offscreenRef.current).not.toBeNull();
17411741
});
17421742

1743-
// @gate enableOffscreen
1743+
// @gate enableActivity
17441744
it('should detach ref when parent Activity is hidden', async () => {
17451745
let offscreenRef;
17461746

@@ -1775,7 +1775,7 @@ describe('ReactOffscreen', () => {
17751775
expect(offscreenRef.current).toBeNull();
17761776
});
17771777

1778-
// @gate enableOffscreen
1778+
// @gate enableActivity
17791779
it('should change _current', async () => {
17801780
let offscreenRef;
17811781
const root = ReactNoop.createRoot();
@@ -1811,7 +1811,7 @@ describe('ReactOffscreen', () => {
18111811
expect(offscreenRef.current._current === firstFiber).toBeFalsy();
18121812
});
18131813

1814-
// @gate enableOffscreen
1814+
// @gate enableActivity
18151815
it('does not mount tree until attach is called', async () => {
18161816
let offscreenRef;
18171817
let spanRef;
@@ -1879,7 +1879,7 @@ describe('ReactOffscreen', () => {
18791879
assertLog([]);
18801880
});
18811881

1882-
// @gate enableOffscreen
1882+
// @gate enableActivity
18831883
it('handles nested manual offscreens', async () => {
18841884
let outerOffscreen;
18851885
let innerOffscreen;
@@ -1970,7 +1970,7 @@ describe('ReactOffscreen', () => {
19701970
assertLog(['unmount layout inner', 'unmount inner']);
19711971
});
19721972

1973-
// @gate enableOffscreen
1973+
// @gate enableActivity
19741974
it('batches multiple attach and detach calls scheduled from an event handler', async () => {
19751975
function Child() {
19761976
useEffect(() => {
@@ -2024,7 +2024,7 @@ describe('ReactOffscreen', () => {
20242024
assertLog([]);
20252025
});
20262026

2027-
// @gate enableOffscreen
2027+
// @gate enableActivity
20282028
it('batches multiple attach and detach calls scheduled from an effect', async () => {
20292029
function Child() {
20302030
useEffect(() => {

packages/react-reconciler/src/__tests__/ReactOffscreenStrictMode-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('ReactOffscreenStrictMode', () => {
3131
return <span>label</span>;
3232
}
3333

34-
// @gate __DEV__ && enableOffscreen
34+
// @gate __DEV__ && enableActivity
3535
it('should trigger strict effects when offscreen is visible', async () => {
3636
await act(() => {
3737
ReactNoop.render(
@@ -55,7 +55,7 @@ describe('ReactOffscreenStrictMode', () => {
5555
]);
5656
});
5757

58-
// @gate __DEV__ && enableOffscreen && enableDO_NOT_USE_disableStrictPassiveEffect
58+
// @gate __DEV__ && enableActivity && enableDO_NOT_USE_disableStrictPassiveEffect
5959
it('does not trigger strict effects when disableStrictPassiveEffect is presented on StrictMode', async () => {
6060
await act(() => {
6161
ReactNoop.render(
@@ -77,7 +77,7 @@ describe('ReactOffscreenStrictMode', () => {
7777
]);
7878
});
7979

80-
// @gate __DEV__ && enableOffscreen && useModernStrictMode
80+
// @gate __DEV__ && enableActivity && useModernStrictMode
8181
it('should not trigger strict effects when offscreen is hidden', async () => {
8282
await act(() => {
8383
ReactNoop.render(
@@ -176,7 +176,7 @@ describe('ReactOffscreenStrictMode', () => {
176176
});
177177
});
178178

179-
// @gate __DEV__ && enableOffscreen
179+
// @gate __DEV__ && enableActivity
180180
it('should double invoke effects on unsuspended child', async () => {
181181
let shouldSuspend = true;
182182
let resolve;

packages/react-reconciler/src/__tests__/ReactOffscreenSuspense-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe('ReactOffscreen', () => {
9898
return text;
9999
}
100100

101-
// @gate enableOffscreen
101+
// @gate enableActivity
102102
test('basic example of suspending inside hidden tree', async () => {
103103
const root = ReactNoop.createRoot();
104104

@@ -233,7 +233,7 @@ describe('ReactOffscreen', () => {
233233
);
234234
});
235235

236-
// @gate enableOffscreen
236+
// @gate enableActivity
237237
test("suspending inside currently visible tree that's switching to hidden", async () => {
238238
const root = ReactNoop.createRoot();
239239

@@ -409,7 +409,7 @@ describe('ReactOffscreen', () => {
409409
expect(root).toMatchRenderedOutput(<span hidden={true}>B1</span>);
410410
});
411411

412-
// @gate enableOffscreen
412+
// @gate enableActivity
413413
test('detect updates to a hidden tree during a concurrent event', async () => {
414414
// This is a pretty complex test case. It relates to how we detect if an
415415
// update is made to a hidden tree: when scheduling the update, we walk up

0 commit comments

Comments
 (0)