From 1d24438d1873b3b3d8a96efd00f2ec36cf8c3908 Mon Sep 17 00:00:00 2001 From: Zeya Peng Date: Thu, 25 Jun 2026 08:45:44 -0700 Subject: [PATCH 1/2] Remove animatedShouldDebounceQueueFlush gate in NativeAnimatedHelper (#57337) Summary: Now that flush-queue debouncing is the default, drop the `animatedShouldDebounceQueueFlush` checks in `NativeAnimatedHelper` so the debounced flush path is unconditional. `disableQueue()` always schedules a flush, and `setWaitingForIdentifier()` always clears any pending immediate flush. Changelog: [Internal] Reviewed By: christophpurrer Differential Revision: D109468770 --- .../src/private/animated/NativeAnimatedHelper.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/react-native/src/private/animated/NativeAnimatedHelper.js b/packages/react-native/src/private/animated/NativeAnimatedHelper.js index eaaefb5b9a0..03d7f5c1c23 100644 --- a/packages/react-native/src/private/animated/NativeAnimatedHelper.js +++ b/packages/react-native/src/private/animated/NativeAnimatedHelper.js @@ -203,11 +203,7 @@ const API = { disableQueue(): void { invariant(NativeAnimatedModule, 'Native animated module is not available'); - if (ReactNativeFeatureFlags.animatedShouldDebounceQueueFlush()) { - scheduleQueueFlush(); - } else { - API.flushQueue(); - } + scheduleQueueFlush(); }, disconnectAnimatedNodeFromView(nodeTag: number, viewTag: number): void { NativeOperations.disconnectAnimatedNodeFromView(nodeTag, viewTag); @@ -311,10 +307,7 @@ const API = { waitingForQueuedOperations.add(id); queueOperations = true; - if ( - ReactNativeFeatureFlags.animatedShouldDebounceQueueFlush() && - flushQueueImmediate - ) { + if (flushQueueImmediate) { clearImmediate(flushQueueImmediate); } }, From 4c62e22f397d9a79845d1871021efe50e4b34afb Mon Sep 17 00:00:00 2001 From: Zeya Peng Date: Thu, 25 Jun 2026 08:45:44 -0700 Subject: [PATCH 2/2] Remove unused animatedShouldDebounceQueueFlush feature flag (#57340) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: `animatedShouldDebounceQueueFlush` is no longer read anywhere — `NativeAnimatedHelper` now debounces the queue flush unconditionally. Remove the now-dead flag definition and its generated getter. Changelog: [Internal] Differential Revision: D109472811 --- .../featureflags/ReactNativeFeatureFlags.config.js | 11 ----------- .../private/featureflags/ReactNativeFeatureFlags.js | 8 +------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index 7519e7d5898..7de76c79254 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -970,17 +970,6 @@ const definitions: FeatureFlagDefinitions = { }, ossReleaseStage: 'none', }, - animatedShouldDebounceQueueFlush: { - defaultValue: true, - metadata: { - dateAdded: '2024-02-05', - description: - 'Enables an experimental flush-queue debouncing in Animated.js.', - expectedReleaseValue: true, - purpose: 'experimentation', - }, - ossReleaseStage: 'none', - }, animatedShouldSyncValueBeforeStartCallback: { defaultValue: true, metadata: { diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index 918b6b821aa..a0128c87b1a 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<<1a333a44919efce6bb2070bae79bdf9b>> * @flow strict * @noformat */ @@ -31,7 +31,6 @@ export type ReactNativeFeatureFlagsJsOnly = Readonly<{ jsOnlyTestFlag: Getter, animatedDeferStartOfTimingAnimations: Getter, animatedForceNativeDriver: Getter, - animatedShouldDebounceQueueFlush: Getter, animatedShouldSyncValueBeforeStartCallback: Getter, animatedShouldUseSingleOp: Getter, deferFlatListFocusChangeRenderUpdate: Getter, @@ -151,11 +150,6 @@ export const animatedDeferStartOfTimingAnimations: Getter = createJavaS */ export const animatedForceNativeDriver: Getter = createJavaScriptFlagGetter('animatedForceNativeDriver', false); -/** - * Enables an experimental flush-queue debouncing in Animated.js. - */ -export const animatedShouldDebounceQueueFlush: Getter = createJavaScriptFlagGetter('animatedShouldDebounceQueueFlush', true); - /** * When a useNativeDriver animation completes, syncs the JS-side AnimatedValue with the post-animation value BEFORE invoking the user-supplied start({finished}) callback. Without the flag, the callback observes the pre-animation value, which can cause downstream re-renders to read stale interpolation outputs. */