mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Fling: Cleanup virtualViewActivityBehavior (#55096)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55096 Cleans up the `virtualViewActivityBehavior` feature flag, which never shipped. More work is needed if we want to use `Activity` without significantly increasing memory usage and increasing the likelihood of OOMs. Changelog: [Internal] Reviewed By: CalixTang Differential Revision: D90335258 fbshipit-source-id: ccb2b4607bb508eb82c88c50ae267fdbb5f74a6d
This commit is contained in:
1 parent
198c1a7880
commit
b9294a70fb
3 files changed
+3
-31
No files matched your search
@@ -1063,16 +1063,6 @@ const definitions: FeatureFlagDefinitions = {
|
||||
},
|
||||
ossReleaseStage: 'none',
|
||||
},
|
||||
virtualViewActivityBehavior: {
|
||||
defaultValue: 'no-activity',
|
||||
metadata: {
|
||||
dateAdded: '2025-08-27',
|
||||
description: 'Changes whether and how `VirtualView` uses `Activity`.',
|
||||
expectedReleaseValue: true,
|
||||
purpose: 'experimentation',
|
||||
},
|
||||
ossReleaseStage: 'none',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -15,14 +15,12 @@ import type {NativeModeChangeEvent} from './VirtualViewNativeComponent';
|
||||
|
||||
import UIManager from '../../../../Libraries/ReactNative/UIManager';
|
||||
import StyleSheet from '../../../../Libraries/StyleSheet/StyleSheet';
|
||||
import * as ReactNativeFeatureFlags from '../../featureflags/ReactNativeFeatureFlags';
|
||||
import {useVirtualViewLogging} from './logger/VirtualViewLogger';
|
||||
import VirtualViewExperimentalNativeComponent from './VirtualViewExperimentalNativeComponent';
|
||||
import VirtualViewProperNativeComponent from './VirtualViewNativeComponent';
|
||||
import nullthrows from 'nullthrows';
|
||||
import * as React from 'react';
|
||||
// $FlowFixMe[missing-export]
|
||||
import {startTransition, unstable_Activity as Activity, useState} from 'react';
|
||||
import {startTransition, useState} from 'react';
|
||||
|
||||
// @see VirtualViewNativeComponent
|
||||
export enum VirtualViewMode {
|
||||
@@ -155,17 +153,7 @@ function createVirtualView(initialState: State): VirtualViewComponent {
|
||||
: style
|
||||
}
|
||||
onModeChange={handleModeChange}>
|
||||
{
|
||||
match (ReactNativeFeatureFlags.virtualViewActivityBehavior()) {
|
||||
'activity-without-mode' =>
|
||||
<Activity>{isHidden ? null : children}</Activity>,
|
||||
'activity-with-hidden-mode' =>
|
||||
<Activity mode={isHidden ? 'hidden' : 'visible'}>
|
||||
{children}
|
||||
</Activity>,
|
||||
'no-activity' | _ => isHidden ? null : children,
|
||||
}
|
||||
}
|
||||
{isHidden ? null : children}
|
||||
</VirtualViewNativeComponent>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<480e58e52425586928349b9f3560ce7f>>
|
||||
* @generated SignedSource<<fcf8bc19a86d7c5ffc3b36c01348df26>>
|
||||
* @flow strict
|
||||
* @noformat
|
||||
*/
|
||||
@@ -41,7 +41,6 @@ export type ReactNativeFeatureFlagsJsOnly = $ReadOnly<{
|
||||
shouldUseLinkRoleForPressableText: Getter<boolean>,
|
||||
shouldUseRemoveClippedSubviewsAsDefaultOnIOS: Getter<boolean>,
|
||||
shouldUseSetNativePropsInFabric: Getter<boolean>,
|
||||
virtualViewActivityBehavior: Getter<string>,
|
||||
}>;
|
||||
|
||||
export type ReactNativeFeatureFlagsJsOnlyOverrides = OverridesFor<ReactNativeFeatureFlagsJsOnly>;
|
||||
@@ -199,11 +198,6 @@ export const shouldUseRemoveClippedSubviewsAsDefaultOnIOS: Getter<boolean> = cre
|
||||
*/
|
||||
export const shouldUseSetNativePropsInFabric: Getter<boolean> = createJavaScriptFlagGetter('shouldUseSetNativePropsInFabric', true);
|
||||
|
||||
/**
|
||||
* Changes whether and how `VirtualView` uses `Activity`.
|
||||
*/
|
||||
export const virtualViewActivityBehavior: Getter<string> = createJavaScriptFlagGetter('virtualViewActivityBehavior', "no-activity");
|
||||
|
||||
/**
|
||||
* Common flag for testing. Do NOT modify.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user