Skip to content

Commit 6614709

Browse files
sammy-SCmeta-codesync[bot]
authored andcommitted
Remove hideOffscreenVirtualViewsOnIOS feature flag
Summary: The `hideOffscreenVirtualViewsOnIOS` flag gated hiding of offscreen `VirtualView`s on iOS (setting `self.hidden`) in `RCTVirtualViewComponentView`. It was never ramped and is being removed. The flag defaulted to `false`, so the gated branches never set `hidden`; deleting them restores the pre-flag behavior. The now-unused `ReactNativeFeatureFlags.h` import is also removed. Removes the flag definition from `ReactNativeFeatureFlags.config.js`, the gated call sites in `RCTVirtualViewComponentView.mm`, and the regenerated feature-flag files (via `yarn featureflags --update`). Changelog: [Internal] Reviewed By: javache Differential Revision: D108411518
1 parent b0d58bd commit 6614709

21 files changed

Lines changed: 47 additions & 182 deletions

packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.mm

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#import <React/UIView+React.h>
1717
#import <jsi/jsi.h>
1818

19-
#import <react/featureflags/ReactNativeFeatureFlags.h>
2019
#import <react/renderer/components/FBReactNativeSpec/ComponentDescriptors.h>
2120
#import <react/renderer/components/FBReactNativeSpec/EventEmitters.h>
2221
#import <react/renderer/components/FBReactNativeSpec/Props.h>
@@ -65,9 +64,6 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &
6564

6665
if (!_mode.has_value()) {
6766
_mode = newViewProps.initialHidden ? RCTVirtualViewModeHidden : RCTVirtualViewModeVisible;
68-
if (ReactNativeFeatureFlags::hideOffscreenVirtualViewsOnIOS()) {
69-
self.hidden = newViewProps.initialHidden && !sIsAccessibilityUsed;
70-
}
7167
}
7268

7369
switch (newViewProps.renderState) {
@@ -211,20 +207,6 @@ - (void)onModeChange:(RCTVirtualViewMode)newMode targetRect:(CGRect)targetRect t
211207
[self _dispatchAsyncModeChange:event];
212208
break;
213209
}
214-
215-
if (ReactNativeFeatureFlags::hideOffscreenVirtualViewsOnIOS()) {
216-
switch (newMode) {
217-
case RCTVirtualViewModeVisible:
218-
self.hidden = NO;
219-
break;
220-
case RCTVirtualViewModePrerender:
221-
self.hidden = !sIsAccessibilityUsed;
222-
break;
223-
case RCTVirtualViewModeHidden:
224-
self.hidden = YES;
225-
break;
226-
}
227-
}
228210
}
229211

230212
#pragma mark - Private API

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt

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<<5307fff9429956a3f3f2f54f2b6b00e7>>
7+
* @generated SignedSource<<17567d3adfba54ec2f888b50dae9efb8>>
88
*/
99

1010
/**
@@ -384,12 +384,6 @@ public object ReactNativeFeatureFlags {
384384
@JvmStatic
385385
public fun fuseboxScreenshotCaptureEnabled(): Boolean = accessor.fuseboxScreenshotCaptureEnabled()
386386

387-
/**
388-
* Hides offscreen VirtualViews on iOS by setting hidden = YES to avoid extra cost of views
389-
*/
390-
@JvmStatic
391-
public fun hideOffscreenVirtualViewsOnIOS(): Boolean = accessor.hideOffscreenVirtualViewsOnIOS()
392-
393387
/**
394388
* When enabled, uses optimized platform-specific paths to apply animated props synchronously. On Android, this uses a batched int/double buffer protocol with a single JNI call. On iOS, this passes AnimatedProps directly through the delegate chain and applies them via cloneProps, avoiding the folly::dynamic round-trip.
395389
*/

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt

Lines changed: 1 addition & 11 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<<d179182254004aa1f5adf671eccb953f>>
7+
* @generated SignedSource<<337b652caa9d443c8d83915e22210198>>
88
*/
99

