From 45e4a582a2a6e31fb300d4778ec89c88d40fa474 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Thu, 8 Jan 2026 09:49:44 -0800 Subject: [PATCH 1/5] Fling: Rename `VirtualView{Experimental => }` Native Component Summary: Renames `VirtualViewExperimental` to `VirtualView`. Changelog: [Internal] Differential Revision: D90289664 --- packages/react-native/Package.swift | 4 +-- .../RCTVirtualViewComponentView.h} | 2 +- .../RCTVirtualViewComponentView.mm} | 30 ++++++++-------- .../RCTVirtualViewMode.h | 0 .../RCTVirtualViewRenderState.h | 0 .../ReactAndroid/api/ReactAndroid.api | 16 ++++----- .../ReactVirtualView.kt} | 6 ++-- .../ReactVirtualViewManager.kt} | 35 +++++++++---------- .../react/fabric/CoreComponentsRegistry.cpp | 5 ++- .../React-FabricComponents.podspec | 6 ---- .../VirtualViewComponentDescriptor.h} | 4 +-- .../VirtualViewShadowNode.h} | 10 +++--- .../components/virtualview/VirtualView.js | 2 +- .../__tests__/VirtualView-itest.js | 2 +- packages/rn-tester/Podfile.lock | 28 --------------- 15 files changed, 55 insertions(+), 95 deletions(-) rename packages/react-native/React/Fabric/Mounting/ComponentViews/{VirtualViewExperimental/RCTVirtualViewExperimentalComponentView.h => VirtualView/RCTVirtualViewComponentView.h} (84%) rename packages/react-native/React/Fabric/Mounting/ComponentViews/{VirtualViewExperimental/RCTVirtualViewExperimentalComponentView.mm => VirtualView/RCTVirtualViewComponentView.mm} (88%) rename packages/react-native/React/Fabric/Mounting/ComponentViews/{VirtualViewExperimental => VirtualView}/RCTVirtualViewMode.h (100%) rename packages/react-native/React/Fabric/Mounting/ComponentViews/{VirtualViewExperimental => VirtualView}/RCTVirtualViewRenderState.h (100%) rename packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/{viewexperimental/ReactVirtualViewExperimental.kt => view/ReactVirtualView.kt} (98%) rename packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/{viewexperimental/ReactVirtualViewExperimentalManager.kt => view/ReactVirtualViewManager.kt} (72%) rename packages/react-native/ReactCommon/react/renderer/components/{virtualviewexperimental/VirtualViewExperimentalComponentDescriptor.h => virtualview/VirtualViewComponentDescriptor.h} (64%) rename packages/react-native/ReactCommon/react/renderer/components/{virtualviewexperimental/VirtualViewExperimentalShadowNode.h => virtualview/VirtualViewShadowNode.h} (63%) diff --git a/packages/react-native/Package.swift b/packages/react-native/Package.swift index 0b2ec65ab2b5c0..28549c1a9ac88f 100644 --- a/packages/react-native/Package.swift +++ b/packages/react-native/Package.swift @@ -37,7 +37,6 @@ let CallInvokerPath = "ReactCommon/callinvoker" // header only target let ReactFBReactNativeSpecPath = "React/FBReactNativeSpec" // generated let FBLazyVectorPath = "Libraries/FBLazyVector" // header only let virtualViewPath = "ReactCommon/react/renderer/components/virtualview" // header only -let virtualViewExperimentalPath = "ReactCommon/react/renderer/components/virtualviewexperimental" // header only // MARK: Prebuilt Dependencies declaration let reactNativeDependencies = BinaryTarget( @@ -454,7 +453,6 @@ let reactFabric = RNTarget( "components/textinput/platform/ios/", "components/unimplementedview", "components/virtualview", - "components/virtualviewexperimental", "components/root/tests", ], dependencies: [.reactNativeDependencies, .reactJsiExecutor, .rctTypesafety, .reactTurboModuleCore, .jsi, .logger, .reactDebug, .reactFeatureFlags, .reactUtils, .reactRuntimeScheduler, .reactCxxReact, .reactRendererDebug, .reactGraphics, .yoga], @@ -541,7 +539,7 @@ let reactFabricUnimplementedView = RNTarget( let reactRCTFabric = RNTarget( name: .reactRCTFabric, path: "React/Fabric", - searchPaths: [virtualViewPath, virtualViewExperimentalPath], + searchPaths: [virtualViewPath], dependencies: [.reactNativeDependencies, .reactCore, .reactRCTImage, .yoga, .reactRCTText, .jsi, .reactFabricInputAccessory, .reactFabricModal, .reactFabricSafeAreaView, .reactFabricSwitch, .reactFabricText, .reactFabricTextInput, .reactFabricUnimplementedView, .reactFabricTextLayoutManager, .reactGraphics, .reactImageManager, .reactDebug, .reactUtils, .reactPerformanceTimeline, .reactRendererDebug, .reactRendererConsistency, .reactRuntimeScheduler, .reactRCTAnimation, .reactJsInspector, .reactJsInspectorNetwork, .reactJsInspectorTracing, .reactFabric, .reactFabricImage, .rctSwiftUIWrapper] ) diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualViewExperimental/RCTVirtualViewExperimentalComponentView.h b/packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.h similarity index 84% rename from packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualViewExperimental/RCTVirtualViewExperimentalComponentView.h rename to packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.h index 519e9aa6037aa2..cc42f586938f9f 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualViewExperimental/RCTVirtualViewExperimentalComponentView.h +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.h @@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface RCTVirtualViewExperimentalComponentView : RCTViewComponentView +@interface RCTVirtualViewComponentView : RCTViewComponentView + (instancetype)new NS_UNAVAILABLE; - (instancetype)init NS_UNAVAILABLE; diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualViewExperimental/RCTVirtualViewExperimentalComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.mm similarity index 88% rename from packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualViewExperimental/RCTVirtualViewExperimentalComponentView.mm rename to packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.mm index 81187c7b2ecc0f..c76ee87bd3b88b 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualViewExperimental/RCTVirtualViewExperimentalComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.mm @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import "RCTVirtualViewExperimentalComponentView.h" +#import "RCTVirtualViewComponentView.h" #import #import @@ -20,8 +20,8 @@ #import #import #import -#import -#import +#import +#import #import "RCTFabricComponentsPlugins.h" #import "RCTVirtualViewMode.h" @@ -30,13 +30,13 @@ using namespace facebook; using namespace facebook::react; -@interface RCTVirtualViewExperimentalComponentView () { +@interface RCTVirtualViewComponentView () { NSString *_virtualViewID; } @end -@implementation RCTVirtualViewExperimentalComponentView { +@implementation RCTVirtualViewComponentView { id _parentVirtualViewContainer; std::optional _mode; RCTVirtualViewRenderState _renderState; @@ -50,7 +50,7 @@ @implementation RCTVirtualViewExperimentalComponentView { - (instancetype)initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame]) != nil) { - _props = VirtualViewExperimentalShadowNode::defaultSharedProps(); + _props = VirtualViewShadowNode::defaultSharedProps(); _renderState = RCTVirtualViewRenderStateUnknown; _virtualViewID = [[NSUUID UUID] UUIDString]; _didLayout = NO; @@ -61,7 +61,7 @@ - (instancetype)initWithFrame:(CGRect)frame - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps { - const auto &newViewProps = static_cast(*props); + const auto &newViewProps = static_cast(*props); if (!_mode.has_value()) { _mode = newViewProps.initialHidden ? RCTVirtualViewModeHidden : RCTVirtualViewModeVisible; @@ -177,7 +177,7 @@ - (void)onModeChange:(RCTVirtualViewMode)newMode targetRect:(CGRect)targetRect t // NOTE: Make sure to keep these props in sync with dispatchSyncModeChange below where we have to explicitly copy // all props. - VirtualViewExperimentalEventEmitter::OnModeChange event = { + VirtualViewEventEmitter::OnModeChange event = { .mode = (int)newMode, .targetRect = {.x = targetRect.origin.x, @@ -260,23 +260,23 @@ - (void)_unhideIfNeeded return nil; } -- (void)_dispatchAsyncModeChange:(VirtualViewExperimentalEventEmitter::OnModeChange &)event +- (void)_dispatchAsyncModeChange:(VirtualViewEventEmitter::OnModeChange &)event { if (!_eventEmitter) { return; } - auto &emitter = static_cast(*_eventEmitter); + auto &emitter = static_cast(*_eventEmitter); emitter.onModeChange(event); } -- (void)_dispatchSyncModeChange:(VirtualViewExperimentalEventEmitter::OnModeChange &)event +- (void)_dispatchSyncModeChange:(VirtualViewEventEmitter::OnModeChange &)event { if (!_eventEmitter) { return; } - auto &emitter = static_cast(*_eventEmitter); + auto &emitter = static_cast(*_eventEmitter); // TODO: Move this into a custom event emitter. We had to duplicate the codegen code here from onModeChange in order // to dispatch synchronously and discrete. @@ -310,12 +310,12 @@ - (void)_dispatchSyncModeChange:(VirtualViewExperimentalEventEmitter::OnModeChan + (ComponentDescriptorProvider)componentDescriptorProvider { - return concreteComponentDescriptorProvider(); + return concreteComponentDescriptorProvider(); } @end -Class VirtualViewExperimentalCls(void) +Class VirtualViewCls(void) { - return RCTVirtualViewExperimentalComponentView.class; + return RCTVirtualViewComponentView.class; } diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualViewExperimental/RCTVirtualViewMode.h b/packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewMode.h similarity index 100% rename from packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualViewExperimental/RCTVirtualViewMode.h rename to packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewMode.h diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualViewExperimental/RCTVirtualViewRenderState.h b/packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewRenderState.h similarity index 100% rename from packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualViewExperimental/RCTVirtualViewRenderState.h rename to packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewRenderState.h diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api index 3a8e4513db9900..aa31d38cc437d6 100644 --- a/packages/react-native/ReactAndroid/api/ReactAndroid.api +++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api @@ -6702,7 +6702,7 @@ public final class com/facebook/react/views/virtual/VirtualViewMode : java/lang/ public static fun values ()[Lcom/facebook/react/views/virtual/VirtualViewMode; } -public final class com/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimental : com/facebook/react/views/view/ReactViewGroup, android/view/View$OnLayoutChangeListener, com/facebook/react/views/scroll/VirtualView { +public final class com/facebook/react/views/virtual/view/ReactVirtualView : com/facebook/react/views/view/ReactViewGroup, android/view/View$OnLayoutChangeListener, com/facebook/react/views/scroll/VirtualView { public fun (Landroid/content/Context;)V public fun getContainerRelativeRect ()Landroid/graphics/Rect; public fun getVirtualViewID ()Ljava/lang/String; @@ -6712,8 +6712,8 @@ public final class com/facebook/react/views/virtual/viewexperimental/ReactVirtua public fun updateClippingRect (Ljava/util/Set;)V } -public final class com/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimentalManager : com/facebook/react/views/view/ReactClippingViewManager, com/facebook/react/viewmanagers/VirtualViewExperimentalManagerInterface { - public static final field Companion Lcom/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimentalManager$Companion; +public final class com/facebook/react/views/virtual/view/ReactVirtualViewManager : com/facebook/react/views/view/ReactClippingViewManager, com/facebook/react/viewmanagers/VirtualViewManagerInterface { + public static final field Companion Lcom/facebook/react/views/virtual/view/ReactVirtualViewManager$Companion; public static final field REACT_CLASS Ljava/lang/String; public fun ()V public synthetic fun addEventEmitters (Lcom/facebook/react/uimanager/ThemedReactContext;Landroid/view/View;)V @@ -6721,18 +6721,18 @@ public final class com/facebook/react/views/virtual/viewexperimental/ReactVirtua public fun getName ()Ljava/lang/String; public synthetic fun prepareToRecycleView (Lcom/facebook/react/uimanager/ThemedReactContext;Landroid/view/View;)Landroid/view/View; public synthetic fun setInitialHidden (Landroid/view/View;Z)V - public fun setInitialHidden (Lcom/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimental;Z)V + public fun setInitialHidden (Lcom/facebook/react/views/virtual/view/ReactVirtualView;Z)V public synthetic fun setNativeId (Landroid/view/View;Ljava/lang/String;)V - public fun setNativeId (Lcom/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimental;Ljava/lang/String;)V + public fun setNativeId (Lcom/facebook/react/views/virtual/view/ReactVirtualView;Ljava/lang/String;)V public synthetic fun setRemoveClippedSubviews (Landroid/view/View;Z)V public synthetic fun setRenderState (Landroid/view/View;I)V - public fun setRenderState (Lcom/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimental;I)V + public fun setRenderState (Lcom/facebook/react/views/virtual/view/ReactVirtualView;I)V } -public final class com/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimentalManager$Companion { +public final class com/facebook/react/views/virtual/view/ReactVirtualViewManager$Companion { } -public final class com/facebook/react/views/virtual/viewexperimental/VirtualViewEventEmitter : com/facebook/react/views/virtual/VirtualViewModeChangeEmitter { +public final class com/facebook/react/views/virtual/view/VirtualViewEventEmitter : com/facebook/react/views/virtual/VirtualViewModeChangeEmitter { public fun (IILcom/facebook/react/uimanager/events/EventDispatcher;)V public fun emitModeChange (Lcom/facebook/react/views/virtual/VirtualViewMode;Landroid/graphics/Rect;Landroid/graphics/Rect;Z)V } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimental.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualView.kt similarity index 98% rename from packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimental.kt rename to packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualView.kt index 0bb160bff67adb..32737d6dd77e00 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimental.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualView.kt @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -package com.facebook.react.views.virtual.viewexperimental +package com.facebook.react.views.virtual.view import android.content.Context import android.graphics.Rect @@ -25,7 +25,7 @@ import com.facebook.react.views.virtual.VirtualViewMode import com.facebook.react.views.virtual.VirtualViewModeChangeEmitter import com.facebook.react.views.virtual.VirtualViewRenderState -public class ReactVirtualViewExperimental(context: Context) : +public class ReactVirtualView(context: Context) : ReactViewGroup(context), VirtualView, View.OnLayoutChangeListener { internal var mode: VirtualViewMode? = null @@ -300,6 +300,6 @@ public class ReactVirtualViewExperimental(context: Context) : } } -private const val DEBUG_TAG: String = "ReactVirtualViewExperimental" +private const val DEBUG_TAG: String = "ReactVirtualView" private val IS_DEBUG_BUILD = ReactBuildConfig.DEBUG || ReactBuildConfig.IS_INTERNAL_BUILD || ReactBuildConfig.ENABLE_PERFETTO diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimentalManager.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualViewManager.kt similarity index 72% rename from packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimentalManager.kt rename to packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualViewManager.kt index a604f4fc5117e2..b5ca31bf6ccf8b 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimentalManager.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualViewManager.kt @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -package com.facebook.react.views.virtual.viewexperimental +package com.facebook.react.views.virtual.view import android.graphics.Rect import androidx.annotation.VisibleForTesting @@ -16,37 +16,36 @@ import com.facebook.react.uimanager.UIManagerHelper import com.facebook.react.uimanager.ViewManagerDelegate import com.facebook.react.uimanager.annotations.ReactProp import com.facebook.react.uimanager.events.EventDispatcher -import com.facebook.react.viewmanagers.VirtualViewExperimentalManagerDelegate -import com.facebook.react.viewmanagers.VirtualViewExperimentalManagerInterface +import com.facebook.react.viewmanagers.VirtualViewManagerDelegate +import com.facebook.react.viewmanagers.VirtualViewManagerInterface import com.facebook.react.views.view.ReactClippingViewManager import com.facebook.react.views.virtual.VirtualViewMode import com.facebook.react.views.virtual.VirtualViewModeChangeEmitter import com.facebook.react.views.virtual.VirtualViewModeChangeEvent import com.facebook.react.views.virtual.VirtualViewRenderState -@ReactModule(name = ReactVirtualViewExperimentalManager.REACT_CLASS) -public class ReactVirtualViewExperimentalManager : - ReactClippingViewManager(), - VirtualViewExperimentalManagerInterface { +@ReactModule(name = ReactVirtualViewManager.REACT_CLASS) +public class ReactVirtualViewManager : + ReactClippingViewManager(), VirtualViewManagerInterface { - private val _delegate = VirtualViewExperimentalManagerDelegate(this) + private val _delegate = VirtualViewManagerDelegate(this) - override fun getDelegate(): ViewManagerDelegate = _delegate + override fun getDelegate(): ViewManagerDelegate = _delegate override fun getName(): String = REACT_CLASS - override fun createViewInstance(reactContext: ThemedReactContext): ReactVirtualViewExperimental = - ReactVirtualViewExperimental(reactContext) + override fun createViewInstance(reactContext: ThemedReactContext): ReactVirtualView = + ReactVirtualView(reactContext) @ReactProp(name = "initialHidden") - override fun setInitialHidden(view: ReactVirtualViewExperimental, value: Boolean) { + override fun setInitialHidden(view: ReactVirtualView, value: Boolean) { if (view.mode == null) { view.mode = if (value) VirtualViewMode.Hidden else VirtualViewMode.Visible } } @ReactProp(name = "renderState") - override fun setRenderState(view: ReactVirtualViewExperimental, value: Int) { + override fun setRenderState(view: ReactVirtualView, value: Int) { // If disabled, `renderState` will always be `VirtualViewRenderState.Unknown`. if (ReactNativeFeatureFlags.enableVirtualViewRenderState()) { view.renderState = @@ -58,13 +57,13 @@ public class ReactVirtualViewExperimentalManager : } } - override fun setNativeId(view: ReactVirtualViewExperimental, nativeId: String?) { + override fun setNativeId(view: ReactVirtualView, nativeId: String?) { super.setNativeId(view, nativeId) } override fun addEventEmitters( reactContext: ThemedReactContext, - view: ReactVirtualViewExperimental, + view: ReactVirtualView, ) { val dispatcher = UIManagerHelper.getEventDispatcherForReactTag(reactContext, view.id) ?: return view.modeChangeEmitter = @@ -73,14 +72,14 @@ public class ReactVirtualViewExperimentalManager : override fun prepareToRecycleView( reactContext: ThemedReactContext, - view: ReactVirtualViewExperimental, - ): ReactVirtualViewExperimental? { + view: ReactVirtualView, + ): ReactVirtualView? { view.recycleView() return super.prepareToRecycleView(reactContext, view) } public companion object { - public const val REACT_CLASS: String = "VirtualViewExperimental" + public const val REACT_CLASS: String = "VirtualView" } } diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp index 9f9624b8848b9e..03d455ee92f460 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include namespace facebook::react::CoreComponentsRegistry { @@ -81,8 +81,7 @@ void addCoreComponents( concreteComponentDescriptorProvider< LayoutConformanceComponentDescriptor>()); providerRegistry->add( - concreteComponentDescriptorProvider< - VirtualViewExperimentalComponentDescriptor>()); + concreteComponentDescriptorProvider()); } } // namespace facebook::react::CoreComponentsRegistry diff --git a/packages/react-native/ReactCommon/React-FabricComponents.podspec b/packages/react-native/ReactCommon/React-FabricComponents.podspec index 86786a77585060..a501b020470bdd 100644 --- a/packages/react-native/ReactCommon/React-FabricComponents.podspec +++ b/packages/react-native/ReactCommon/React-FabricComponents.podspec @@ -149,12 +149,6 @@ Pod::Spec.new do |s| sss.header_dir = "react/renderer/components/virtualview" end - ss.subspec "virtualviewexperimental" do |sss| - sss.source_files = "react/renderer/components/virtualviewexperimental/**/*.{m,mm,cpp,h}" - sss.exclude_files = "react/renderer/components/virtualviewexperimental/tests" - sss.header_dir = "react/renderer/components/virtualviewexperimental" - end - # Legacy header paths for backwards compat ss.subspec "rncore" do |sss| sss.source_files = podspec_sources("react/renderer/components/rncore/**/*.h", "react/renderer/components/rncore/**/*.h") diff --git a/packages/react-native/ReactCommon/react/renderer/components/virtualviewexperimental/VirtualViewExperimentalComponentDescriptor.h b/packages/react-native/ReactCommon/react/renderer/components/virtualview/VirtualViewComponentDescriptor.h similarity index 64% rename from packages/react-native/ReactCommon/react/renderer/components/virtualviewexperimental/VirtualViewExperimentalComponentDescriptor.h rename to packages/react-native/ReactCommon/react/renderer/components/virtualview/VirtualViewComponentDescriptor.h index 35928f9eb3bd03..9a01e3e664ca4c 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/virtualviewexperimental/VirtualViewExperimentalComponentDescriptor.h +++ b/packages/react-native/ReactCommon/react/renderer/components/virtualview/VirtualViewComponentDescriptor.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include namespace facebook::react { @@ -15,5 +15,5 @@ namespace facebook::react { /* * Descriptor for component. */ -using VirtualViewExperimentalComponentDescriptor = ConcreteComponentDescriptor; +using VirtualViewComponentDescriptor = ConcreteComponentDescriptor; } // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/components/virtualviewexperimental/VirtualViewExperimentalShadowNode.h b/packages/react-native/ReactCommon/react/renderer/components/virtualview/VirtualViewShadowNode.h similarity index 63% rename from packages/react-native/ReactCommon/react/renderer/components/virtualviewexperimental/VirtualViewExperimentalShadowNode.h rename to packages/react-native/ReactCommon/react/renderer/components/virtualview/VirtualViewShadowNode.h index 04e1badac21e5d..7b1d1fc6cc0dc8 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/virtualviewexperimental/VirtualViewExperimentalShadowNode.h +++ b/packages/react-native/ReactCommon/react/renderer/components/virtualview/VirtualViewShadowNode.h @@ -13,15 +13,13 @@ namespace facebook::react { -constexpr const char VirtualViewExperimentalComponentName[] = "VirtualViewExperimental"; +constexpr const char VirtualViewComponentName[] = "VirtualView"; /* - * `ShadowNode` for component. + * `ShadowNode` for component. */ -class VirtualViewExperimentalShadowNode final : public ConcreteViewShadowNode< - VirtualViewExperimentalComponentName, - VirtualViewExperimentalProps, - VirtualViewExperimentalEventEmitter> { +class VirtualViewShadowNode final + : public ConcreteViewShadowNode { public: using ConcreteViewShadowNode::ConcreteViewShadowNode; diff --git a/packages/react-native/src/private/components/virtualview/VirtualView.js b/packages/react-native/src/private/components/virtualview/VirtualView.js index ed0844801b6175..7f952492cd16db 100644 --- a/packages/react-native/src/private/components/virtualview/VirtualView.js +++ b/packages/react-native/src/private/components/virtualview/VirtualView.js @@ -11,7 +11,7 @@ import type {ViewStyleProp} from '../../../../Libraries/StyleSheet/StyleSheet'; import type {NativeSyntheticEvent} from '../../../../Libraries/Types/CoreEventTypes'; import type {HostInstance} from '../../types/HostInstance'; -import type {NativeModeChangeEvent} from './VirtualViewExperimentalNativeComponent'; +import type {NativeModeChangeEvent} from './VirtualViewNativeComponent'; import UIManager from '../../../../Libraries/ReactNative/UIManager'; import StyleSheet from '../../../../Libraries/StyleSheet/StyleSheet'; diff --git a/packages/react-native/src/private/components/virtualview/__tests__/VirtualView-itest.js b/packages/react-native/src/private/components/virtualview/__tests__/VirtualView-itest.js index 555016e048e3be..1115fd9201e249 100644 --- a/packages/react-native/src/private/components/virtualview/__tests__/VirtualView-itest.js +++ b/packages/react-native/src/private/components/virtualview/__tests__/VirtualView-itest.js @@ -11,7 +11,7 @@ import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment'; import type {Rect} from '../VirtualView'; -import type {NativeModeChangeEvent} from '../VirtualViewExperimentalNativeComponent'; +import type {NativeModeChangeEvent} from '../VirtualViewNativeComponent'; import ensureInstance from '../../../__tests__/utilities/ensureInstance'; import isUnreachable from '../../../__tests__/utilities/isUnreachable'; diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index 5addd20bc01b9f..6f3dcbc20306f1 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -1277,7 +1277,6 @@ PODS: - React-FabricComponents/components/textinput (= 1000.0.0) - React-FabricComponents/components/unimplementedview (= 1000.0.0) - React-FabricComponents/components/virtualview (= 1000.0.0) - - React-FabricComponents/components/virtualviewexperimental (= 1000.0.0) - React-featureflags - React-graphics - React-jsi @@ -1560,33 +1559,6 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - React-FabricComponents/components/virtualviewexperimental (1000.0.0): - - boost - - DoubleConversion - - fast_float - - fmt - - glog - - hermes-engine - - RCT-Folly - - RCT-Folly/Fabric - - RCTRequired - - RCTTypeSafety - - React-Core - - React-cxxreact - - React-debug - - React-Fabric - - React-featureflags - - React-graphics - - React-jsi - - React-jsiexecutor - - React-logger - - React-RCTFBReactNativeSpec - - React-rendererdebug - - React-runtimescheduler - - React-utils - - ReactCommon/turbomodule/core - - SocketRocket - - Yoga - React-FabricComponents/textlayoutmanager (1000.0.0): - boost - DoubleConversion From beab50ca3ffbde2becf5a39c216854ab674c2efc Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Thu, 8 Jan 2026 10:02:11 -0800 Subject: [PATCH 2/5] Fling: Cleanup `enableVirtualViewWindowFocusDetection` Summary: Deletes the `enableVirtualViewWindowFocusDetection` feature flag. It was never rolled out and not found to significantly improve performance. Changelog: [Internal] Differential Revision: D90334082 --- .../featureflags/ReactNativeFeatureFlags.kt | 8 +- .../ReactNativeFeatureFlagsCxxAccessor.kt | 12 +-- .../ReactNativeFeatureFlagsCxxInterop.kt | 4 +- .../ReactNativeFeatureFlagsDefaults.kt | 4 +- .../ReactNativeFeatureFlagsLocalAccessor.kt | 13 +-- .../ReactNativeFeatureFlagsProvider.kt | 4 +- .../scroll/ReactHorizontalScrollView.java | 3 - .../react/views/scroll/ReactScrollView.java | 3 - .../views/scroll/VirtualViewContainer.kt | 19 ----- .../VirtualViewContainerStateClassic.kt | 10 +-- .../VirtualViewContainerStateExperimental.kt | 10 +-- .../JReactNativeFeatureFlagsCxxInterop.cpp | 16 +--- .../JReactNativeFeatureFlagsCxxInterop.h | 5 +- .../featureflags/ReactNativeFeatureFlags.cpp | 6 +- .../featureflags/ReactNativeFeatureFlags.h | 7 +- .../ReactNativeFeatureFlagsAccessor.cpp | 82 ++++++++----------- .../ReactNativeFeatureFlagsAccessor.h | 6 +- .../ReactNativeFeatureFlagsDefaults.h | 6 +- .../ReactNativeFeatureFlagsDynamicProvider.h | 11 +-- .../ReactNativeFeatureFlagsProvider.h | 3 +- .../NativeReactNativeFeatureFlags.cpp | 7 +- .../NativeReactNativeFeatureFlags.h | 4 +- .../ReactNativeFeatureFlags.config.js | 11 --- .../featureflags/ReactNativeFeatureFlags.js | 7 +- .../specs/NativeReactNativeFeatureFlags.js | 3 +- 25 files changed, 53 insertions(+), 211 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt index 1226f2332b0ed2..6d8ac4fe9aea41 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt @@ -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<<3ee5c6b643fa4065a8168ebbb19d4efc>> + * @generated SignedSource<<91ad23aa529522a802b8d03198d7ccb9>> */ /** @@ -348,12 +348,6 @@ public object ReactNativeFeatureFlags { @JvmStatic public fun enableVirtualViewRenderState(): Boolean = accessor.enableVirtualViewRenderState() - /** - * Enables window focus detection for prioritizing VirtualView events. - */ - @JvmStatic - public fun enableVirtualViewWindowFocusDetection(): Boolean = accessor.enableVirtualViewWindowFocusDetection() - /** * Uses the default event priority instead of the discreet event priority by default when dispatching events from Fabric to React. */ diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt index e50ea95918bfce..59f8fc1039c371 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt @@ -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<<0c88c86f3085fa7c319b0c0a60102057>> + * @generated SignedSource<<6188f6b73c835b514bd13de3b7a3f55c>> */ /** @@ -73,7 +73,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces private var enableVirtualViewContainerStateExperimentalCache: Boolean? = null private var enableVirtualViewDebugFeaturesCache: Boolean? = null private var enableVirtualViewRenderStateCache: Boolean? = null - private var enableVirtualViewWindowFocusDetectionCache: Boolean? = null private var fixMappingOfEventPrioritiesBetweenFabricAndReactCache: Boolean? = null private var fixTextClippingAndroid15useBoundsForWidthCache: Boolean? = null private var fuseboxAssertSingleHostStateCache: Boolean? = null @@ -583,15 +582,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces return cached } - override fun enableVirtualViewWindowFocusDetection(): Boolean { - var cached = enableVirtualViewWindowFocusDetectionCache - if (cached == null) { - cached = ReactNativeFeatureFlagsCxxInterop.enableVirtualViewWindowFocusDetection() - enableVirtualViewWindowFocusDetectionCache = cached - } - return cached - } - override fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean { var cached = fixMappingOfEventPrioritiesBetweenFabricAndReactCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt index 2d46ace1285bdf..bf6bf0d9acf9be 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt @@ -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<> + * @generated SignedSource<<2528d994ff2ed6ada21f7ff67cdfcd0a>> */ /** @@ -134,8 +134,6 @@ public object ReactNativeFeatureFlagsCxxInterop { @DoNotStrip @JvmStatic public external fun enableVirtualViewRenderState(): Boolean - @DoNotStrip @JvmStatic public external fun enableVirtualViewWindowFocusDetection(): Boolean - @DoNotStrip @JvmStatic public external fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean @DoNotStrip @JvmStatic public external fun fixTextClippingAndroid15useBoundsForWidth(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt index 892e99dabe9f9d..9cba676f29657e 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt @@ -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<<15272e1b6cbbcb03b08f453e9cdfccb1>> + * @generated SignedSource<> */ /** @@ -129,8 +129,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi override fun enableVirtualViewRenderState(): Boolean = true - override fun enableVirtualViewWindowFocusDetection(): Boolean = false - override fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean = false override fun fixTextClippingAndroid15useBoundsForWidth(): Boolean = false diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt index 4c9ade9369b728..4aef0a07e8c6c6 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt @@ -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<<2a0f4c8afaa630631d09e804776197a2>> + * @generated SignedSource<> */ /** @@ -77,7 +77,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc private var enableVirtualViewContainerStateExperimentalCache: Boolean? = null private var enableVirtualViewDebugFeaturesCache: Boolean? = null private var enableVirtualViewRenderStateCache: Boolean? = null - private var enableVirtualViewWindowFocusDetectionCache: Boolean? = null private var fixMappingOfEventPrioritiesBetweenFabricAndReactCache: Boolean? = null private var fixTextClippingAndroid15useBoundsForWidthCache: Boolean? = null private var fuseboxAssertSingleHostStateCache: Boolean? = null @@ -640,16 +639,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc return cached } - override fun enableVirtualViewWindowFocusDetection(): Boolean { - var cached = enableVirtualViewWindowFocusDetectionCache - if (cached == null) { - cached = currentProvider.enableVirtualViewWindowFocusDetection() - accessedFeatureFlags.add("enableVirtualViewWindowFocusDetection") - enableVirtualViewWindowFocusDetectionCache = cached - } - return cached - } - override fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean { var cached = fixMappingOfEventPrioritiesBetweenFabricAndReactCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt index 0741ff20130dc5..e6f778e74922b7 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt @@ -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<<6346af0ed92119faadaec2b5b08b34d1>> + * @generated SignedSource<> */ /** @@ -129,8 +129,6 @@ public interface ReactNativeFeatureFlagsProvider { @DoNotStrip public fun enableVirtualViewRenderState(): Boolean - @DoNotStrip public fun enableVirtualViewWindowFocusDetection(): Boolean - @DoNotStrip public fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean @DoNotStrip public fun fixTextClippingAndroid15useBoundsForWidth(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java index c047578e968152..072c5c832c06c4 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java @@ -968,9 +968,6 @@ protected void onDetachedFromWindow() { if (mMaintainVisibleContentPositionHelper != null) { mMaintainVisibleContentPositionHelper.stop(); } - if (mVirtualViewContainerState != null) { - mVirtualViewContainerState.cleanup(); - } } @Override diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java index 3e1cbd603b3b39..d1b1ff17ba26b7 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java @@ -475,9 +475,6 @@ protected void onDetachedFromWindow() { if (mMaintainVisibleContentPositionHelper != null) { mMaintainVisibleContentPositionHelper.stop(); } - if (mVirtualViewContainerState != null) { - mVirtualViewContainerState.cleanup(); - } } @Override diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainer.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainer.kt index a234eda533da02..5513ca8eb926bb 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainer.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainer.kt @@ -9,7 +9,6 @@ package com.facebook.react.views.scroll import android.graphics.Rect import android.view.ViewGroup -import android.view.ViewTreeObserver import com.facebook.common.logging.FLog import com.facebook.react.common.build.ReactBuildConfig import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags @@ -54,15 +53,6 @@ internal abstract class VirtualViewContainerState { protected val visibleRect: Rect = Rect() protected val prerenderRect: Rect = Rect() protected val hysteresisRect: Rect = Rect() - protected val onWindowFocusChangeListener = - if (ReactNativeFeatureFlags.enableVirtualViewWindowFocusDetection()) { - ViewTreeObserver.OnWindowFocusChangeListener { - debugLog("onWindowFocusChanged") - updateModes() - } - } else { - null - } protected val scrollView: ViewGroup companion object { @@ -78,15 +68,6 @@ internal abstract class VirtualViewContainerState { constructor(scrollView: ViewGroup) { this.scrollView = scrollView - if (onWindowFocusChangeListener != null) { - scrollView.viewTreeObserver.addOnWindowFocusChangeListener(onWindowFocusChangeListener) - } - } - - fun cleanup() { - if (onWindowFocusChangeListener != null) { - scrollView.viewTreeObserver.removeOnWindowFocusChangeListener(onWindowFocusChangeListener) - } } open fun onChange(virtualView: VirtualView) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateClassic.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateClassic.kt index b616cca1c77a41..137d45f97761ab 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateClassic.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateClassic.kt @@ -51,15 +51,7 @@ internal class VirtualViewContainerStateClassic(scrollView: ViewGroup) : when { rectsOverlap(rect, visibleRect) -> { thresholdRect = visibleRect - if (onWindowFocusChangeListener != null) { - if (scrollView.hasWindowFocus()) { - mode = VirtualViewMode.Visible - } else { - mode = VirtualViewMode.Prerender - } - } else { - mode = VirtualViewMode.Visible - } + mode = VirtualViewMode.Visible } rectsOverlap(rect, prerenderRect) -> { mode = VirtualViewMode.Prerender diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateExperimental.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateExperimental.kt index 6476f5475632cc..f9d37d21679767 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateExperimental.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateExperimental.kt @@ -68,15 +68,7 @@ internal class VirtualViewContainerStateExperimental(scrollView: ViewGroup) : when { rectsOverlap(rect, visibleRect) -> { thresholdRect = visibleRect - if (onWindowFocusChangeListener != null) { - if (scrollView.hasWindowFocus()) { - mode = VirtualViewMode.Visible - } else { - mode = VirtualViewMode.Prerender - } - } else { - mode = VirtualViewMode.Visible - } + mode = VirtualViewMode.Visible } rectsOverlap(rect, prerenderRect) -> { mode = VirtualViewMode.Prerender diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp index 4580d4dfa2cb29..d025c57577f45a 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp @@ -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<<49089fe126ce14edaf58fbf8a942330f>> + * @generated SignedSource<> */ /** @@ -357,12 +357,6 @@ class ReactNativeFeatureFlagsJavaProvider return method(javaProvider_); } - bool enableVirtualViewWindowFocusDetection() override { - static const auto method = - getReactNativeFeatureFlagsProviderJavaClass()->getMethod("enableVirtualViewWindowFocusDetection"); - return method(javaProvider_); - } - bool fixMappingOfEventPrioritiesBetweenFabricAndReact() override { static const auto method = getReactNativeFeatureFlagsProviderJavaClass()->getMethod("fixMappingOfEventPrioritiesBetweenFabricAndReact"); @@ -818,11 +812,6 @@ bool JReactNativeFeatureFlagsCxxInterop::enableVirtualViewRenderState( return ReactNativeFeatureFlags::enableVirtualViewRenderState(); } -bool JReactNativeFeatureFlagsCxxInterop::enableVirtualViewWindowFocusDetection( - facebook::jni::alias_ref /*unused*/) { - return ReactNativeFeatureFlags::enableVirtualViewWindowFocusDetection(); -} - bool JReactNativeFeatureFlagsCxxInterop::fixMappingOfEventPrioritiesBetweenFabricAndReact( facebook::jni::alias_ref /*unused*/) { return ReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact(); @@ -1168,9 +1157,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() { makeNativeMethod( "enableVirtualViewRenderState", JReactNativeFeatureFlagsCxxInterop::enableVirtualViewRenderState), - makeNativeMethod( - "enableVirtualViewWindowFocusDetection", - JReactNativeFeatureFlagsCxxInterop::enableVirtualViewWindowFocusDetection), makeNativeMethod( "fixMappingOfEventPrioritiesBetweenFabricAndReact", JReactNativeFeatureFlagsCxxInterop::fixMappingOfEventPrioritiesBetweenFabricAndReact), diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h index 2755e6702ead5b..164d7eb15a71a1 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h @@ -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<<06dbf870e1f4fe12a401c8688e6474e3>> + * @generated SignedSource<<3b559c57fce966ad9b8ad538c2cc763b>> */ /** @@ -189,9 +189,6 @@ class JReactNativeFeatureFlagsCxxInterop static bool enableVirtualViewRenderState( facebook::jni::alias_ref); - static bool enableVirtualViewWindowFocusDetection( - facebook::jni::alias_ref); - static bool fixMappingOfEventPrioritiesBetweenFabricAndReact( facebook::jni::alias_ref); diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp index 591e0e58a0079f..387a100fd71dcb 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp @@ -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<> + * @generated SignedSource<<9f8cfb9b8569ccb430bc87f6df370cb9>> */ /** @@ -238,10 +238,6 @@ bool ReactNativeFeatureFlags::enableVirtualViewRenderState() { return getAccessor().enableVirtualViewRenderState(); } -bool ReactNativeFeatureFlags::enableVirtualViewWindowFocusDetection() { - return getAccessor().enableVirtualViewWindowFocusDetection(); -} - bool ReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact() { return getAccessor().fixMappingOfEventPrioritiesBetweenFabricAndReact(); } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h index f2da396bd77e9d..d65aaef5705964 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h @@ -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<<67d07e991ed29af6fbab27d8af527e0e>> + * @generated SignedSource<<66174931b6a02a4f5033789a46dcc11d>> */ /** @@ -304,11 +304,6 @@ class ReactNativeFeatureFlags { */ RN_EXPORT static bool enableVirtualViewRenderState(); - /** - * Enables window focus detection for prioritizing VirtualView events. - */ - RN_EXPORT static bool enableVirtualViewWindowFocusDetection(); - /** * Uses the default event priority instead of the discreet event priority by default when dispatching events from Fabric to React. */ diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp index 5e0f68c763e5b3..ea9e09f080f668 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp @@ -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<<654449733f4f3a6751af1c7543de9f05>> + * @generated SignedSource<<144b4b20ba3856fa19734de44db50377>> */ /** @@ -983,24 +983,6 @@ bool ReactNativeFeatureFlagsAccessor::enableVirtualViewRenderState() { return flagValue.value(); } -bool ReactNativeFeatureFlagsAccessor::enableVirtualViewWindowFocusDetection() { - auto flagValue = enableVirtualViewWindowFocusDetection_.load(); - - if (!flagValue.has_value()) { - // This block is not exclusive but it is not necessary. - // If multiple threads try to initialize the feature flag, we would only - // be accessing the provider multiple times but the end state of this - // instance and the returned flag value would be the same. - - markFlagAsAccessed(53, "enableVirtualViewWindowFocusDetection"); - - flagValue = currentProvider_->enableVirtualViewWindowFocusDetection(); - enableVirtualViewWindowFocusDetection_ = flagValue; - } - - return flagValue.value(); -} - bool ReactNativeFeatureFlagsAccessor::fixMappingOfEventPrioritiesBetweenFabricAndReact() { auto flagValue = fixMappingOfEventPrioritiesBetweenFabricAndReact_.load(); @@ -1010,7 +992,7 @@ bool ReactNativeFeatureFlagsAccessor::fixMappingOfEventPrioritiesBetweenFabricAn // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(54, "fixMappingOfEventPrioritiesBetweenFabricAndReact"); + markFlagAsAccessed(53, "fixMappingOfEventPrioritiesBetweenFabricAndReact"); flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact(); fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue; @@ -1028,7 +1010,7 @@ bool ReactNativeFeatureFlagsAccessor::fixTextClippingAndroid15useBoundsForWidth( // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(55, "fixTextClippingAndroid15useBoundsForWidth"); + markFlagAsAccessed(54, "fixTextClippingAndroid15useBoundsForWidth"); flagValue = currentProvider_->fixTextClippingAndroid15useBoundsForWidth(); fixTextClippingAndroid15useBoundsForWidth_ = flagValue; @@ -1046,7 +1028,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxAssertSingleHostState() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(56, "fuseboxAssertSingleHostState"); + markFlagAsAccessed(55, "fuseboxAssertSingleHostState"); flagValue = currentProvider_->fuseboxAssertSingleHostState(); fuseboxAssertSingleHostState_ = flagValue; @@ -1064,7 +1046,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxEnabledRelease() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(57, "fuseboxEnabledRelease"); + markFlagAsAccessed(56, "fuseboxEnabledRelease"); flagValue = currentProvider_->fuseboxEnabledRelease(); fuseboxEnabledRelease_ = flagValue; @@ -1082,7 +1064,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxNetworkInspectionEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(58, "fuseboxNetworkInspectionEnabled"); + markFlagAsAccessed(57, "fuseboxNetworkInspectionEnabled"); flagValue = currentProvider_->fuseboxNetworkInspectionEnabled(); fuseboxNetworkInspectionEnabled_ = flagValue; @@ -1100,7 +1082,7 @@ bool ReactNativeFeatureFlagsAccessor::hideOffscreenVirtualViewsOnIOS() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(59, "hideOffscreenVirtualViewsOnIOS"); + markFlagAsAccessed(58, "hideOffscreenVirtualViewsOnIOS"); flagValue = currentProvider_->hideOffscreenVirtualViewsOnIOS(); hideOffscreenVirtualViewsOnIOS_ = flagValue; @@ -1118,7 +1100,7 @@ bool ReactNativeFeatureFlagsAccessor::overrideBySynchronousMountPropsAtMountingA // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(60, "overrideBySynchronousMountPropsAtMountingAndroid"); + markFlagAsAccessed(59, "overrideBySynchronousMountPropsAtMountingAndroid"); flagValue = currentProvider_->overrideBySynchronousMountPropsAtMountingAndroid(); overrideBySynchronousMountPropsAtMountingAndroid_ = flagValue; @@ -1136,7 +1118,7 @@ bool ReactNativeFeatureFlagsAccessor::perfIssuesEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(61, "perfIssuesEnabled"); + markFlagAsAccessed(60, "perfIssuesEnabled"); flagValue = currentProvider_->perfIssuesEnabled(); perfIssuesEnabled_ = flagValue; @@ -1154,7 +1136,7 @@ bool ReactNativeFeatureFlagsAccessor::perfMonitorV2Enabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(62, "perfMonitorV2Enabled"); + markFlagAsAccessed(61, "perfMonitorV2Enabled"); flagValue = currentProvider_->perfMonitorV2Enabled(); perfMonitorV2Enabled_ = flagValue; @@ -1172,7 +1154,7 @@ double ReactNativeFeatureFlagsAccessor::preparedTextCacheSize() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(63, "preparedTextCacheSize"); + markFlagAsAccessed(62, "preparedTextCacheSize"); flagValue = currentProvider_->preparedTextCacheSize(); preparedTextCacheSize_ = flagValue; @@ -1190,7 +1172,7 @@ bool ReactNativeFeatureFlagsAccessor::preventShadowTreeCommitExhaustion() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(64, "preventShadowTreeCommitExhaustion"); + markFlagAsAccessed(63, "preventShadowTreeCommitExhaustion"); flagValue = currentProvider_->preventShadowTreeCommitExhaustion(); preventShadowTreeCommitExhaustion_ = flagValue; @@ -1208,7 +1190,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldPressibilityUseW3CPointerEventsForHo // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(65, "shouldPressibilityUseW3CPointerEventsForHover"); + markFlagAsAccessed(64, "shouldPressibilityUseW3CPointerEventsForHover"); flagValue = currentProvider_->shouldPressibilityUseW3CPointerEventsForHover(); shouldPressibilityUseW3CPointerEventsForHover_ = flagValue; @@ -1226,7 +1208,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldResetClickableWhenRecyclingView() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(66, "shouldResetClickableWhenRecyclingView"); + markFlagAsAccessed(65, "shouldResetClickableWhenRecyclingView"); flagValue = currentProvider_->shouldResetClickableWhenRecyclingView(); shouldResetClickableWhenRecyclingView_ = flagValue; @@ -1244,7 +1226,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldResetOnClickListenerWhenRecyclingVie // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(67, "shouldResetOnClickListenerWhenRecyclingView"); + markFlagAsAccessed(66, "shouldResetOnClickListenerWhenRecyclingView"); flagValue = currentProvider_->shouldResetOnClickListenerWhenRecyclingView(); shouldResetOnClickListenerWhenRecyclingView_ = flagValue; @@ -1262,7 +1244,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldSetEnabledBasedOnAccessibilityState( // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(68, "shouldSetEnabledBasedOnAccessibilityState"); + markFlagAsAccessed(67, "shouldSetEnabledBasedOnAccessibilityState"); flagValue = currentProvider_->shouldSetEnabledBasedOnAccessibilityState(); shouldSetEnabledBasedOnAccessibilityState_ = flagValue; @@ -1280,7 +1262,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldSetIsClickableByDefault() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(69, "shouldSetIsClickableByDefault"); + markFlagAsAccessed(68, "shouldSetIsClickableByDefault"); flagValue = currentProvider_->shouldSetIsClickableByDefault(); shouldSetIsClickableByDefault_ = flagValue; @@ -1298,7 +1280,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldTriggerResponderTransferOnScrollAndr // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(70, "shouldTriggerResponderTransferOnScrollAndroid"); + markFlagAsAccessed(69, "shouldTriggerResponderTransferOnScrollAndroid"); flagValue = currentProvider_->shouldTriggerResponderTransferOnScrollAndroid(); shouldTriggerResponderTransferOnScrollAndroid_ = flagValue; @@ -1316,7 +1298,7 @@ bool ReactNativeFeatureFlagsAccessor::skipActivityIdentityAssertionOnHostPause() // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(71, "skipActivityIdentityAssertionOnHostPause"); + markFlagAsAccessed(70, "skipActivityIdentityAssertionOnHostPause"); flagValue = currentProvider_->skipActivityIdentityAssertionOnHostPause(); skipActivityIdentityAssertionOnHostPause_ = flagValue; @@ -1334,7 +1316,7 @@ bool ReactNativeFeatureFlagsAccessor::traceTurboModulePromiseRejectionsOnAndroid // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(72, "traceTurboModulePromiseRejectionsOnAndroid"); + markFlagAsAccessed(71, "traceTurboModulePromiseRejectionsOnAndroid"); flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid(); traceTurboModulePromiseRejectionsOnAndroid_ = flagValue; @@ -1352,7 +1334,7 @@ bool ReactNativeFeatureFlagsAccessor::updateRuntimeShadowNodeReferencesOnCommit( // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(73, "updateRuntimeShadowNodeReferencesOnCommit"); + markFlagAsAccessed(72, "updateRuntimeShadowNodeReferencesOnCommit"); flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommit(); updateRuntimeShadowNodeReferencesOnCommit_ = flagValue; @@ -1370,7 +1352,7 @@ bool ReactNativeFeatureFlagsAccessor::useAlwaysAvailableJSErrorHandling() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(74, "useAlwaysAvailableJSErrorHandling"); + markFlagAsAccessed(73, "useAlwaysAvailableJSErrorHandling"); flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling(); useAlwaysAvailableJSErrorHandling_ = flagValue; @@ -1388,7 +1370,7 @@ bool ReactNativeFeatureFlagsAccessor::useFabricInterop() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(75, "useFabricInterop"); + markFlagAsAccessed(74, "useFabricInterop"); flagValue = currentProvider_->useFabricInterop(); useFabricInterop_ = flagValue; @@ -1406,7 +1388,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeViewConfigsInBridgelessMode() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(76, "useNativeViewConfigsInBridgelessMode"); + markFlagAsAccessed(75, "useNativeViewConfigsInBridgelessMode"); flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode(); useNativeViewConfigsInBridgelessMode_ = flagValue; @@ -1424,7 +1406,7 @@ bool ReactNativeFeatureFlagsAccessor::useShadowNodeStateOnClone() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(77, "useShadowNodeStateOnClone"); + markFlagAsAccessed(76, "useShadowNodeStateOnClone"); flagValue = currentProvider_->useShadowNodeStateOnClone(); useShadowNodeStateOnClone_ = flagValue; @@ -1442,7 +1424,7 @@ bool ReactNativeFeatureFlagsAccessor::useSharedAnimatedBackend() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(78, "useSharedAnimatedBackend"); + markFlagAsAccessed(77, "useSharedAnimatedBackend"); flagValue = currentProvider_->useSharedAnimatedBackend(); useSharedAnimatedBackend_ = flagValue; @@ -1460,7 +1442,7 @@ bool ReactNativeFeatureFlagsAccessor::useTraitHiddenOnAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(79, "useTraitHiddenOnAndroid"); + markFlagAsAccessed(78, "useTraitHiddenOnAndroid"); flagValue = currentProvider_->useTraitHiddenOnAndroid(); useTraitHiddenOnAndroid_ = flagValue; @@ -1478,7 +1460,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(80, "useTurboModuleInterop"); + markFlagAsAccessed(79, "useTurboModuleInterop"); flagValue = currentProvider_->useTurboModuleInterop(); useTurboModuleInterop_ = flagValue; @@ -1496,7 +1478,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModules() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(81, "useTurboModules"); + markFlagAsAccessed(80, "useTurboModules"); flagValue = currentProvider_->useTurboModules(); useTurboModules_ = flagValue; @@ -1514,7 +1496,7 @@ double ReactNativeFeatureFlagsAccessor::viewCullingOutsetRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(82, "viewCullingOutsetRatio"); + markFlagAsAccessed(81, "viewCullingOutsetRatio"); flagValue = currentProvider_->viewCullingOutsetRatio(); viewCullingOutsetRatio_ = flagValue; @@ -1532,7 +1514,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewHysteresisRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(83, "virtualViewHysteresisRatio"); + markFlagAsAccessed(82, "virtualViewHysteresisRatio"); flagValue = currentProvider_->virtualViewHysteresisRatio(); virtualViewHysteresisRatio_ = flagValue; @@ -1550,7 +1532,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewPrerenderRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(84, "virtualViewPrerenderRatio"); + markFlagAsAccessed(83, "virtualViewPrerenderRatio"); flagValue = currentProvider_->virtualViewPrerenderRatio(); virtualViewPrerenderRatio_ = flagValue; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h index f24fe5898e8aef..f01501eb40e84f 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h @@ -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<> + * @generated SignedSource<> */ /** @@ -85,7 +85,6 @@ class ReactNativeFeatureFlagsAccessor { bool enableVirtualViewContainerStateExperimental(); bool enableVirtualViewDebugFeatures(); bool enableVirtualViewRenderState(); - bool enableVirtualViewWindowFocusDetection(); bool fixMappingOfEventPrioritiesBetweenFabricAndReact(); bool fixTextClippingAndroid15useBoundsForWidth(); bool fuseboxAssertSingleHostState(); @@ -128,7 +127,7 @@ class ReactNativeFeatureFlagsAccessor { std::unique_ptr currentProvider_; bool wasOverridden_; - std::array, 85> accessedFeatureFlags_; + std::array, 84> accessedFeatureFlags_; std::atomic> commonTestFlag_; std::atomic> cdpInteractionMetricsEnabled_; @@ -183,7 +182,6 @@ class ReactNativeFeatureFlagsAccessor { std::atomic> enableVirtualViewContainerStateExperimental_; std::atomic> enableVirtualViewDebugFeatures_; std::atomic> enableVirtualViewRenderState_; - std::atomic> enableVirtualViewWindowFocusDetection_; std::atomic> fixMappingOfEventPrioritiesBetweenFabricAndReact_; std::atomic> fixTextClippingAndroid15useBoundsForWidth_; std::atomic> fuseboxAssertSingleHostState_; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h index d98ca7e14a476d..828610e3a17b07 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h @@ -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<<9c0cc61c544c8ef3d5390e2d1c2fbb1f>> + * @generated SignedSource<> */ /** @@ -239,10 +239,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider { return true; } - bool enableVirtualViewWindowFocusDetection() override { - return false; - } - bool fixMappingOfEventPrioritiesBetweenFabricAndReact() override { return false; } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h index 2dd5cc4e66ba43..829c0e48934b35 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h @@ -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<<99f5af3846cb1d9a19e9b76ed5cc6435>> + * @generated SignedSource<<69f66d45b89b38d134a6295b344d6c01>> */ /** @@ -522,15 +522,6 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef return ReactNativeFeatureFlagsDefaults::enableVirtualViewRenderState(); } - bool enableVirtualViewWindowFocusDetection() override { - auto value = values_["enableVirtualViewWindowFocusDetection"]; - if (!value.isNull()) { - return value.getBool(); - } - - return ReactNativeFeatureFlagsDefaults::enableVirtualViewWindowFocusDetection(); - } - bool fixMappingOfEventPrioritiesBetweenFabricAndReact() override { auto value = values_["fixMappingOfEventPrioritiesBetweenFabricAndReact"]; if (!value.isNull()) { diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h index 4a7a939eb5b8e4..a58ca1a75f29c0 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h @@ -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<<77d663a6ae154cb6df13dbf70991a155>> + * @generated SignedSource<<6be39541927fc411650706cafbffa704>> */ /** @@ -78,7 +78,6 @@ class ReactNativeFeatureFlagsProvider { virtual bool enableVirtualViewContainerStateExperimental() = 0; virtual bool enableVirtualViewDebugFeatures() = 0; virtual bool enableVirtualViewRenderState() = 0; - virtual bool enableVirtualViewWindowFocusDetection() = 0; virtual bool fixMappingOfEventPrioritiesBetweenFabricAndReact() = 0; virtual bool fixTextClippingAndroid15useBoundsForWidth() = 0; virtual bool fuseboxAssertSingleHostState() = 0; diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp index e0029df7f07ef3..7666195eca3aa9 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp @@ -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<> + * @generated SignedSource<> */ /** @@ -309,11 +309,6 @@ bool NativeReactNativeFeatureFlags::enableVirtualViewRenderState( return ReactNativeFeatureFlags::enableVirtualViewRenderState(); } -bool NativeReactNativeFeatureFlags::enableVirtualViewWindowFocusDetection( - jsi::Runtime& /*runtime*/) { - return ReactNativeFeatureFlags::enableVirtualViewWindowFocusDetection(); -} - bool NativeReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact( jsi::Runtime& /*runtime*/) { return ReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact(); diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h index 6c0d84a9fa2691..d79c781da80d7f 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h @@ -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<<5e937d5698eea953169bf8bd7a36b9ec>> + * @generated SignedSource<<69e867b1097632a24c71466d0baf8765>> */ /** @@ -142,8 +142,6 @@ class NativeReactNativeFeatureFlags bool enableVirtualViewRenderState(jsi::Runtime& runtime); - bool enableVirtualViewWindowFocusDetection(jsi::Runtime& runtime); - bool fixMappingOfEventPrioritiesBetweenFabricAndReact(jsi::Runtime& runtime); bool fixTextClippingAndroid15useBoundsForWidth(jsi::Runtime& runtime); diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index fa2b4ce33b250e..1c34986dcb4fee 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -615,17 +615,6 @@ const definitions: FeatureFlagDefinitions = { }, ossReleaseStage: 'none', }, - enableVirtualViewWindowFocusDetection: { - defaultValue: false, - metadata: { - dateAdded: '2025-06-24', - description: - 'Enables window focus detection for prioritizing VirtualView events.', - expectedReleaseValue: true, - purpose: 'experimentation', - }, - ossReleaseStage: 'none', - }, fixMappingOfEventPrioritiesBetweenFabricAndReact: { defaultValue: false, metadata: { diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index b10e4ddcb42072..5fa2728a217040 100644 --- a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js @@ -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<> + * @generated SignedSource<> * @flow strict * @noformat */ @@ -102,7 +102,6 @@ export type ReactNativeFeatureFlags = $ReadOnly<{ enableVirtualViewContainerStateExperimental: Getter, enableVirtualViewDebugFeatures: Getter, enableVirtualViewRenderState: Getter, - enableVirtualViewWindowFocusDetection: Getter, fixMappingOfEventPrioritiesBetweenFabricAndReact: Getter, fixTextClippingAndroid15useBoundsForWidth: Getter, fuseboxAssertSingleHostState: Getter, @@ -422,10 +421,6 @@ export const enableVirtualViewDebugFeatures: Getter = createNativeFlagG * Enables reading render state when dispatching VirtualView events. */ export const enableVirtualViewRenderState: Getter = createNativeFlagGetter('enableVirtualViewRenderState', true); -/** - * Enables window focus detection for prioritizing VirtualView events. - */ -export const enableVirtualViewWindowFocusDetection: Getter = createNativeFlagGetter('enableVirtualViewWindowFocusDetection', false); /** * Uses the default event priority instead of the discreet event priority by default when dispatching events from Fabric to React. */ diff --git a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js index db1a53b3f5c366..dd2a016f24ad6f 100644 --- a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js @@ -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<> + * @generated SignedSource<<85fa3f5ab5a3ff245aa0d89a4599fa44>> * @flow strict * @noformat */ @@ -78,7 +78,6 @@ export interface Spec extends TurboModule { +enableVirtualViewContainerStateExperimental?: () => boolean; +enableVirtualViewDebugFeatures?: () => boolean; +enableVirtualViewRenderState?: () => boolean; - +enableVirtualViewWindowFocusDetection?: () => boolean; +fixMappingOfEventPrioritiesBetweenFabricAndReact?: () => boolean; +fixTextClippingAndroid15useBoundsForWidth?: () => boolean; +fuseboxAssertSingleHostState?: () => boolean; From 50c477bb3bf9cfeb6e775eb8ebea247ca6a2e59c Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Thu, 8 Jan 2026 11:12:37 -0800 Subject: [PATCH 3/5] Fling: Cleanup `enableVirtualViewRenderState` Summary: Deletes the `enableVirtualViewRenderState` feature flag and applies the new behavior everywhere. Changelog: [Internal] Differential Revision: D90334878 --- .../RCTVirtualViewComponentView.mm | 39 ++++----- .../featureflags/ReactNativeFeatureFlags.kt | 8 +- .../ReactNativeFeatureFlagsCxxAccessor.kt | 12 +-- .../ReactNativeFeatureFlagsCxxInterop.kt | 4 +- .../ReactNativeFeatureFlagsDefaults.kt | 4 +- .../ReactNativeFeatureFlagsLocalAccessor.kt | 13 +-- .../ReactNativeFeatureFlagsProvider.kt | 4 +- .../views/virtual/view/ReactVirtualView.kt | 24 ++---- .../virtual/view/ReactVirtualViewManager.kt | 16 ++-- .../JReactNativeFeatureFlagsCxxInterop.cpp | 16 +--- .../JReactNativeFeatureFlagsCxxInterop.h | 5 +- .../featureflags/ReactNativeFeatureFlags.cpp | 6 +- .../featureflags/ReactNativeFeatureFlags.h | 7 +- .../ReactNativeFeatureFlagsAccessor.cpp | 82 ++++++++----------- .../ReactNativeFeatureFlagsAccessor.h | 6 +- .../ReactNativeFeatureFlagsDefaults.h | 6 +- .../ReactNativeFeatureFlagsDynamicProvider.h | 11 +-- .../ReactNativeFeatureFlagsProvider.h | 3 +- .../NativeReactNativeFeatureFlags.cpp | 7 +- .../NativeReactNativeFeatureFlags.h | 4 +- .../ReactNativeFeatureFlags.config.js | 11 --- .../featureflags/ReactNativeFeatureFlags.js | 7 +- .../specs/NativeReactNativeFeatureFlags.js | 3 +- 23 files changed, 82 insertions(+), 216 deletions(-) diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.mm index c76ee87bd3b88b..f2383df8613f20 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.mm @@ -70,19 +70,16 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared & } } - // If disabled, `_renderState` will always be `RCTVirtualViewRenderStateUnknown`. - if (ReactNativeFeatureFlags::enableVirtualViewRenderState()) { - switch (newViewProps.renderState) { - case 1: - _renderState = RCTVirtualViewRenderStateRendered; - break; - case 2: - _renderState = RCTVirtualViewRenderStateNone; - break; - default: - _renderState = RCTVirtualViewRenderStateUnknown; - break; - } + switch (newViewProps.renderState) { + case 1: + _renderState = RCTVirtualViewRenderStateRendered; + break; + case 2: + _renderState = RCTVirtualViewRenderStateNone; + break; + default: + _renderState = RCTVirtualViewRenderStateUnknown; + break; } const auto &newBaseViewProps = static_cast(*props); @@ -196,17 +193,13 @@ - (void)onModeChange:(RCTVirtualViewMode)newMode targetRect:(CGRect)targetRect t switch (newMode) { case RCTVirtualViewModeVisible: - if (_renderState == RCTVirtualViewRenderStateUnknown) { - // Feature flag is disabled, so use the former logic. + // If the previous mode was hidden, emit a mode change even if `renderState` is rendered, + // because the hidden mode change is still pending and will eventually be committed. Only + // skip emitting a mode change if the previous mode was prerender and the result of that + // event has already been committed. + if (!oldMode.has_value() || oldMode == RCTVirtualViewModeHidden || + _renderState != RCTVirtualViewRenderStateRendered) { [self _dispatchSyncModeChange:event]; - } else { - // If the previous mode was prerender and the result of dispatching that event was committed, we do not need - // to dispatch an event for visible. - const auto wasPrerenderCommitted = oldMode.has_value() && oldMode == RCTVirtualViewModePrerender && - _renderState == RCTVirtualViewRenderStateRendered; - if (!wasPrerenderCommitted) { - [self _dispatchSyncModeChange:event]; - } } break; case RCTVirtualViewModePrerender: diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt index 6d8ac4fe9aea41..6a6fa2ece329b0 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt @@ -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<<91ad23aa529522a802b8d03198d7ccb9>> + * @generated SignedSource<> */ /** @@ -342,12 +342,6 @@ public object ReactNativeFeatureFlags { @JvmStatic public fun enableVirtualViewDebugFeatures(): Boolean = accessor.enableVirtualViewDebugFeatures() - /** - * Enables reading render state when dispatching VirtualView events. - */ - @JvmStatic - public fun enableVirtualViewRenderState(): Boolean = accessor.enableVirtualViewRenderState() - /** * Uses the default event priority instead of the discreet event priority by default when dispatching events from Fabric to React. */ diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt index 59f8fc1039c371..95c0dab88062a2 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt @@ -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<<6188f6b73c835b514bd13de3b7a3f55c>> + * @generated SignedSource<> */ /** @@ -72,7 +72,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces private var enableViewRecyclingForViewCache: Boolean? = null private var enableVirtualViewContainerStateExperimentalCache: Boolean? = null private var enableVirtualViewDebugFeaturesCache: Boolean? = null - private var enableVirtualViewRenderStateCache: Boolean? = null private var fixMappingOfEventPrioritiesBetweenFabricAndReactCache: Boolean? = null private var fixTextClippingAndroid15useBoundsForWidthCache: Boolean? = null private var fuseboxAssertSingleHostStateCache: Boolean? = null @@ -573,15 +572,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces return cached } - override fun enableVirtualViewRenderState(): Boolean { - var cached = enableVirtualViewRenderStateCache - if (cached == null) { - cached = ReactNativeFeatureFlagsCxxInterop.enableVirtualViewRenderState() - enableVirtualViewRenderStateCache = cached - } - return cached - } - override fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean { var cached = fixMappingOfEventPrioritiesBetweenFabricAndReactCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt index bf6bf0d9acf9be..808ecfcf6fc4fa 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt @@ -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<<2528d994ff2ed6ada21f7ff67cdfcd0a>> + * @generated SignedSource<<0ae5a806950b4bfaaaccde774114ab4e>> */ /** @@ -132,8 +132,6 @@ public object ReactNativeFeatureFlagsCxxInterop { @DoNotStrip @JvmStatic public external fun enableVirtualViewDebugFeatures(): Boolean - @DoNotStrip @JvmStatic public external fun enableVirtualViewRenderState(): Boolean - @DoNotStrip @JvmStatic public external fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean @DoNotStrip @JvmStatic public external fun fixTextClippingAndroid15useBoundsForWidth(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt index 9cba676f29657e..e7f86df1fe4b6e 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt @@ -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<> + * @generated SignedSource<<532504ff7b4a7f4c45649fc59ecade3a>> */ /** @@ -127,8 +127,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi override fun enableVirtualViewDebugFeatures(): Boolean = false - override fun enableVirtualViewRenderState(): Boolean = true - override fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean = false override fun fixTextClippingAndroid15useBoundsForWidth(): Boolean = false diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt index 4aef0a07e8c6c6..cb5927042a1de2 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt @@ -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<> + * @generated SignedSource<> */ /** @@ -76,7 +76,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc private var enableViewRecyclingForViewCache: Boolean? = null private var enableVirtualViewContainerStateExperimentalCache: Boolean? = null private var enableVirtualViewDebugFeaturesCache: Boolean? = null - private var enableVirtualViewRenderStateCache: Boolean? = null private var fixMappingOfEventPrioritiesBetweenFabricAndReactCache: Boolean? = null private var fixTextClippingAndroid15useBoundsForWidthCache: Boolean? = null private var fuseboxAssertSingleHostStateCache: Boolean? = null @@ -629,16 +628,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc return cached } - override fun enableVirtualViewRenderState(): Boolean { - var cached = enableVirtualViewRenderStateCache - if (cached == null) { - cached = currentProvider.enableVirtualViewRenderState() - accessedFeatureFlags.add("enableVirtualViewRenderState") - enableVirtualViewRenderStateCache = cached - } - return cached - } - override fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean { var cached = fixMappingOfEventPrioritiesBetweenFabricAndReactCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt index e6f778e74922b7..7c66fe1b2b7bd7 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt @@ -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<> + * @generated SignedSource<<351ae3b05fae543b52eaa7bcf7f5f479>> */ /** @@ -127,8 +127,6 @@ public interface ReactNativeFeatureFlagsProvider { @DoNotStrip public fun enableVirtualViewDebugFeatures(): Boolean - @DoNotStrip public fun enableVirtualViewRenderState(): Boolean - @DoNotStrip public fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean @DoNotStrip public fun fixTextClippingAndroid15useBoundsForWidth(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualView.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualView.kt index 32737d6dd77e00..ca4e12b7570436 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualView.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualView.kt @@ -155,27 +155,21 @@ public class ReactVirtualView(context: Context) : when (newMode) { VirtualViewMode.Visible -> { - if (renderState == VirtualViewRenderState.Unknown) { - // Feature flag is disabled, so use the former logic. + // If the previous mode was hidden, emit a mode change even if `renderState` is rendered, + // because the hidden mode change is still pending and will eventually be committed. Only + // skip emitting a mode change if the previous mode was prerender and the result of that + // event has already been committed. + if ( + oldMode == null || + oldMode == VirtualViewMode.Hidden || + renderState != VirtualViewRenderState.Rendered + ) { modeChangeEmitter?.emitModeChange( VirtualViewMode.Visible, containerRelativeRect, thresholdRect, synchronous = true, ) - } else { - // If the previous mode was prerender and the result of dispatching that event was - // committed, we do not need to dispatch an event for visible. - val wasPrerenderCommitted = - oldMode == VirtualViewMode.Prerender && renderState == VirtualViewRenderState.Rendered - if (!wasPrerenderCommitted) { - modeChangeEmitter?.emitModeChange( - VirtualViewMode.Visible, - containerRelativeRect, - thresholdRect, - synchronous = true, - ) - } } } VirtualViewMode.Prerender -> { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualViewManager.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualViewManager.kt index b5ca31bf6ccf8b..fe8a23e312d511 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualViewManager.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualViewManager.kt @@ -9,7 +9,6 @@ package com.facebook.react.views.virtual.view import android.graphics.Rect import androidx.annotation.VisibleForTesting -import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags import com.facebook.react.module.annotations.ReactModule import com.facebook.react.uimanager.ThemedReactContext import com.facebook.react.uimanager.UIManagerHelper @@ -46,15 +45,12 @@ public class ReactVirtualViewManager : @ReactProp(name = "renderState") override fun setRenderState(view: ReactVirtualView, value: Int) { - // If disabled, `renderState` will always be `VirtualViewRenderState.Unknown`. - if (ReactNativeFeatureFlags.enableVirtualViewRenderState()) { - view.renderState = - when (value) { - 1 -> VirtualViewRenderState.Rendered - 2 -> VirtualViewRenderState.None - else -> VirtualViewRenderState.Unknown - } - } + view.renderState = + when (value) { + 1 -> VirtualViewRenderState.Rendered + 2 -> VirtualViewRenderState.None + else -> VirtualViewRenderState.Unknown + } } override fun setNativeId(view: ReactVirtualView, nativeId: String?) { diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp index d025c57577f45a..d8a5e4c30c413a 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp @@ -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<> + * @generated SignedSource<<9841e9badfe84669fde89f35467d4c13>> */ /** @@ -351,12 +351,6 @@ class ReactNativeFeatureFlagsJavaProvider return method(javaProvider_); } - bool enableVirtualViewRenderState() override { - static const auto method = - getReactNativeFeatureFlagsProviderJavaClass()->getMethod("enableVirtualViewRenderState"); - return method(javaProvider_); - } - bool fixMappingOfEventPrioritiesBetweenFabricAndReact() override { static const auto method = getReactNativeFeatureFlagsProviderJavaClass()->getMethod("fixMappingOfEventPrioritiesBetweenFabricAndReact"); @@ -807,11 +801,6 @@ bool JReactNativeFeatureFlagsCxxInterop::enableVirtualViewDebugFeatures( return ReactNativeFeatureFlags::enableVirtualViewDebugFeatures(); } -bool JReactNativeFeatureFlagsCxxInterop::enableVirtualViewRenderState( - facebook::jni::alias_ref /*unused*/) { - return ReactNativeFeatureFlags::enableVirtualViewRenderState(); -} - bool JReactNativeFeatureFlagsCxxInterop::fixMappingOfEventPrioritiesBetweenFabricAndReact( facebook::jni::alias_ref /*unused*/) { return ReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact(); @@ -1154,9 +1143,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() { makeNativeMethod( "enableVirtualViewDebugFeatures", JReactNativeFeatureFlagsCxxInterop::enableVirtualViewDebugFeatures), - makeNativeMethod( - "enableVirtualViewRenderState", - JReactNativeFeatureFlagsCxxInterop::enableVirtualViewRenderState), makeNativeMethod( "fixMappingOfEventPrioritiesBetweenFabricAndReact", JReactNativeFeatureFlagsCxxInterop::fixMappingOfEventPrioritiesBetweenFabricAndReact), diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h index 164d7eb15a71a1..012361add31d25 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h @@ -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<<3b559c57fce966ad9b8ad538c2cc763b>> + * @generated SignedSource<<65067f69d2477016b20b52596e22085d>> */ /** @@ -186,9 +186,6 @@ class JReactNativeFeatureFlagsCxxInterop static bool enableVirtualViewDebugFeatures( facebook::jni::alias_ref); - static bool enableVirtualViewRenderState( - facebook::jni::alias_ref); - static bool fixMappingOfEventPrioritiesBetweenFabricAndReact( facebook::jni::alias_ref); diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp index 387a100fd71dcb..f8c3a3cb5fd379 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp @@ -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<<9f8cfb9b8569ccb430bc87f6df370cb9>> + * @generated SignedSource<<4c09707a70b2e3ced763abf51b230d3c>> */ /** @@ -234,10 +234,6 @@ bool ReactNativeFeatureFlags::enableVirtualViewDebugFeatures() { return getAccessor().enableVirtualViewDebugFeatures(); } -bool ReactNativeFeatureFlags::enableVirtualViewRenderState() { - return getAccessor().enableVirtualViewRenderState(); -} - bool ReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact() { return getAccessor().fixMappingOfEventPrioritiesBetweenFabricAndReact(); } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h index d65aaef5705964..f3ee3082750c64 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h @@ -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<<66174931b6a02a4f5033789a46dcc11d>> + * @generated SignedSource<> */ /** @@ -299,11 +299,6 @@ class ReactNativeFeatureFlags { */ RN_EXPORT static bool enableVirtualViewDebugFeatures(); - /** - * Enables reading render state when dispatching VirtualView events. - */ - RN_EXPORT static bool enableVirtualViewRenderState(); - /** * Uses the default event priority instead of the discreet event priority by default when dispatching events from Fabric to React. */ diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp index ea9e09f080f668..21f2f2c558d763 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp @@ -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<<144b4b20ba3856fa19734de44db50377>> + * @generated SignedSource<<828d9d1aafc49a5308ecc1181648cd86>> */ /** @@ -965,24 +965,6 @@ bool ReactNativeFeatureFlagsAccessor::enableVirtualViewDebugFeatures() { return flagValue.value(); } -bool ReactNativeFeatureFlagsAccessor::enableVirtualViewRenderState() { - auto flagValue = enableVirtualViewRenderState_.load(); - - if (!flagValue.has_value()) { - // This block is not exclusive but it is not necessary. - // If multiple threads try to initialize the feature flag, we would only - // be accessing the provider multiple times but the end state of this - // instance and the returned flag value would be the same. - - markFlagAsAccessed(52, "enableVirtualViewRenderState"); - - flagValue = currentProvider_->enableVirtualViewRenderState(); - enableVirtualViewRenderState_ = flagValue; - } - - return flagValue.value(); -} - bool ReactNativeFeatureFlagsAccessor::fixMappingOfEventPrioritiesBetweenFabricAndReact() { auto flagValue = fixMappingOfEventPrioritiesBetweenFabricAndReact_.load(); @@ -992,7 +974,7 @@ bool ReactNativeFeatureFlagsAccessor::fixMappingOfEventPrioritiesBetweenFabricAn // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(53, "fixMappingOfEventPrioritiesBetweenFabricAndReact"); + markFlagAsAccessed(52, "fixMappingOfEventPrioritiesBetweenFabricAndReact"); flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact(); fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue; @@ -1010,7 +992,7 @@ bool ReactNativeFeatureFlagsAccessor::fixTextClippingAndroid15useBoundsForWidth( // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(54, "fixTextClippingAndroid15useBoundsForWidth"); + markFlagAsAccessed(53, "fixTextClippingAndroid15useBoundsForWidth"); flagValue = currentProvider_->fixTextClippingAndroid15useBoundsForWidth(); fixTextClippingAndroid15useBoundsForWidth_ = flagValue; @@ -1028,7 +1010,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxAssertSingleHostState() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(55, "fuseboxAssertSingleHostState"); + markFlagAsAccessed(54, "fuseboxAssertSingleHostState"); flagValue = currentProvider_->fuseboxAssertSingleHostState(); fuseboxAssertSingleHostState_ = flagValue; @@ -1046,7 +1028,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxEnabledRelease() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(56, "fuseboxEnabledRelease"); + markFlagAsAccessed(55, "fuseboxEnabledRelease"); flagValue = currentProvider_->fuseboxEnabledRelease(); fuseboxEnabledRelease_ = flagValue; @@ -1064,7 +1046,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxNetworkInspectionEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(57, "fuseboxNetworkInspectionEnabled"); + markFlagAsAccessed(56, "fuseboxNetworkInspectionEnabled"); flagValue = currentProvider_->fuseboxNetworkInspectionEnabled(); fuseboxNetworkInspectionEnabled_ = flagValue; @@ -1082,7 +1064,7 @@ bool ReactNativeFeatureFlagsAccessor::hideOffscreenVirtualViewsOnIOS() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(58, "hideOffscreenVirtualViewsOnIOS"); + markFlagAsAccessed(57, "hideOffscreenVirtualViewsOnIOS"); flagValue = currentProvider_->hideOffscreenVirtualViewsOnIOS(); hideOffscreenVirtualViewsOnIOS_ = flagValue; @@ -1100,7 +1082,7 @@ bool ReactNativeFeatureFlagsAccessor::overrideBySynchronousMountPropsAtMountingA // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(59, "overrideBySynchronousMountPropsAtMountingAndroid"); + markFlagAsAccessed(58, "overrideBySynchronousMountPropsAtMountingAndroid"); flagValue = currentProvider_->overrideBySynchronousMountPropsAtMountingAndroid(); overrideBySynchronousMountPropsAtMountingAndroid_ = flagValue; @@ -1118,7 +1100,7 @@ bool ReactNativeFeatureFlagsAccessor::perfIssuesEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(60, "perfIssuesEnabled"); + markFlagAsAccessed(59, "perfIssuesEnabled"); flagValue = currentProvider_->perfIssuesEnabled(); perfIssuesEnabled_ = flagValue; @@ -1136,7 +1118,7 @@ bool ReactNativeFeatureFlagsAccessor::perfMonitorV2Enabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(61, "perfMonitorV2Enabled"); + markFlagAsAccessed(60, "perfMonitorV2Enabled"); flagValue = currentProvider_->perfMonitorV2Enabled(); perfMonitorV2Enabled_ = flagValue; @@ -1154,7 +1136,7 @@ double ReactNativeFeatureFlagsAccessor::preparedTextCacheSize() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(62, "preparedTextCacheSize"); + markFlagAsAccessed(61, "preparedTextCacheSize"); flagValue = currentProvider_->preparedTextCacheSize(); preparedTextCacheSize_ = flagValue; @@ -1172,7 +1154,7 @@ bool ReactNativeFeatureFlagsAccessor::preventShadowTreeCommitExhaustion() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(63, "preventShadowTreeCommitExhaustion"); + markFlagAsAccessed(62, "preventShadowTreeCommitExhaustion"); flagValue = currentProvider_->preventShadowTreeCommitExhaustion(); preventShadowTreeCommitExhaustion_ = flagValue; @@ -1190,7 +1172,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldPressibilityUseW3CPointerEventsForHo // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(64, "shouldPressibilityUseW3CPointerEventsForHover"); + markFlagAsAccessed(63, "shouldPressibilityUseW3CPointerEventsForHover"); flagValue = currentProvider_->shouldPressibilityUseW3CPointerEventsForHover(); shouldPressibilityUseW3CPointerEventsForHover_ = flagValue; @@ -1208,7 +1190,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldResetClickableWhenRecyclingView() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(65, "shouldResetClickableWhenRecyclingView"); + markFlagAsAccessed(64, "shouldResetClickableWhenRecyclingView"); flagValue = currentProvider_->shouldResetClickableWhenRecyclingView(); shouldResetClickableWhenRecyclingView_ = flagValue; @@ -1226,7 +1208,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldResetOnClickListenerWhenRecyclingVie // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(66, "shouldResetOnClickListenerWhenRecyclingView"); + markFlagAsAccessed(65, "shouldResetOnClickListenerWhenRecyclingView"); flagValue = currentProvider_->shouldResetOnClickListenerWhenRecyclingView(); shouldResetOnClickListenerWhenRecyclingView_ = flagValue; @@ -1244,7 +1226,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldSetEnabledBasedOnAccessibilityState( // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(67, "shouldSetEnabledBasedOnAccessibilityState"); + markFlagAsAccessed(66, "shouldSetEnabledBasedOnAccessibilityState"); flagValue = currentProvider_->shouldSetEnabledBasedOnAccessibilityState(); shouldSetEnabledBasedOnAccessibilityState_ = flagValue; @@ -1262,7 +1244,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldSetIsClickableByDefault() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(68, "shouldSetIsClickableByDefault"); + markFlagAsAccessed(67, "shouldSetIsClickableByDefault"); flagValue = currentProvider_->shouldSetIsClickableByDefault(); shouldSetIsClickableByDefault_ = flagValue; @@ -1280,7 +1262,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldTriggerResponderTransferOnScrollAndr // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(69, "shouldTriggerResponderTransferOnScrollAndroid"); + markFlagAsAccessed(68, "shouldTriggerResponderTransferOnScrollAndroid"); flagValue = currentProvider_->shouldTriggerResponderTransferOnScrollAndroid(); shouldTriggerResponderTransferOnScrollAndroid_ = flagValue; @@ -1298,7 +1280,7 @@ bool ReactNativeFeatureFlagsAccessor::skipActivityIdentityAssertionOnHostPause() // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(70, "skipActivityIdentityAssertionOnHostPause"); + markFlagAsAccessed(69, "skipActivityIdentityAssertionOnHostPause"); flagValue = currentProvider_->skipActivityIdentityAssertionOnHostPause(); skipActivityIdentityAssertionOnHostPause_ = flagValue; @@ -1316,7 +1298,7 @@ bool ReactNativeFeatureFlagsAccessor::traceTurboModulePromiseRejectionsOnAndroid // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(71, "traceTurboModulePromiseRejectionsOnAndroid"); + markFlagAsAccessed(70, "traceTurboModulePromiseRejectionsOnAndroid"); flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid(); traceTurboModulePromiseRejectionsOnAndroid_ = flagValue; @@ -1334,7 +1316,7 @@ bool ReactNativeFeatureFlagsAccessor::updateRuntimeShadowNodeReferencesOnCommit( // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(72, "updateRuntimeShadowNodeReferencesOnCommit"); + markFlagAsAccessed(71, "updateRuntimeShadowNodeReferencesOnCommit"); flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommit(); updateRuntimeShadowNodeReferencesOnCommit_ = flagValue; @@ -1352,7 +1334,7 @@ bool ReactNativeFeatureFlagsAccessor::useAlwaysAvailableJSErrorHandling() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(73, "useAlwaysAvailableJSErrorHandling"); + markFlagAsAccessed(72, "useAlwaysAvailableJSErrorHandling"); flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling(); useAlwaysAvailableJSErrorHandling_ = flagValue; @@ -1370,7 +1352,7 @@ bool ReactNativeFeatureFlagsAccessor::useFabricInterop() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(74, "useFabricInterop"); + markFlagAsAccessed(73, "useFabricInterop"); flagValue = currentProvider_->useFabricInterop(); useFabricInterop_ = flagValue; @@ -1388,7 +1370,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeViewConfigsInBridgelessMode() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(75, "useNativeViewConfigsInBridgelessMode"); + markFlagAsAccessed(74, "useNativeViewConfigsInBridgelessMode"); flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode(); useNativeViewConfigsInBridgelessMode_ = flagValue; @@ -1406,7 +1388,7 @@ bool ReactNativeFeatureFlagsAccessor::useShadowNodeStateOnClone() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(76, "useShadowNodeStateOnClone"); + markFlagAsAccessed(75, "useShadowNodeStateOnClone"); flagValue = currentProvider_->useShadowNodeStateOnClone(); useShadowNodeStateOnClone_ = flagValue; @@ -1424,7 +1406,7 @@ bool ReactNativeFeatureFlagsAccessor::useSharedAnimatedBackend() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(77, "useSharedAnimatedBackend"); + markFlagAsAccessed(76, "useSharedAnimatedBackend"); flagValue = currentProvider_->useSharedAnimatedBackend(); useSharedAnimatedBackend_ = flagValue; @@ -1442,7 +1424,7 @@ bool ReactNativeFeatureFlagsAccessor::useTraitHiddenOnAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(78, "useTraitHiddenOnAndroid"); + markFlagAsAccessed(77, "useTraitHiddenOnAndroid"); flagValue = currentProvider_->useTraitHiddenOnAndroid(); useTraitHiddenOnAndroid_ = flagValue; @@ -1460,7 +1442,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(79, "useTurboModuleInterop"); + markFlagAsAccessed(78, "useTurboModuleInterop"); flagValue = currentProvider_->useTurboModuleInterop(); useTurboModuleInterop_ = flagValue; @@ -1478,7 +1460,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModules() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(80, "useTurboModules"); + markFlagAsAccessed(79, "useTurboModules"); flagValue = currentProvider_->useTurboModules(); useTurboModules_ = flagValue; @@ -1496,7 +1478,7 @@ double ReactNativeFeatureFlagsAccessor::viewCullingOutsetRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(81, "viewCullingOutsetRatio"); + markFlagAsAccessed(80, "viewCullingOutsetRatio"); flagValue = currentProvider_->viewCullingOutsetRatio(); viewCullingOutsetRatio_ = flagValue; @@ -1514,7 +1496,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewHysteresisRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(82, "virtualViewHysteresisRatio"); + markFlagAsAccessed(81, "virtualViewHysteresisRatio"); flagValue = currentProvider_->virtualViewHysteresisRatio(); virtualViewHysteresisRatio_ = flagValue; @@ -1532,7 +1514,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewPrerenderRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(83, "virtualViewPrerenderRatio"); + markFlagAsAccessed(82, "virtualViewPrerenderRatio"); flagValue = currentProvider_->virtualViewPrerenderRatio(); virtualViewPrerenderRatio_ = flagValue; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h index f01501eb40e84f..8fe9127f4684cb 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h @@ -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<> + * @generated SignedSource<<275c3f7a627c07f470c9ac1949d9fbcc>> */ /** @@ -84,7 +84,6 @@ class ReactNativeFeatureFlagsAccessor { bool enableViewRecyclingForView(); bool enableVirtualViewContainerStateExperimental(); bool enableVirtualViewDebugFeatures(); - bool enableVirtualViewRenderState(); bool fixMappingOfEventPrioritiesBetweenFabricAndReact(); bool fixTextClippingAndroid15useBoundsForWidth(); bool fuseboxAssertSingleHostState(); @@ -127,7 +126,7 @@ class ReactNativeFeatureFlagsAccessor { std::unique_ptr currentProvider_; bool wasOverridden_; - std::array, 84> accessedFeatureFlags_; + std::array, 83> accessedFeatureFlags_; std::atomic> commonTestFlag_; std::atomic> cdpInteractionMetricsEnabled_; @@ -181,7 +180,6 @@ class ReactNativeFeatureFlagsAccessor { std::atomic> enableViewRecyclingForView_; std::atomic> enableVirtualViewContainerStateExperimental_; std::atomic> enableVirtualViewDebugFeatures_; - std::atomic> enableVirtualViewRenderState_; std::atomic> fixMappingOfEventPrioritiesBetweenFabricAndReact_; std::atomic> fixTextClippingAndroid15useBoundsForWidth_; std::atomic> fuseboxAssertSingleHostState_; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h index 828610e3a17b07..ed940a559c9ac9 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h @@ -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<> + * @generated SignedSource<<159c2185b5aabf5bc0bb0a32fcd0473d>> */ /** @@ -235,10 +235,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider { return false; } - bool enableVirtualViewRenderState() override { - return true; - } - bool fixMappingOfEventPrioritiesBetweenFabricAndReact() override { return false; } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h index 829c0e48934b35..43539dab3d1c2b 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h @@ -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<<69f66d45b89b38d134a6295b344d6c01>> + * @generated SignedSource<<4664498d96f4b4e3e85d96e81c981f83>> */ /** @@ -513,15 +513,6 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef return ReactNativeFeatureFlagsDefaults::enableVirtualViewDebugFeatures(); } - bool enableVirtualViewRenderState() override { - auto value = values_["enableVirtualViewRenderState"]; - if (!value.isNull()) { - return value.getBool(); - } - - return ReactNativeFeatureFlagsDefaults::enableVirtualViewRenderState(); - } - bool fixMappingOfEventPrioritiesBetweenFabricAndReact() override { auto value = values_["fixMappingOfEventPrioritiesBetweenFabricAndReact"]; if (!value.isNull()) { diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h index a58ca1a75f29c0..e1ad0f322bad56 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h @@ -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<<6be39541927fc411650706cafbffa704>> + * @generated SignedSource<<85e69738d9f20fb3d9da17304546956c>> */ /** @@ -77,7 +77,6 @@ class ReactNativeFeatureFlagsProvider { virtual bool enableViewRecyclingForView() = 0; virtual bool enableVirtualViewContainerStateExperimental() = 0; virtual bool enableVirtualViewDebugFeatures() = 0; - virtual bool enableVirtualViewRenderState() = 0; virtual bool fixMappingOfEventPrioritiesBetweenFabricAndReact() = 0; virtual bool fixTextClippingAndroid15useBoundsForWidth() = 0; virtual bool fuseboxAssertSingleHostState() = 0; diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp index 7666195eca3aa9..e06b0a25c537e5 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp @@ -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<> + * @generated SignedSource<<938d098abe72c4e65078380234d8f818>> */ /** @@ -304,11 +304,6 @@ bool NativeReactNativeFeatureFlags::enableVirtualViewDebugFeatures( return ReactNativeFeatureFlags::enableVirtualViewDebugFeatures(); } -bool NativeReactNativeFeatureFlags::enableVirtualViewRenderState( - jsi::Runtime& /*runtime*/) { - return ReactNativeFeatureFlags::enableVirtualViewRenderState(); -} - bool NativeReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact( jsi::Runtime& /*runtime*/) { return ReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact(); diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h index d79c781da80d7f..59fb66f08c4743 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h @@ -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<<69e867b1097632a24c71466d0baf8765>> + * @generated SignedSource<<8143c4446642b5777a48dc76172d65b6>> */ /** @@ -140,8 +140,6 @@ class NativeReactNativeFeatureFlags bool enableVirtualViewDebugFeatures(jsi::Runtime& runtime); - bool enableVirtualViewRenderState(jsi::Runtime& runtime); - bool fixMappingOfEventPrioritiesBetweenFabricAndReact(jsi::Runtime& runtime); bool fixTextClippingAndroid15useBoundsForWidth(jsi::Runtime& runtime); diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index 1c34986dcb4fee..2a5d37ddc909f1 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -604,17 +604,6 @@ const definitions: FeatureFlagDefinitions = { }, ossReleaseStage: 'none', }, - enableVirtualViewRenderState: { - defaultValue: true, - metadata: { - dateAdded: '2025-06-25', - description: - 'Enables reading render state when dispatching VirtualView events.', - expectedReleaseValue: true, - purpose: 'experimentation', - }, - ossReleaseStage: 'none', - }, fixMappingOfEventPrioritiesBetweenFabricAndReact: { defaultValue: false, metadata: { diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index 5fa2728a217040..fb16bd1c38f020 100644 --- a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js @@ -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<> + * @generated SignedSource<<480e58e52425586928349b9f3560ce7f>> * @flow strict * @noformat */ @@ -101,7 +101,6 @@ export type ReactNativeFeatureFlags = $ReadOnly<{ enableViewRecyclingForView: Getter, enableVirtualViewContainerStateExperimental: Getter, enableVirtualViewDebugFeatures: Getter, - enableVirtualViewRenderState: Getter, fixMappingOfEventPrioritiesBetweenFabricAndReact: Getter, fixTextClippingAndroid15useBoundsForWidth: Getter, fuseboxAssertSingleHostState: Getter, @@ -417,10 +416,6 @@ export const enableVirtualViewContainerStateExperimental: Getter = crea * Enables VirtualView debug features such as logging and overlays. */ export const enableVirtualViewDebugFeatures: Getter = createNativeFlagGetter('enableVirtualViewDebugFeatures', false); -/** - * Enables reading render state when dispatching VirtualView events. - */ -export const enableVirtualViewRenderState: Getter = createNativeFlagGetter('enableVirtualViewRenderState', true); /** * Uses the default event priority instead of the discreet event priority by default when dispatching events from Fabric to React. */ diff --git a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js index dd2a016f24ad6f..6caa3f2f6b7ef6 100644 --- a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js @@ -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<<85fa3f5ab5a3ff245aa0d89a4599fa44>> + * @generated SignedSource<<935799fffbb56ea085dca694dc8272a0>> * @flow strict * @noformat */ @@ -77,7 +77,6 @@ export interface Spec extends TurboModule { +enableViewRecyclingForView?: () => boolean; +enableVirtualViewContainerStateExperimental?: () => boolean; +enableVirtualViewDebugFeatures?: () => boolean; - +enableVirtualViewRenderState?: () => boolean; +fixMappingOfEventPrioritiesBetweenFabricAndReact?: () => boolean; +fixTextClippingAndroid15useBoundsForWidth?: () => boolean; +fuseboxAssertSingleHostState?: () => boolean; From 3d58586ee3eda63f68ffac14534c5e94716bc8b8 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Thu, 8 Jan 2026 11:12:37 -0800 Subject: [PATCH 4/5] Fling: Cleanup `virtualViewActivityBehavior` Summary: 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] Differential Revision: D90335258 --- .../ReactNativeFeatureFlags.config.js | 10 ---------- .../components/virtualview/VirtualView.js | 16 ++-------------- .../featureflags/ReactNativeFeatureFlags.js | 8 +------- 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index 2a5d37ddc909f1..9bf6c0248bf777 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -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', - }, }, }; diff --git a/packages/react-native/src/private/components/virtualview/VirtualView.js b/packages/react-native/src/private/components/virtualview/VirtualView.js index 7f952492cd16db..f9436872db8a2b 100644 --- a/packages/react-native/src/private/components/virtualview/VirtualView.js +++ b/packages/react-native/src/private/components/virtualview/VirtualView.js @@ -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' => - {isHidden ? null : children}, - 'activity-with-hidden-mode' => - - {children} - , - 'no-activity' | _ => isHidden ? null : children, - } - } + {isHidden ? null : children} ); } diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index fb16bd1c38f020..ad4ae4196a0902 100644 --- a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js @@ -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<> * @flow strict * @noformat */ @@ -41,7 +41,6 @@ export type ReactNativeFeatureFlagsJsOnly = $ReadOnly<{ shouldUseLinkRoleForPressableText: Getter, shouldUseRemoveClippedSubviewsAsDefaultOnIOS: Getter, shouldUseSetNativePropsInFabric: Getter, - virtualViewActivityBehavior: Getter, }>; export type ReactNativeFeatureFlagsJsOnlyOverrides = OverridesFor; @@ -199,11 +198,6 @@ export const shouldUseRemoveClippedSubviewsAsDefaultOnIOS: Getter = cre */ export const shouldUseSetNativePropsInFabric: Getter = createJavaScriptFlagGetter('shouldUseSetNativePropsInFabric', true); -/** - * Changes whether and how `VirtualView` uses `Activity`. - */ -export const virtualViewActivityBehavior: Getter = createJavaScriptFlagGetter('virtualViewActivityBehavior', "no-activity"); - /** * Common flag for testing. Do NOT modify. */ From b6b54cb77884e7ce911b23db4767995ea847d081 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Thu, 8 Jan 2026 11:18:32 -0800 Subject: [PATCH 5/5] Fling: Configure `virtualViewPrerenderRatio as Operational Summary: Reclassifies the `virtualViewPrerenderRatio` feature flag as operational. Changelog: [Internal] Differential Revision: D90336116 --- .../scripts/featureflags/ReactNativeFeatureFlags.config.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index 9bf6c0248bf777..ec3ac48db7252d 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -923,10 +923,9 @@ const definitions: FeatureFlagDefinitions = { virtualViewPrerenderRatio: { defaultValue: 5, metadata: { - dateAdded: '2025-05-30', description: 'Initial prerender ratio for VirtualView.', expectedReleaseValue: 5, - purpose: 'experimentation', + purpose: 'operational', }, ossReleaseStage: 'none', },