Skip to content

Commit 758a3db

Browse files
yungstersmeta-codesync[bot]
authored andcommitted
Fling: Cleanup enableVirtualViewExperimental Feature Flag (#55065)
Summary: Pull Request resolved: #55065 Cleans up the `enableVirtualViewExperimental` feature flag, so that only the experimental one is ever used. This does not delete the original implementation or rename the experimental one. I'll do those separately as follow-ups. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D90193651 fbshipit-source-id: e64a40b8ed49e4420370da300f03a8576a49321d
1 parent 41efc3b commit 758a3db

5 files changed

Lines changed: 29 additions & 45 deletions

File tree

packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,16 +1011,6 @@ const definitions: FeatureFlagDefinitions = {
10111011
},
10121012
ossReleaseStage: 'none',
10131013
},
1014-
enableVirtualViewExperimental: {
1015-
defaultValue: false,
1016-
metadata: {
1017-
dateAdded: '2025-08-29',
1018-
description: 'Enables the experimental version of `VirtualView`.',
1019-
expectedReleaseValue: true,
1020-
purpose: 'experimentation',
1021-
},
1022-
ossReleaseStage: 'none',
1023-
},
10241014
fixVirtualizeListCollapseWindowSize: {
10251015
defaultValue: false,
10261016
metadata: {

packages/react-native/src/private/components/virtualview/VirtualView.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@
1111
import type {ViewStyleProp} from '../../../../Libraries/StyleSheet/StyleSheet';
1212
import type {NativeSyntheticEvent} from '../../../../Libraries/Types/CoreEventTypes';
1313
import type {HostInstance} from '../../types/HostInstance';
14-
import type {NativeModeChangeEvent} from './VirtualViewNativeComponent';
14+
import type {NativeModeChangeEvent} from './VirtualViewExperimentalNativeComponent';
1515

1616
import StyleSheet from '../../../../Libraries/StyleSheet/StyleSheet';
1717
import * as ReactNativeFeatureFlags from '../../featureflags/ReactNativeFeatureFlags';
1818
import {useVirtualViewLogging} from './logger/VirtualViewLogger';
19-
import VirtualViewExperimentalNativeComponent from './VirtualViewExperimentalNativeComponent';
20-
import VirtualViewClassicNativeComponent from './VirtualViewNativeComponent';
19+
import VirtualViewNativeComponent from './VirtualViewExperimentalNativeComponent';
2120
import nullthrows from 'nullthrows';
2221
import * as React from 'react';
2322
// $FlowFixMe[missing-export]
@@ -51,11 +50,6 @@ export type ModeChangeEvent = Readonly<{
5150
target: HostInstance,
5251
}>;
5352

54-
const VirtualViewNativeComponent: typeof VirtualViewClassicNativeComponent =
55-
ReactNativeFeatureFlags.enableVirtualViewExperimental()
56-
? VirtualViewExperimentalNativeComponent
57-
: VirtualViewClassicNativeComponent;
58-
5953
type VirtualViewComponent = component(
6054
children?: React.Node,
6155
hiddenStyle?: (targetRect: Rect) => ViewStyleProp,

packages/react-native/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ type VirtualViewExperimentalNativeProps = Readonly<{
6767
*/
6868
initialHidden?: boolean,
6969

70+
/**
71+
* This was needed to get VirtualViewManagerDelegate to set this property.
72+
* TODO: Investigate why spread ViewProps doesn't call setter
73+
*/
74+
removeClippedSubviews?: boolean,
75+
7076
/**
7177
* Render state of children.
7278
*
@@ -79,18 +85,13 @@ type VirtualViewExperimentalNativeProps = Readonly<{
7985
*/
8086
renderState: Int32,
8187

82-
/**
83-
* This was needed to get VirtualViewManagerDelegate to set this property.
84-
* TODO: Investigate why spread ViewProps doesn't call setter
85-
*/
86-
removeClippedSubviews?: boolean,
87-
8888
/**
8989
* See `NativeModeChangeEvent`.
9090
*/
9191
onModeChange?: ?DirectEventHandler<NativeModeChangeEvent>,
9292
}>;
9393

94+
// TODO: Rename to eliminate "Experimental" suffix in the name.
9495
export default codegenNativeComponent<VirtualViewExperimentalNativeProps>(
9596
'VirtualViewExperimental',
9697
{

packages/react-native/src/private/components/virtualview/__tests__/VirtualView-itest.js

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment';
1212

1313
import type {Rect} from '../VirtualView';
14-
import type {NativeModeChangeEvent} from '../VirtualViewNativeComponent';
14+
import type {NativeModeChangeEvent} from '../VirtualViewExperimentalNativeComponent';
1515

1616
import ensureInstance from '../../../__tests__/utilities/ensureInstance';
1717
import isUnreachable from '../../../__tests__/utilities/isUnreachable';
@@ -43,16 +43,16 @@ describe('mode changes', () => {
4343

4444
expect(_logs.states).toHaveLength(1);
4545
expect(root.getRenderedOutput({props: []}).toJSX()).toEqual(
46-
<rn-virtualView>
46+
<rn-virtualViewExperimental>
4747
<rn-paragraph>Child</rn-paragraph>
48-
</rn-virtualView>,
48+
</rn-virtualViewExperimental>,
4949
);
5050

5151
dispatchModeChangeEvent(viewRef.current, VirtualViewMode.Hidden);
5252

5353
expect(_logs.states).toHaveLength(2);
5454
expect(root.getRenderedOutput({props: []}).toJSX()).toEqual(
55-
<rn-virtualView />,
55+
<rn-virtualViewExperimental />,
5656
);
5757
});
5858

@@ -72,16 +72,16 @@ describe('mode changes', () => {
7272

7373
expect(_logs.states).toHaveLength(2);
7474
expect(root.getRenderedOutput({props: []}).toJSX()).toEqual(
75-
<rn-virtualView />,
75+
<rn-virtualViewExperimental />,
7676
);
7777

7878
dispatchModeChangeEvent(viewRef.current, VirtualViewMode.Visible);
7979

8080
expect(_logs.states).toHaveLength(3);
8181
expect(root.getRenderedOutput({props: []}).toJSX()).toEqual(
82-
<rn-virtualView>
82+
<rn-virtualViewExperimental>
8383
<rn-paragraph>Child</rn-paragraph>
84-
</rn-virtualView>,
84+
</rn-virtualViewExperimental>,
8585
);
8686
});
8787

@@ -101,19 +101,19 @@ describe('mode changes', () => {
101101

102102
expect(_logs.states).toHaveLength(1);
103103
expect(root.getRenderedOutput({props: []}).toJSX()).toEqual(
104-
<rn-virtualView>
104+
<rn-virtualViewExperimental>
105105
<rn-paragraph>Child</rn-paragraph>
106-
</rn-virtualView>,
106+
</rn-virtualViewExperimental>,
107107
);
108108

109109
dispatchModeChangeEvent(viewRef.current, VirtualViewMode.Visible);
110110

111111
// Expects `VirtualView` does not undergo a state update.
112112
expect(_logs.states).toHaveLength(1);
113113
expect(root.getRenderedOutput({props: []}).toJSX()).toEqual(
114-
<rn-virtualView>
114+
<rn-virtualViewExperimental>
115115
<rn-paragraph>Child</rn-paragraph>
116-
</rn-virtualView>,
116+
</rn-virtualViewExperimental>,
117117
);
118118
});
119119
});
@@ -128,7 +128,7 @@ describe('styles', () => {
128128

129129
expect(
130130
root.getRenderedOutput({props: ['minHeight', 'minWidth']}).toJSX(),
131-
).toEqual(<rn-virtualView />);
131+
).toEqual(<rn-virtualViewExperimental />);
132132
});
133133

134134
test('does not set styles when prerendered', () => {
@@ -143,7 +143,7 @@ describe('styles', () => {
143143

144144
expect(
145145
root.getRenderedOutput({props: ['minHeight', 'minWidth']}).toJSX(),
146-
).toEqual(<rn-virtualView />);
146+
).toEqual(<rn-virtualViewExperimental />);
147147
});
148148

149149
test('sets styles when hidden', () => {
@@ -158,7 +158,12 @@ describe('styles', () => {
158158

159159
expect(
160160
root.getRenderedOutput({props: ['minHeight', 'minWidth']}).toJSX(),
161-
).toEqual(<rn-virtualView minHeight="100.000000" minWidth="100.000000" />);
161+
).toEqual(
162+
<rn-virtualViewExperimental
163+
minHeight="100.000000"
164+
minWidth="100.000000"
165+
/>,
166+
);
162167
});
163168
});
164169

packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<bf6ca0830458dd53c3d8edf227c1c4d9>>
7+
* @generated SignedSource<<b0e0bebf50d1a5b3d1c53447074786fd>>
88
* @flow strict
99
* @noformat
1010
*/
@@ -33,7 +33,6 @@ export type ReactNativeFeatureFlagsJsOnly = $ReadOnly<{
3333
animatedShouldUseSingleOp: Getter<boolean>,
3434
deferFlatListFocusChangeRenderUpdate: Getter<boolean>,
3535
disableMaintainVisibleContentPosition: Getter<boolean>,
36-
enableVirtualViewExperimental: Getter<boolean>,
3736
fixVirtualizeListCollapseWindowSize: Getter<boolean>,
3837
isLayoutAnimationEnabled: Getter<boolean>,
3938
reduceDefaultPropsInImage: Getter<boolean>,
@@ -163,11 +162,6 @@ export const deferFlatListFocusChangeRenderUpdate: Getter<boolean> = createJavaS
163162
*/
164163
export const disableMaintainVisibleContentPosition: Getter<boolean> = createJavaScriptFlagGetter('disableMaintainVisibleContentPosition', false);
165164

166-
/**
167-
* Enables the experimental version of `VirtualView`.
168-
*/
169-
export const enableVirtualViewExperimental: Getter<boolean> = createJavaScriptFlagGetter('enableVirtualViewExperimental', false);
170-
171165
/**
172166
* Fixing an edge case where the current window size is not properly calculated with fast scrolling. Window size collapsed to 1 element even if windowSize more than the current amount of elements
173167
*/

0 commit comments

Comments
 (0)