1010
/**
@@ -79,7 +79,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
7979
private var fuseboxFrameRecordingEnabledCache: Boolean? = null
8080
private var fuseboxNetworkInspectionEnabledCache: Boolean? = null
8181
private var fuseboxScreenshotCaptureEnabledCache: Boolean? = null
82-
private var hideOffscreenVirtualViewsOnIOSCache: Boolean? = null
8382
private var optimizedAnimatedPropUpdatesCache: Boolean? = null
8483
private var overrideBySynchronousMountPropsAtMountingAndroidCache: Boolean? = null
8584
private var perfIssuesEnabledCache: Boolean? = null
@@ -639,15 +638,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
639638
return cached
640639
}
641640

642-
override fun hideOffscreenVirtualViewsOnIOS(): Boolean {
643-
var cached = hideOffscreenVirtualViewsOnIOSCache
644-
if (cached == null) {
645-
cached = ReactNativeFeatureFlagsCxxInterop.hideOffscreenVirtualViewsOnIOS()
646-
hideOffscreenVirtualViewsOnIOSCache = cached
647-
}
648-
return cached
649-
}
650-
651641
override fun optimizedAnimatedPropUpdates(): Boolean {
652642
var cached = optimizedAnimatedPropUpdatesCache
653643
if (cached == null) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt

Lines changed: 1 addition & 3 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<<6dc403c11108a657d48ec9573bee842f>>
7+
* @generated SignedSource<<b74d90991a4808bd1f3abfa75f3adcde>>
88
*/
99

1010
/**
@@ -146,8 +146,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
146146

147147
@DoNotStrip @JvmStatic public external fun fuseboxScreenshotCaptureEnabled(): Boolean
148148

149-
@DoNotStrip @JvmStatic public external fun hideOffscreenVirtualViewsOnIOS(): Boolean
150-
151149
@DoNotStrip @JvmStatic public external fun optimizedAnimatedPropUpdates(): Boolean
152150

153151
@DoNotStrip @JvmStatic public external fun overrideBySynchronousMountPropsAtMountingAndroid(): Boolean

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt

Lines changed: 1 addition & 3 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<<4fb216492a29e8b639ff42d12a4ca91e>>
7+
* @generated SignedSource<<5dff51ac171647871bef84c3e38d9d8c>>
88
*/
99

1010
/**
@@ -141,8 +141,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
141141

142142
override fun fuseboxScreenshotCaptureEnabled(): Boolean = false
143143

144-
override fun hideOffscreenVirtualViewsOnIOS(): Boolean = false
145-
146144
override fun optimizedAnimatedPropUpdates(): Boolean = false
147145

148146
override fun overrideBySynchronousMountPropsAtMountingAndroid(): Boolean = true

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt

Lines changed: 1 addition & 12 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<<8ba7f19e8afe329937b1b36d3b83dbc5>>
7+
* @generated SignedSource<<164c9c2751f660ee098c12b8cf2c8b66>>
88
*/
99

1010
/**
@@ -83,7 +83,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
8383
private var fuseboxFrameRecordingEnabledCache: Boolean? = null
8484
private var fuseboxNetworkInspectionEnabledCache: Boolean? = null
8585
private var fuseboxScreenshotCaptureEnabledCache: Boolean? = null
86-
private var hideOffscreenVirtualViewsOnIOSCache: Boolean? = null
8786
private var optimizedAnimatedPropUpdatesCache: Boolean? = null
8887
private var overrideBySynchronousMountPropsAtMountingAndroidCache: Boolean? = null
8988
private var perfIssuesEnabledCache: Boolean? = null
@@ -702,16 +701,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
702701
return cached
703702
}
704703

705-
override fun hideOffscreenVirtualViewsOnIOS(): Boolean {
706-
var cached = hideOffscreenVirtualViewsOnIOSCache
707-
if (cached == null) {
708-
cached = currentProvider.hideOffscreenVirtualViewsOnIOS()
709-
accessedFeatureFlags.add("hideOffscreenVirtualViewsOnIOS")
710-
hideOffscreenVirtualViewsOnIOSCache = cached
711-
}
712-
return cached
713-
}
714-
715704
override fun optimizedAnimatedPropUpdates(): Boolean {
716705
var cached = optimizedAnimatedPropUpdatesCache
717706
if (cached == null) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt

Lines changed: 1 addition & 3 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<<3a3f9014f644b6b964b50d0974a7b9b5>>
7+
* @generated SignedSource<<b9cfc6790e36d7f7ff0ce9b87edca1e8>>
88
*/
99

