diff --git a/packages/react-native/Libraries/Core/setUpTimers.js b/packages/react-native/Libraries/Core/setUpTimers.js index 486ff03646c..7dc59d9e1fb 100644 --- a/packages/react-native/Libraries/Core/setUpTimers.js +++ b/packages/react-native/Libraries/Core/setUpTimers.js @@ -26,18 +26,10 @@ const isEventLoopEnabled = (() => { return false; } - if (NativeReactNativeFeatureFlags.disableEventLoopOnBridgeless == null) { - // Flags not unified yet - return ( - ReactNativeFeatureFlags.useModernRuntimeScheduler() && - ReactNativeFeatureFlags.enableMicrotasks() - ); - } else { - return ( - ReactNativeFeatureFlags.enableBridgelessArchitecture() && - !ReactNativeFeatureFlags.disableEventLoopOnBridgeless() - ); - } + return ( + ReactNativeFeatureFlags.enableBridgelessArchitecture() && + !ReactNativeFeatureFlags.disableEventLoopOnBridgeless() + ); })(); // In bridgeless mode, timers are host functions installed from cpp. diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp index 8839a22e053..655b1a85c05 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<<1626340cbb5cc8958d6b16c9b717e91e>> + * @generated SignedSource<> */ /** @@ -54,13 +54,6 @@ bool NativeReactNativeFeatureFlags::allowRecursiveCommitsWithSynchronousMountOnA return ReactNativeFeatureFlags::allowRecursiveCommitsWithSynchronousMountOnAndroid(); } -bool NativeReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop( - jsi::Runtime& /*runtime*/) { - // This flag is configured with `skipNativeAPI: true`. - // TODO(T204838867): Implement support for optional methods in C++ TM codegen and remove the method definition altogether. - return false; -} - bool NativeReactNativeFeatureFlags::completeReactInstanceCreationOnBgThreadOnAndroid( jsi::Runtime& /*runtime*/) { return ReactNativeFeatureFlags::completeReactInstanceCreationOnBgThreadOnAndroid(); @@ -151,13 +144,6 @@ bool NativeReactNativeFeatureFlags::enableLongTaskAPI( return ReactNativeFeatureFlags::enableLongTaskAPI(); } -bool NativeReactNativeFeatureFlags::enableMicrotasks( - jsi::Runtime& /*runtime*/) { - // This flag is configured with `skipNativeAPI: true`. - // TODO(T204838867): Implement support for optional methods in C++ TM codegen and remove the method definition altogether. - return false; -} - bool NativeReactNativeFeatureFlags::enableNewBackgroundAndBorderDrawables( jsi::Runtime& /*runtime*/) { return ReactNativeFeatureFlags::enableNewBackgroundAndBorderDrawables(); @@ -258,13 +244,6 @@ bool NativeReactNativeFeatureFlags::useImmediateExecutorInAndroidBridgeless( return ReactNativeFeatureFlags::useImmediateExecutorInAndroidBridgeless(); } -bool NativeReactNativeFeatureFlags::useModernRuntimeScheduler( - jsi::Runtime& /*runtime*/) { - // This flag is configured with `skipNativeAPI: true`. - // TODO(T204838867): Implement support for optional methods in C++ TM codegen and remove the method definition altogether. - return false; -} - bool NativeReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode( jsi::Runtime& /*runtime*/) { return ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode(); diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h index d9d4802f936..1cdeacd004b 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<> + * @generated SignedSource<> */ /** @@ -41,8 +41,6 @@ class NativeReactNativeFeatureFlags bool allowRecursiveCommitsWithSynchronousMountOnAndroid(jsi::Runtime& runtime); - bool batchRenderingUpdatesInEventLoop(jsi::Runtime& runtime); - bool completeReactInstanceCreationOnBgThreadOnAndroid(jsi::Runtime& runtime); bool disableEventLoopOnBridgeless(jsi::Runtime& runtime); @@ -79,8 +77,6 @@ class NativeReactNativeFeatureFlags bool enableLongTaskAPI(jsi::Runtime& runtime); - bool enableMicrotasks(jsi::Runtime& runtime); - bool enableNewBackgroundAndBorderDrawables(jsi::Runtime& runtime); bool enablePreciseSchedulingForPremountItemsOnAndroid(jsi::Runtime& runtime); @@ -121,8 +117,6 @@ class NativeReactNativeFeatureFlags bool useImmediateExecutorInAndroidBridgeless(jsi::Runtime& runtime); - bool useModernRuntimeScheduler(jsi::Runtime& runtime); - bool useNativeViewConfigsInBridgelessMode(jsi::Runtime& runtime); bool useOptimisedViewPreallocationOnAndroid(jsi::Runtime& runtime); diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index 5659ae20929..9603014e4da 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -63,16 +63,6 @@ const definitions: FeatureFlagDefinitions = { purpose: 'experimentation', }, }, - batchRenderingUpdatesInEventLoop: { - defaultValue: false, - metadata: { - description: - 'When enabled, the RuntimeScheduler processing the event loop will batch all rendering updates and dispatch them together at the end of each iteration of the loop.', - purpose: 'release', - }, - // We're preparing to clean up this feature flag. - skipNativeAPI: true, - }, completeReactInstanceCreationOnBgThreadOnAndroid: { defaultValue: false, metadata: { @@ -223,16 +213,6 @@ const definitions: FeatureFlagDefinitions = { purpose: 'release', }, }, - enableMicrotasks: { - defaultValue: false, - metadata: { - description: - 'Enables the use of microtasks in Hermes (scheduling) and RuntimeScheduler (execution).', - purpose: 'release', - }, - // We're preparing to clean up this feature flag. - skipNativeAPI: true, - }, enableNewBackgroundAndBorderDrawables: { defaultValue: false, metadata: { @@ -406,16 +386,6 @@ const definitions: FeatureFlagDefinitions = { purpose: 'experimentation', }, }, - useModernRuntimeScheduler: { - defaultValue: false, - metadata: { - description: - 'When enabled, it uses the modern fork of RuntimeScheduler that allows scheduling tasks with priorities from any thread.', - purpose: 'release', - }, - // We're preparing to clean up this feature flag. - skipNativeAPI: true, - }, useNativeViewConfigsInBridgelessMode: { defaultValue: false, metadata: { diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index 90fbc2f5b3b..7f43f7010fc 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 */ @@ -53,7 +53,6 @@ export type ReactNativeFeatureFlags = { commonTestFlag: Getter, commonTestFlagWithoutNativeImplementation: Getter, allowRecursiveCommitsWithSynchronousMountOnAndroid: Getter, - batchRenderingUpdatesInEventLoop: Getter, completeReactInstanceCreationOnBgThreadOnAndroid: Getter, disableEventLoopOnBridgeless: Getter, disableMountItemReorderingAndroid: Getter, @@ -72,7 +71,6 @@ export type ReactNativeFeatureFlags = { enableLayoutAnimationsOnAndroid: Getter, enableLayoutAnimationsOnIOS: Getter, enableLongTaskAPI: Getter, - enableMicrotasks: Getter, enableNewBackgroundAndBorderDrawables: Getter, enablePreciseSchedulingForPremountItemsOnAndroid: Getter, enablePropsUpdateReconciliationAndroid: Getter, @@ -93,7 +91,6 @@ export type ReactNativeFeatureFlags = { useAlwaysAvailableJSErrorHandling: Getter, useFabricInterop: Getter, useImmediateExecutorInAndroidBridgeless: Getter, - useModernRuntimeScheduler: Getter, useNativeViewConfigsInBridgelessMode: Getter, useOptimisedViewPreallocationOnAndroid: Getter, useOptimizedEventBatchingOnAndroid: Getter, @@ -199,10 +196,6 @@ export const commonTestFlagWithoutNativeImplementation: Getter = create * Adds support for recursively processing commits that mount synchronously (Android only). */ export const allowRecursiveCommitsWithSynchronousMountOnAndroid: Getter = createNativeFlagGetter('allowRecursiveCommitsWithSynchronousMountOnAndroid', false); -/** - * When enabled, the RuntimeScheduler processing the event loop will batch all rendering updates and dispatch them together at the end of each iteration of the loop. - */ -export const batchRenderingUpdatesInEventLoop: Getter = createNativeFlagGetter('batchRenderingUpdatesInEventLoop', false); /** * Do not wait for a main-thread dispatch to complete init to start executing work on the JS thread on Android */ @@ -275,10 +268,6 @@ export const enableLayoutAnimationsOnIOS: Getter = createNativeFlagGett * Enables the reporting of long tasks through `PerformanceObserver`. Only works if the event loop is enabled. */ export const enableLongTaskAPI: Getter = createNativeFlagGetter('enableLongTaskAPI', false); -/** - * Enables the use of microtasks in Hermes (scheduling) and RuntimeScheduler (execution). - */ -export const enableMicrotasks: Getter = createNativeFlagGetter('enableMicrotasks', false); /** * Use BackgroundDrawable and BorderDrawable instead of CSSBackgroundDrawable */ @@ -359,10 +348,6 @@ export const useFabricInterop: Getter = createNativeFlagGetter('useFabr * Invoke callbacks immediately on the ReactInstance rather than going through a background thread for synchronization */ export const useImmediateExecutorInAndroidBridgeless: Getter = createNativeFlagGetter('useImmediateExecutorInAndroidBridgeless', false); -/** - * When enabled, it uses the modern fork of RuntimeScheduler that allows scheduling tasks with priorities from any thread. - */ -export const useModernRuntimeScheduler: Getter = createNativeFlagGetter('useModernRuntimeScheduler', false); /** * When enabled, the native view configs are used in bridgeless mode. */ diff --git a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js index 8dbecefffb6..a34259d3966 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<<53510b80964a952f0fc4ed97a6d59386>> + * @generated SignedSource<> * @flow strict */ @@ -26,7 +26,6 @@ export interface Spec extends TurboModule { +commonTestFlag?: () => boolean; +commonTestFlagWithoutNativeImplementation?: () => boolean; +allowRecursiveCommitsWithSynchronousMountOnAndroid?: () => boolean; - +batchRenderingUpdatesInEventLoop?: () => boolean; +completeReactInstanceCreationOnBgThreadOnAndroid?: () => boolean; +disableEventLoopOnBridgeless?: () => boolean; +disableMountItemReorderingAndroid?: () => boolean; @@ -45,7 +44,6 @@ export interface Spec extends TurboModule { +enableLayoutAnimationsOnAndroid?: () => boolean; +enableLayoutAnimationsOnIOS?: () => boolean; +enableLongTaskAPI?: () => boolean; - +enableMicrotasks?: () => boolean; +enableNewBackgroundAndBorderDrawables?: () => boolean; +enablePreciseSchedulingForPremountItemsOnAndroid?: () => boolean; +enablePropsUpdateReconciliationAndroid?: () => boolean; @@ -66,7 +64,6 @@ export interface Spec extends TurboModule { +useAlwaysAvailableJSErrorHandling?: () => boolean; +useFabricInterop?: () => boolean; +useImmediateExecutorInAndroidBridgeless?: () => boolean; - +useModernRuntimeScheduler?: () => boolean; +useNativeViewConfigsInBridgelessMode?: () => boolean; +useOptimisedViewPreallocationOnAndroid?: () => boolean; +useOptimizedEventBatchingOnAndroid?: () => boolean;