Enable the imperative EventTarget API in canary (#58479)

Summary:
Pull Request resolved: https://github.com/react/react-native/pull/58479

`enableImperativeEvents` was defined as a JS-only feature flag, but OSS release stages are only applied to common flags: `ossReleaseStage` is consumed exclusively by the generators that produce the native override classes, so setting it on a JS-only flag is silently a no-op. The feature could therefore never be shipped through the canary channel.

This defines `enableImperativeEvents` as a common flag at release stage `canary`, and renames the JS-only flag to `enableImperativeEvents_DEPRECATED`. The deprecated flag is kept because the common flag is read through the native module: a JS bundle delivered to a native build that predates this change finds no such method and falls back to the default, which would silently turn the feature off. The gate in `ReactNativeElement` and `ReadOnlyText` now keeps the public EventTarget methods when either flag is enabled.

Changelog:
[General][Added] - Enable the imperative EventTarget API (`addEventListener`, `removeEventListener`, `dispatchEvent`) on native view refs in canary

Reviewed By: javache

Differential Revision: D119645412

fbshipit-source-id: 4fd33dfaff1640fd5d40b5bc9c3f657ea7b3bb86
(cherry picked from commit 8480b86820)
This commit is contained in:
Rubén Norte authored and Fabrizio Cucci committed 2026-09-14 10:15:31 +01:00
1 parent 760b5daf5f
commit a855c0431f
24 files changed
+216 -91

No files matched your search

@@ -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<<b7ef80c2c39c734ae511fe6457b89ce7>>
* @generated SignedSource<<de19deb8eaa373fc2048f5a9453674b7>>
*/
/**
@@ -216,6 +216,12 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun enableImmediateUpdateModeForContentOffsetChanges(): Boolean = accessor.enableImmediateUpdateModeForContentOffsetChanges()
/**
* When enabled, ReactNativeElement and ReadOnlyText expose the public EventTarget API (addEventListener, removeEventListener, dispatchEvent). When disabled, those methods are removed from those final classes.
*/
@JvmStatic
public fun enableImperativeEvents(): Boolean = accessor.enableImperativeEvents()
/**
* Enable ref.focus() and ref.blur() for all views, not just TextInput.
*/
@@ -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<<68aefd0293540d56f57e8badc0de04c8>>
* @generated SignedSource<<a1c52a57a980eaab23d92416340a6734>>
*/
/**
@@ -51,6 +51,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var enableImagePrefetchingAndroidCache: Boolean? = null
private var enableImageTransparentTintColorCache: Boolean? = null
private var enableImmediateUpdateModeForContentOffsetChangesCache: Boolean? = null
private var enableImperativeEventsCache: Boolean? = null
private var enableImperativeFocusCache: Boolean? = null
private var enableInteropViewManagerClassLookUpOptimizationIOSCache: Boolean? = null
private var enableIntersectionObserverByDefaultCache: Boolean? = null
@@ -386,6 +387,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}
override fun enableImperativeEvents(): Boolean {
var cached = enableImperativeEventsCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.enableImperativeEvents()
enableImperativeEventsCache = cached
}
return cached
}
override fun enableImperativeFocus(): Boolean {
var cached = enableImperativeFocusCache
if (cached == null) {
@@ -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<<247f721796621af8615014477518bcd9>>
* @generated SignedSource<<8a0d1f134b175ada7550499896c09203>>
*/
/**
@@ -90,6 +90,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
@DoNotStrip @JvmStatic public external fun enableImmediateUpdateModeForContentOffsetChanges(): Boolean
@DoNotStrip @JvmStatic public external fun enableImperativeEvents(): Boolean
@DoNotStrip @JvmStatic public external fun enableImperativeFocus(): Boolean
@DoNotStrip @JvmStatic public external fun enableInteropViewManagerClassLookUpOptimizationIOS(): Boolean
@@ -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<<33071257f9c96a8664c9af429e387061>>
* @generated SignedSource<<891abee69433c105d062b45ed357fd5c>>
*/
/**
@@ -85,6 +85,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
override fun enableImmediateUpdateModeForContentOffsetChanges(): Boolean = false
override fun enableImperativeEvents(): Boolean = false
override fun enableImperativeFocus(): Boolean = false
override fun enableInteropViewManagerClassLookUpOptimizationIOS(): Boolean = false
@@ -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<<f218220c66b8367211cae49adba46afc>>
* @generated SignedSource<<4c62625780d9f767714f8481c7496342>>
*/
/**
@@ -55,6 +55,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var enableImagePrefetchingAndroidCache: Boolean? = null
private var enableImageTransparentTintColorCache: Boolean? = null
private var enableImmediateUpdateModeForContentOffsetChangesCache: Boolean? = null
private var enableImperativeEventsCache: Boolean? = null
private var enableImperativeFocusCache: Boolean? = null
private var enableInteropViewManagerClassLookUpOptimizationIOSCache: Boolean? = null
private var enableIntersectionObserverByDefaultCache: Boolean? = null
@@ -421,6 +422,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}
override fun enableImperativeEvents(): Boolean {
var cached = enableImperativeEventsCache
if (cached == null) {
cached = currentProvider.enableImperativeEvents()
accessedFeatureFlags.add("enableImperativeEvents")
enableImperativeEventsCache = cached
}
return cached
}
override fun enableImperativeFocus(): Boolean {
var cached = enableImperativeFocusCache
if (cached == null) {
@@ -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<<22ab94c6b0cc8f7ee39d546d9b93540a>>
* @generated SignedSource<<843b2fa7e358dd73c9db083e42b93be6>>
*/
/**
@@ -27,6 +27,8 @@ public open class ReactNativeFeatureFlagsOverrides_RNOSS_Canary_Android : ReactN
override fun enableAccessibilityOrder(): Boolean = true
override fun enableImperativeEvents(): Boolean = true
override fun enableIntersectionObserverByDefault(): Boolean = true
override fun enableSwiftUIBasedFilters(): Boolean = true
@@ -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<<915bf918212b9898319de61d4cadaa13>>
* @generated SignedSource<<e991f910f4be27f532c6b81c436bcdf1>>
*/
/**
@@ -85,6 +85,8 @@ public interface ReactNativeFeatureFlagsProvider {
@DoNotStrip public fun enableImmediateUpdateModeForContentOffsetChanges(): Boolean
@DoNotStrip public fun enableImperativeEvents(): Boolean
@DoNotStrip public fun enableImperativeFocus(): Boolean
@DoNotStrip public fun enableInteropViewManagerClassLookUpOptimizationIOS(): Boolean
@@ -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<<177c5cc7f6e970a2d4454c32d7f777ef>>
* @generated SignedSource<<dc98fadf7aac306d7cdb4f5ab511f690>>
*/
/**
@@ -225,6 +225,12 @@ class ReactNativeFeatureFlagsJavaProvider
return method(javaProvider_);
}
bool enableImperativeEvents() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableImperativeEvents");
return method(javaProvider_);
}
bool enableImperativeFocus() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableImperativeFocus");
@@ -714,6 +720,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enableImmediateUpdateModeForContentOffs
return ReactNativeFeatureFlags::enableImmediateUpdateModeForContentOffsetChanges();
}
bool JReactNativeFeatureFlagsCxxInterop::enableImperativeEvents(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableImperativeEvents();
}
bool JReactNativeFeatureFlagsCxxInterop::enableImperativeFocus(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableImperativeFocus();
@@ -1113,6 +1124,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"enableImmediateUpdateModeForContentOffsetChanges",
JReactNativeFeatureFlagsCxxInterop::enableImmediateUpdateModeForContentOffsetChanges),
makeNativeMethod(
"enableImperativeEvents",
JReactNativeFeatureFlagsCxxInterop::enableImperativeEvents),
makeNativeMethod(
"enableImperativeFocus",
JReactNativeFeatureFlagsCxxInterop::enableImperativeFocus),
@@ -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<<eab10e240a16c8ef3f659bd8ded290f0>>
* @generated SignedSource<<c17b71e1b754ff1773bb370681de06e4>>
*/
/**
@@ -123,6 +123,9 @@ class JReactNativeFeatureFlagsCxxInterop
static bool enableImmediateUpdateModeForContentOffsetChanges(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool enableImperativeEvents(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool enableImperativeFocus(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
@@ -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<<7b726d7483bb35062b79e582323f0d7e>>
* @generated SignedSource<<023b0be9315450130aac118c65ac53eb>>
*/
/**
@@ -150,6 +150,10 @@ bool ReactNativeFeatureFlags::enableImmediateUpdateModeForContentOffsetChanges()
return getAccessor().enableImmediateUpdateModeForContentOffsetChanges();
}
bool ReactNativeFeatureFlags::enableImperativeEvents() {
return getAccessor().enableImperativeEvents();
}
bool ReactNativeFeatureFlags::enableImperativeFocus() {
return getAccessor().enableImperativeFocus();
}
@@ -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<<1e9009301b79f977132c4fa5599aebdd>>
* @generated SignedSource<<0537b7ab2bf0250ddd0cfaec6c52111b>>
*/
/**
@@ -196,6 +196,11 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool enableImmediateUpdateModeForContentOffsetChanges();
/**
* When enabled, ReactNativeElement and ReadOnlyText expose the public EventTarget API (addEventListener, removeEventListener, dispatchEvent). When disabled, those methods are removed from those final classes.
*/
RN_EXPORT static bool enableImperativeEvents();
/**
* Enable ref.focus() and ref.blur() for all views, not just TextInput.
*/
@@ -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<<7b2f18c94d995b2108f91248fdfecb0c>>
* @generated SignedSource<<c227a1e08dfa9c1fce7f32eb7c250932>>
*/
/**
@@ -587,6 +587,24 @@ bool ReactNativeFeatureFlagsAccessor::enableImmediateUpdateModeForContentOffsetC
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::enableImperativeEvents() {
auto flagValue = enableImperativeEvents_.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(31, "enableImperativeEvents");
flagValue = currentProvider_->enableImperativeEvents();
enableImperativeEvents_ = flagValue;
}
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::enableImperativeFocus() {
auto flagValue = enableImperativeFocus_.load();
@@ -596,7 +614,7 @@ bool ReactNativeFeatureFlagsAccessor::enableImperativeFocus() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(31, "enableImperativeFocus");
markFlagAsAccessed(32, "enableImperativeFocus");
flagValue = currentProvider_->enableImperativeFocus();
enableImperativeFocus_ = flagValue;
@@ -614,7 +632,7 @@ bool ReactNativeFeatureFlagsAccessor::enableInteropViewManagerClassLookUpOptimiz
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(32, "enableInteropViewManagerClassLookUpOptimizationIOS");
markFlagAsAccessed(33, "enableInteropViewManagerClassLookUpOptimizationIOS");
flagValue = currentProvider_->enableInteropViewManagerClassLookUpOptimizationIOS();
enableInteropViewManagerClassLookUpOptimizationIOS_ = flagValue;
@@ -632,7 +650,7 @@ bool ReactNativeFeatureFlagsAccessor::enableIntersectionObserverByDefault() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(33, "enableIntersectionObserverByDefault");
markFlagAsAccessed(34, "enableIntersectionObserverByDefault");
flagValue = currentProvider_->enableIntersectionObserverByDefault();
enableIntersectionObserverByDefault_ = flagValue;
@@ -650,7 +668,7 @@ bool ReactNativeFeatureFlagsAccessor::enableKeyEvents() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(34, "enableKeyEvents");
markFlagAsAccessed(35, "enableKeyEvents");
flagValue = currentProvider_->enableKeyEvents();
enableKeyEvents_ = flagValue;
@@ -668,7 +686,7 @@ bool ReactNativeFeatureFlagsAccessor::enableLayoutAnimationsOnAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(35, "enableLayoutAnimationsOnAndroid");
markFlagAsAccessed(36, "enableLayoutAnimationsOnAndroid");
flagValue = currentProvider_->enableLayoutAnimationsOnAndroid();
enableLayoutAnimationsOnAndroid_ = flagValue;
@@ -686,7 +704,7 @@ bool ReactNativeFeatureFlagsAccessor::enableLayoutAnimationsOnIOS() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(36, "enableLayoutAnimationsOnIOS");
markFlagAsAccessed(37, "enableLayoutAnimationsOnIOS");
flagValue = currentProvider_->enableLayoutAnimationsOnIOS();
enableLayoutAnimationsOnIOS_ = flagValue;
@@ -704,7 +722,7 @@ bool ReactNativeFeatureFlagsAccessor::enableModuleArgumentNSNullConversionIOS()
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(37, "enableModuleArgumentNSNullConversionIOS");
markFlagAsAccessed(38, "enableModuleArgumentNSNullConversionIOS");
flagValue = currentProvider_->enableModuleArgumentNSNullConversionIOS();
enableModuleArgumentNSNullConversionIOS_ = flagValue;
@@ -722,7 +740,7 @@ bool ReactNativeFeatureFlagsAccessor::enableMountingCoordinatorPullModelAndroid(
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(38, "enableMountingCoordinatorPullModelAndroid");
markFlagAsAccessed(39, "enableMountingCoordinatorPullModelAndroid");
flagValue = currentProvider_->enableMountingCoordinatorPullModelAndroid();
enableMountingCoordinatorPullModelAndroid_ = flagValue;
@@ -740,7 +758,7 @@ bool ReactNativeFeatureFlagsAccessor::enableMutationObserverByDefault() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(39, "enableMutationObserverByDefault");
markFlagAsAccessed(40, "enableMutationObserverByDefault");
flagValue = currentProvider_->enableMutationObserverByDefault();
enableMutationObserverByDefault_ = flagValue;
@@ -758,7 +776,7 @@ bool ReactNativeFeatureFlagsAccessor::enableNativeCSSParsing() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(40, "enableNativeCSSParsing");
markFlagAsAccessed(41, "enableNativeCSSParsing");
flagValue = currentProvider_->enableNativeCSSParsing();
enableNativeCSSParsing_ = flagValue;
@@ -776,7 +794,7 @@ bool ReactNativeFeatureFlagsAccessor::enablePreparedTextLayout() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(41, "enablePreparedTextLayout");
markFlagAsAccessed(42, "enablePreparedTextLayout");
flagValue = currentProvider_->enablePreparedTextLayout();
enablePreparedTextLayout_ = flagValue;
@@ -794,7 +812,7 @@ bool ReactNativeFeatureFlagsAccessor::enablePropsUpdateReconciliationAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(42, "enablePropsUpdateReconciliationAndroid");
markFlagAsAccessed(43, "enablePropsUpdateReconciliationAndroid");
flagValue = currentProvider_->enablePropsUpdateReconciliationAndroid();
enablePropsUpdateReconciliationAndroid_ = flagValue;
@@ -812,7 +830,7 @@ bool ReactNativeFeatureFlagsAccessor::enableResizeObserverByDefault() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(43, "enableResizeObserverByDefault");
markFlagAsAccessed(44, "enableResizeObserverByDefault");
flagValue = currentProvider_->enableResizeObserverByDefault();
enableResizeObserverByDefault_ = flagValue;
@@ -830,7 +848,7 @@ bool ReactNativeFeatureFlagsAccessor::enableSwiftUIBasedFilters() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(44, "enableSwiftUIBasedFilters");
markFlagAsAccessed(45, "enableSwiftUIBasedFilters");
flagValue = currentProvider_->enableSwiftUIBasedFilters();
enableSwiftUIBasedFilters_ = flagValue;
@@ -848,7 +866,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewCulling() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(45, "enableViewCulling");
markFlagAsAccessed(46, "enableViewCulling");
flagValue = currentProvider_->enableViewCulling();
enableViewCulling_ = flagValue;
@@ -866,7 +884,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecycling() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(46, "enableViewRecycling");
markFlagAsAccessed(47, "enableViewRecycling");
flagValue = currentProvider_->enableViewRecycling();
enableViewRecycling_ = flagValue;
@@ -884,7 +902,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForImage() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(47, "enableViewRecyclingForImage");
markFlagAsAccessed(48, "enableViewRecyclingForImage");
flagValue = currentProvider_->enableViewRecyclingForImage();
enableViewRecyclingForImage_ = flagValue;
@@ -902,7 +920,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForScrollView() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(48, "enableViewRecyclingForScrollView");
markFlagAsAccessed(49, "enableViewRecyclingForScrollView");
flagValue = currentProvider_->enableViewRecyclingForScrollView();
enableViewRecyclingForScrollView_ = flagValue;
@@ -920,7 +938,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForText() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(49, "enableViewRecyclingForText");
markFlagAsAccessed(50, "enableViewRecyclingForText");
flagValue = currentProvider_->enableViewRecyclingForText();
enableViewRecyclingForText_ = flagValue;
@@ -938,7 +956,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForView() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(50, "enableViewRecyclingForView");
markFlagAsAccessed(51, "enableViewRecyclingForView");
flagValue = currentProvider_->enableViewRecyclingForView();
enableViewRecyclingForView_ = flagValue;
@@ -956,7 +974,7 @@ bool ReactNativeFeatureFlagsAccessor::enableVirtualViewContainerStateExperimenta
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(51, "enableVirtualViewContainerStateExperimental");
markFlagAsAccessed(52, "enableVirtualViewContainerStateExperimental");
flagValue = currentProvider_->enableVirtualViewContainerStateExperimental();
enableVirtualViewContainerStateExperimental_ = flagValue;
@@ -974,7 +992,7 @@ bool ReactNativeFeatureFlagsAccessor::fixDifferentiatorParentTagForUnflattenCase
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(52, "fixDifferentiatorParentTagForUnflattenCase");
markFlagAsAccessed(53, "fixDifferentiatorParentTagForUnflattenCase");
flagValue = currentProvider_->fixDifferentiatorParentTagForUnflattenCase();
fixDifferentiatorParentTagForUnflattenCase_ = flagValue;
@@ -992,7 +1010,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(54, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact();
fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue;
@@ -1010,7 +1028,7 @@ bool ReactNativeFeatureFlagsAccessor::fixYogaFlexBasisFitContentInMainAxis() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(54, "fixYogaFlexBasisFitContentInMainAxis");
markFlagAsAccessed(55, "fixYogaFlexBasisFitContentInMainAxis");
flagValue = currentProvider_->fixYogaFlexBasisFitContentInMainAxis();
fixYogaFlexBasisFitContentInMainAxis_ = flagValue;
@@ -1028,7 +1046,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(56, "fuseboxAssertSingleHostState");
flagValue = currentProvider_->fuseboxAssertSingleHostState();
fuseboxAssertSingleHostState_ = flagValue;
@@ -1046,7 +1064,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(57, "fuseboxEnabledRelease");
flagValue = currentProvider_->fuseboxEnabledRelease();
fuseboxEnabledRelease_ = flagValue;
@@ -1064,7 +1082,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxFrameRecordingEnabled() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(57, "fuseboxFrameRecordingEnabled");
markFlagAsAccessed(58, "fuseboxFrameRecordingEnabled");
flagValue = currentProvider_->fuseboxFrameRecordingEnabled();
fuseboxFrameRecordingEnabled_ = flagValue;
@@ -1082,7 +1100,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxScreenshotCaptureEnabled() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(58, "fuseboxScreenshotCaptureEnabled");
markFlagAsAccessed(59, "fuseboxScreenshotCaptureEnabled");
flagValue = currentProvider_->fuseboxScreenshotCaptureEnabled();
fuseboxScreenshotCaptureEnabled_ = flagValue;
@@ -1100,7 +1118,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxWebSocketEventsEnabled() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(59, "fuseboxWebSocketEventsEnabled");
markFlagAsAccessed(60, "fuseboxWebSocketEventsEnabled");
flagValue = currentProvider_->fuseboxWebSocketEventsEnabled();
fuseboxWebSocketEventsEnabled_ = flagValue;
@@ -1118,7 +1136,7 @@ bool ReactNativeFeatureFlagsAccessor::optimizedAnimatedPropUpdates() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(60, "optimizedAnimatedPropUpdates");
markFlagAsAccessed(61, "optimizedAnimatedPropUpdates");
flagValue = currentProvider_->optimizedAnimatedPropUpdates();
optimizedAnimatedPropUpdates_ = flagValue;
@@ -1136,7 +1154,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(61, "overrideBySynchronousMountPropsAtMountingAndroid");
markFlagAsAccessed(62, "overrideBySynchronousMountPropsAtMountingAndroid");
flagValue = currentProvider_->overrideBySynchronousMountPropsAtMountingAndroid();
overrideBySynchronousMountPropsAtMountingAndroid_ = flagValue;
@@ -1154,7 +1172,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(62, "perfIssuesEnabled");
markFlagAsAccessed(63, "perfIssuesEnabled");
flagValue = currentProvider_->perfIssuesEnabled();
perfIssuesEnabled_ = flagValue;
@@ -1172,7 +1190,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(63, "perfMonitorV2Enabled");
markFlagAsAccessed(64, "perfMonitorV2Enabled");
flagValue = currentProvider_->perfMonitorV2Enabled();
perfMonitorV2Enabled_ = flagValue;
@@ -1190,7 +1208,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(64, "preparedTextCacheSize");
markFlagAsAccessed(65, "preparedTextCacheSize");
flagValue = currentProvider_->preparedTextCacheSize();
preparedTextCacheSize_ = flagValue;
@@ -1208,7 +1226,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(65, "preventShadowTreeCommitExhaustion");
markFlagAsAccessed(66, "preventShadowTreeCommitExhaustion");
flagValue = currentProvider_->preventShadowTreeCommitExhaustion();
preventShadowTreeCommitExhaustion_ = flagValue;
@@ -1226,7 +1244,7 @@ bool ReactNativeFeatureFlagsAccessor::redBoxV2Android() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(66, "redBoxV2Android");
markFlagAsAccessed(67, "redBoxV2Android");
flagValue = currentProvider_->redBoxV2Android();
redBoxV2Android_ = flagValue;
@@ -1244,7 +1262,7 @@ bool ReactNativeFeatureFlagsAccessor::redBoxV2IOS() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(67, "redBoxV2IOS");
markFlagAsAccessed(68, "redBoxV2IOS");
flagValue = currentProvider_->redBoxV2IOS();
redBoxV2IOS_ = flagValue;
@@ -1262,7 +1280,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(68, "shouldPressibilityUseW3CPointerEventsForHover");
markFlagAsAccessed(69, "shouldPressibilityUseW3CPointerEventsForHover");
flagValue = currentProvider_->shouldPressibilityUseW3CPointerEventsForHover();
shouldPressibilityUseW3CPointerEventsForHover_ = flagValue;
@@ -1280,7 +1298,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(70, "shouldTriggerResponderTransferOnScrollAndroid");
flagValue = currentProvider_->shouldTriggerResponderTransferOnScrollAndroid();
shouldTriggerResponderTransferOnScrollAndroid_ = flagValue;
@@ -1298,7 +1316,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(71, "skipActivityIdentityAssertionOnHostPause");
flagValue = currentProvider_->skipActivityIdentityAssertionOnHostPause();
skipActivityIdentityAssertionOnHostPause_ = flagValue;
@@ -1316,7 +1334,7 @@ bool ReactNativeFeatureFlagsAccessor::syncAndroidClipBoundsWithOverflow() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(71, "syncAndroidClipBoundsWithOverflow");
markFlagAsAccessed(72, "syncAndroidClipBoundsWithOverflow");
flagValue = currentProvider_->syncAndroidClipBoundsWithOverflow();
syncAndroidClipBoundsWithOverflow_ = flagValue;
@@ -1334,7 +1352,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(73, "traceTurboModulePromiseRejectionsOnAndroid");
flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid();
traceTurboModulePromiseRejectionsOnAndroid_ = flagValue;
@@ -1352,7 +1370,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(74, "updateRuntimeShadowNodeReferencesOnCommit");
flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommit();
updateRuntimeShadowNodeReferencesOnCommit_ = flagValue;
@@ -1370,7 +1388,7 @@ bool ReactNativeFeatureFlagsAccessor::updateRuntimeShadowNodeReferencesOnCommitT
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(74, "updateRuntimeShadowNodeReferencesOnCommitThread");
markFlagAsAccessed(75, "updateRuntimeShadowNodeReferencesOnCommitThread");
flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommitThread();
updateRuntimeShadowNodeReferencesOnCommitThread_ = flagValue;
@@ -1388,7 +1406,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(75, "useAlwaysAvailableJSErrorHandling");
markFlagAsAccessed(76, "useAlwaysAvailableJSErrorHandling");
flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling();
useAlwaysAvailableJSErrorHandling_ = flagValue;
@@ -1406,7 +1424,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(76, "useFabricInterop");
markFlagAsAccessed(77, "useFabricInterop");
flagValue = currentProvider_->useFabricInterop();
useFabricInterop_ = flagValue;
@@ -1424,7 +1442,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(77, "useNativeViewConfigsInBridgelessMode");
markFlagAsAccessed(78, "useNativeViewConfigsInBridgelessMode");
flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode();
useNativeViewConfigsInBridgelessMode_ = flagValue;
@@ -1442,7 +1460,7 @@ bool ReactNativeFeatureFlagsAccessor::useNestedScrollViewAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(78, "useNestedScrollViewAndroid");
markFlagAsAccessed(79, "useNestedScrollViewAndroid");
flagValue = currentProvider_->useNestedScrollViewAndroid();
useNestedScrollViewAndroid_ = flagValue;
@@ -1460,7 +1478,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(79, "useSharedAnimatedBackend");
markFlagAsAccessed(80, "useSharedAnimatedBackend");
flagValue = currentProvider_->useSharedAnimatedBackend();
useSharedAnimatedBackend_ = flagValue;
@@ -1478,7 +1496,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(80, "useTraitHiddenOnAndroid");
markFlagAsAccessed(81, "useTraitHiddenOnAndroid");
flagValue = currentProvider_->useTraitHiddenOnAndroid();
useTraitHiddenOnAndroid_ = flagValue;
@@ -1496,7 +1514,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(81, "useTurboModuleInterop");
markFlagAsAccessed(82, "useTurboModuleInterop");
flagValue = currentProvider_->useTurboModuleInterop();
useTurboModuleInterop_ = flagValue;
@@ -1514,7 +1532,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(83, "viewCullingOutsetRatio");
flagValue = currentProvider_->viewCullingOutsetRatio();
viewCullingOutsetRatio_ = flagValue;
@@ -1532,7 +1550,7 @@ bool ReactNativeFeatureFlagsAccessor::viewTransitionEnabled() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(83, "viewTransitionEnabled");
markFlagAsAccessed(84, "viewTransitionEnabled");
flagValue = currentProvider_->viewTransitionEnabled();
viewTransitionEnabled_ = flagValue;
@@ -1550,7 +1568,7 @@ bool ReactNativeFeatureFlagsAccessor::viewTransitionUseHardwareBitmapAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(84, "viewTransitionUseHardwareBitmapAndroid");
markFlagAsAccessed(85, "viewTransitionUseHardwareBitmapAndroid");
flagValue = currentProvider_->viewTransitionUseHardwareBitmapAndroid();
viewTransitionUseHardwareBitmapAndroid_ = flagValue;
@@ -1568,7 +1586,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(85, "virtualViewPrerenderRatio");
markFlagAsAccessed(86, "virtualViewPrerenderRatio");
flagValue = currentProvider_->virtualViewPrerenderRatio();
virtualViewPrerenderRatio_ = flagValue;
@@ -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<<f1b22a1d1c09d8ef57f866c85915ee47>>
* @generated SignedSource<<da1dce235a114d2f92849e751bf48125>>
*/
/**
@@ -65,6 +65,7 @@ class ReactNativeFeatureFlagsAccessor {
bool enableImagePrefetchingAndroid();
bool enableImageTransparentTintColor();
bool enableImmediateUpdateModeForContentOffsetChanges();
bool enableImperativeEvents();
bool enableImperativeFocus();
bool enableInteropViewManagerClassLookUpOptimizationIOS();
bool enableIntersectionObserverByDefault();
@@ -131,7 +132,7 @@ class ReactNativeFeatureFlagsAccessor {
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
bool wasOverridden_;
std::array<std::atomic<const char*>, 86> accessedFeatureFlags_;
std::array<std::atomic<const char*>, 87> accessedFeatureFlags_;
std::atomic<std::optional<bool>> commonTestFlag_;
std::atomic<std::optional<bool>> cdpInteractionMetricsEnabled_;
@@ -164,6 +165,7 @@ class ReactNativeFeatureFlagsAccessor {
std::atomic<std::optional<bool>> enableImagePrefetchingAndroid_;
std::atomic<std::optional<bool>> enableImageTransparentTintColor_;
std::atomic<std::optional<bool>> enableImmediateUpdateModeForContentOffsetChanges_;
std::atomic<std::optional<bool>> enableImperativeEvents_;
std::atomic<std::optional<bool>> enableImperativeFocus_;
std::atomic<std::optional<bool>> enableInteropViewManagerClassLookUpOptimizationIOS_;
std::atomic<std::optional<bool>> enableIntersectionObserverByDefault_;
@@ -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<<2a5f641d6506566cc26cb76f62300bbb>>
* @generated SignedSource<<d313fa1477322ec50564f81f5f0f7046>>
*/
/**
@@ -153,6 +153,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
return false;
}
bool enableImperativeEvents() override {
return false;
}
bool enableImperativeFocus() override {
return false;
}
@@ -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<<570eb4a5cab112e5f8ea0b4fb1fa205c>>
* @generated SignedSource<<be4cd3d7b411ca75071b032494819c99>>
*/
/**
@@ -326,6 +326,15 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
return ReactNativeFeatureFlagsDefaults::enableImmediateUpdateModeForContentOffsetChanges();
}
bool enableImperativeEvents() override {
auto value = values_["enableImperativeEvents"];
if (!value.isNull()) {
return value.getBool();
}
return ReactNativeFeatureFlagsDefaults::enableImperativeEvents();
}
bool enableImperativeFocus() override {
auto value = values_["enableImperativeFocus"];
if (!value.isNull()) {
@@ -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<<650cb266846c66577dde6d7c7a703af1>>
* @generated SignedSource<<c26b8f81fcc99469d0535a89bac18280>>
*/
/**
@@ -37,6 +37,10 @@ class ReactNativeFeatureFlagsOverridesOSSCanary : public ReactNativeFeatureFlags
return true;
}
bool enableImperativeEvents() override {
return true;
}
bool enableIntersectionObserverByDefault() override {
return true;
}
@@ -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<<0bbf1352906bbe1642cab3d2b92173e6>>
* @generated SignedSource<<dd7af4b17d283f9e35e66767b7a9e236>>
*/
/**
@@ -58,6 +58,7 @@ class ReactNativeFeatureFlagsProvider {
virtual bool enableImagePrefetchingAndroid() = 0;
virtual bool enableImageTransparentTintColor() = 0;
virtual bool enableImmediateUpdateModeForContentOffsetChanges() = 0;
virtual bool enableImperativeEvents() = 0;
virtual bool enableImperativeFocus() = 0;
virtual bool enableInteropViewManagerClassLookUpOptimizationIOS() = 0;
virtual bool enableIntersectionObserverByDefault() = 0;
@@ -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<<7505981b27be5298787edef4d80527e8>>
* @generated SignedSource<<909f4afa6f96b4e77577432e4d98ba76>>
*/
/**
@@ -199,6 +199,11 @@ bool NativeReactNativeFeatureFlags::enableImmediateUpdateModeForContentOffsetCha
return ReactNativeFeatureFlags::enableImmediateUpdateModeForContentOffsetChanges();
}
bool NativeReactNativeFeatureFlags::enableImperativeEvents(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::enableImperativeEvents();
}
bool NativeReactNativeFeatureFlags::enableImperativeFocus(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::enableImperativeFocus();
@@ -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<<be495e72a7b96977ec6d029710d669a3>>
* @generated SignedSource<<88f2554b7033d38f5b275eac1d52ae6e>>
*/
/**
@@ -100,6 +100,8 @@ class NativeReactNativeFeatureFlags
bool enableImmediateUpdateModeForContentOffsetChanges(jsi::Runtime& runtime);
bool enableImperativeEvents(jsi::Runtime& runtime);
bool enableImperativeFocus(jsi::Runtime& runtime);
bool enableInteropViewManagerClassLookUpOptimizationIOS(jsi::Runtime& runtime);
@@ -381,6 +381,16 @@ const definitions: FeatureFlagDefinitions = {
},
ossReleaseStage: 'none',
},
enableImperativeEvents: {
defaultValue: false,
metadata: {
description:
'When enabled, ReactNativeElement and ReadOnlyText expose the public EventTarget API (addEventListener, removeEventListener, dispatchEvent). When disabled, those methods are removed from those final classes.',
expectedReleaseValue: true,
purpose: 'release',
},
ossReleaseStage: 'canary',
},
enableImperativeFocus: {
defaultValue: false,
metadata: {
@@ -1022,15 +1032,14 @@ const definitions: FeatureFlagDefinitions = {
},
ossReleaseStage: 'none',
},
enableImperativeEvents: {
enableImperativeEvents_DEPRECATED: {
defaultValue: false,
metadata: {
description:
'When enabled, ReactNativeElement and ReadOnlyText expose the public EventTarget API (addEventListener, removeEventListener, dispatchEvent). When disabled, those methods are removed from those final classes.',
'Deprecated in favor of the common flag with the same name, which is the one that can be configured by OSS release stage. This is only kept so JS bundles delivered to older native builds, where the common flag is unavailable, can still enable the feature.',
expectedReleaseValue: true,
purpose: 'release',
},
// TODO: This should be "canary" now but the OSS renderer cannot be upgraded with the necessary changes until React 19.3.0 is released.
ossReleaseStage: 'none',
},
enableNativeEventTargetEventDispatching: {
@@ -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<<51d7012509e3e0f2fe1caef5dc1060a0>>
* @generated SignedSource<<52d39a196023796eed43d419c5a0b855>>
* @flow strict
* @noformat
*/
@@ -34,7 +34,7 @@ export type ReactNativeFeatureFlagsJsOnly = Readonly<{
animatedKeepListenersOnDetach: Getter<boolean>,
animatedShouldSyncValueBeforeStartCallback: Getter<boolean>,
deferFlatListFocusChangeRenderUpdate: Getter<boolean>,
enableImperativeEvents: Getter<boolean>,
enableImperativeEvents_DEPRECATED: Getter<boolean>,
enableNativeEventTargetEventDispatching: Getter<boolean>,
externalElementInspectionEnabled: Getter<boolean>,
fixVirtualizeListCollapseWindowSize: Getter<boolean>,
@@ -80,6 +80,7 @@ export type ReactNativeFeatureFlags = Readonly<{
enableImagePrefetchingAndroid: Getter<boolean>,
enableImageTransparentTintColor: Getter<boolean>,
enableImmediateUpdateModeForContentOffsetChanges: Getter<boolean>,
enableImperativeEvents: Getter<boolean>,
enableImperativeFocus: Getter<boolean>,
enableInteropViewManagerClassLookUpOptimizationIOS: Getter<boolean>,
enableIntersectionObserverByDefault: Getter<boolean>,
@@ -168,9 +169,9 @@ export const animatedShouldSyncValueBeforeStartCallback: Getter<boolean> = creat
export const deferFlatListFocusChangeRenderUpdate: Getter<boolean> = createJavaScriptFlagGetter('deferFlatListFocusChangeRenderUpdate', false);
/**
* When enabled, ReactNativeElement and ReadOnlyText expose the public EventTarget API (addEventListener, removeEventListener, dispatchEvent). When disabled, those methods are removed from those final classes.
* Deprecated in favor of the common flag with the same name, which is the one that can be configured by OSS release stage. This is only kept so JS bundles delivered to older native builds, where the common flag is unavailable, can still enable the feature.
*/
export const enableImperativeEvents: Getter<boolean> = createJavaScriptFlagGetter('enableImperativeEvents', false);
export const enableImperativeEvents_DEPRECATED: Getter<boolean> = createJavaScriptFlagGetter('enableImperativeEvents_DEPRECATED', false);
/**
* When enabled, the React Native renderer dispatches events through the W3C EventTarget API (addEventListener/dispatchEvent) instead of the legacy plugin-based system.
@@ -335,6 +336,10 @@ export const enableImageTransparentTintColor: Getter<boolean> = createNativeFlag
* Dispatches state updates for content offset changes synchronously on the main thread.
*/
export const enableImmediateUpdateModeForContentOffsetChanges: Getter<boolean> = createNativeFlagGetter('enableImmediateUpdateModeForContentOffsetChanges', false);
/**
* When enabled, ReactNativeElement and ReadOnlyText expose the public EventTarget API (addEventListener, removeEventListener, dispatchEvent). When disabled, those methods are removed from those final classes.
*/
export const enableImperativeEvents: Getter<boolean> = createNativeFlagGetter('enableImperativeEvents', false);
/**
* Enable ref.focus() and ref.blur() for all views, not just TextInput.
*/
@@ -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<<efe20af949bcd1f716b8f620279899ae>>
* @generated SignedSource<<d6c54d6154c0f0771c211424e608f182>>
* @flow strict
* @noformat
*/
@@ -56,6 +56,7 @@ export interface Spec extends TurboModule {
readonly enableImagePrefetchingAndroid?: () => boolean;
readonly enableImageTransparentTintColor?: () => boolean;
readonly enableImmediateUpdateModeForContentOffsetChanges?: () => boolean;
readonly enableImperativeEvents?: () => boolean;
readonly enableImperativeFocus?: () => boolean;
readonly enableInteropViewManagerClassLookUpOptimizationIOS?: () => boolean;
readonly enableIntersectionObserverByDefault?: () => boolean;
@@ -360,12 +360,14 @@ ReactNativeElement_public.prototype = ReactNativeElement.prototype;
// `removeEventListener`, `dispatchEvent`) is only inherited by this final class
// when `enableNativeEventTargetEventDispatching` is enabled (which makes
// `ReadOnlyNode` extend `EventTarget`). Until that public API is finalized, it
// is gated behind `enableImperativeEvents`: when that flag is off we remove
// those methods from this final class. Native/internal event dispatch does not
// rely on these public methods, so removing them is safe.
// is gated behind `enableImperativeEvents` (or its deprecated JS-only
// counterpart, `enableImperativeEvents_DEPRECATED`): when both flags are off we
// remove those methods from this final class. Native/internal event dispatch
// does not rely on these public methods, so removing them is safe.
if (
ReactNativeFeatureFlags.enableNativeEventTargetEventDispatching() &&
!ReactNativeFeatureFlags.enableImperativeEvents()
!ReactNativeFeatureFlags.enableImperativeEvents() &&
!ReactNativeFeatureFlags.enableImperativeEvents_DEPRECATED()
) {
const prototype: interface {
addEventListener?: unknown,
@@ -45,12 +45,14 @@ ReadOnlyText_public.prototype = ReadOnlyText.prototype;
// `removeEventListener`, `dispatchEvent`) is only inherited by this final class
// when `enableNativeEventTargetEventDispatching` is enabled (which makes
// `ReadOnlyNode` extend `EventTarget`). Until that public API is finalized, it
// is gated behind `enableImperativeEvents`: when that flag is off we remove
// those methods from this final class. Native/internal event dispatch does not
// rely on these public methods, so removing them is safe.
// is gated behind `enableImperativeEvents` (or its deprecated JS-only
// counterpart, `enableImperativeEvents_DEPRECATED`): when both flags are off we
// remove those methods from this final class. Native/internal event dispatch
// does not rely on these public methods, so removing them is safe.
if (
ReactNativeFeatureFlags.enableNativeEventTargetEventDispatching() &&
!ReactNativeFeatureFlags.enableImperativeEvents()
!ReactNativeFeatureFlags.enableImperativeEvents() &&
!ReactNativeFeatureFlags.enableImperativeEvents_DEPRECATED()
) {
const prototype: interface {
addEventListener?: unknown,