1010
/**
@@ -141,8 +141,6 @@ public interface ReactNativeFeatureFlagsProvider {
141141

142142
@DoNotStrip public fun fuseboxScreenshotCaptureEnabled(): Boolean
143143

144-
@DoNotStrip public fun hideOffscreenVirtualViewsOnIOS(): Boolean
145-
146144
@DoNotStrip public fun optimizedAnimatedPropUpdates(): Boolean
147145

148146
@DoNotStrip public fun overrideBySynchronousMountPropsAtMountingAndroid(): Boolean

packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp

Lines changed: 1 addition & 15 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<<70e4f4b4bb3aa28a644ede80ceeb4fc3>>
7+
* @generated SignedSource<<ff63bb537a04e29fdb97e9d87fb7570c>>
88
*/
99

1010
/**
@@ -393,12 +393,6 @@ class ReactNativeFeatureFlagsJavaProvider
393393
return method(javaProvider_);
394394
}
395395

396-
bool hideOffscreenVirtualViewsOnIOS() override {
397-
static const auto method =
398-
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("hideOffscreenVirtualViewsOnIOS");
399-
return method(javaProvider_);
400-
}
401-
402396
bool optimizedAnimatedPropUpdates() override {
403397
static const auto method =
404398
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("optimizedAnimatedPropUpdates");
@@ -860,11 +854,6 @@ bool JReactNativeFeatureFlagsCxxInterop::fuseboxScreenshotCaptureEnabled(
860854
return ReactNativeFeatureFlags::fuseboxScreenshotCaptureEnabled();
861855
}
862856

863-
bool JReactNativeFeatureFlagsCxxInterop::hideOffscreenVirtualViewsOnIOS(
864-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
865-
return ReactNativeFeatureFlags::hideOffscreenVirtualViewsOnIOS();
866-
}
867-
868857
bool JReactNativeFeatureFlagsCxxInterop::optimizedAnimatedPropUpdates(
869858
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
870859
return ReactNativeFeatureFlags::optimizedAnimatedPropUpdates();
@@ -1208,9 +1197,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
12081197
makeNativeMethod(
12091198
"fuseboxScreenshotCaptureEnabled",
12101199
JReactNativeFeatureFlagsCxxInterop::fuseboxScreenshotCaptureEnabled),
1211-
makeNativeMethod(
1212-
"hideOffscreenVirtualViewsOnIOS",
1213-
JReactNativeFeatureFlagsCxxInterop::hideOffscreenVirtualViewsOnIOS),
12141200
makeNativeMethod(
12151201
"optimizedAnimatedPropUpdates",
12161202
JReactNativeFeatureFlagsCxxInterop::optimizedAnimatedPropUpdates),

packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h

Lines changed: 1 addition & 4 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<<19ab9f9ec4e3470290f69e0803ade5d4>>
7+
* @generated SignedSource<<a61fa73c8b01506a3eb1caa411a5854f>>
88
*/
99

1010
/**
@@ -207,9 +207,6 @@ class JReactNativeFeatureFlagsCxxInterop
207207
static bool fuseboxScreenshotCaptureEnabled(
208208
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
209209

210-
static bool hideOffscreenVirtualViewsOnIOS(
211-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
212-
213210
static bool optimizedAnimatedPropUpdates(
214211
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
215212

packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp

Lines changed: 1 addition & 5 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<<de5333acce3cebc8c1f88e7d95b111e8>>
7+
* @generated SignedSource<<dae2de640250ff7281b56633c75712d8>>
88
*/
99

1010
/**
@@ -262,10 +262,6 @@ bool ReactNativeFeatureFlags::fuseboxScreenshotCaptureEnabled() {
262262
return getAccessor().fuseboxScreenshotCaptureEnabled();
263263
}
264264

265-
bool ReactNativeFeatureFlags::hideOffscreenVirtualViewsOnIOS() {
266-
return getAccessor().hideOffscreenVirtualViewsOnIOS();
267-
}
268-
269265
bool ReactNativeFeatureFlags::optimizedAnimatedPropUpdates() {
270266
return getAccessor().optimizedAnimatedPropUpdates();
271267
}

0 commit comments

Comments
 (0)