Skip to content

Commit 57c5eee

Browse files
rozelefacebook-github-bot
authored andcommitted
Delete animatedShouldSignalBatch feature flag (#52521)
Summary: Pull Request resolved: #52521 Progress is moving quickly on the cxxNativeAnimatedEnabled flag, which this animatedShouldSignalBatch was intended to de-risk. We no longer need this flag to de-risk issues with animated batch flushing. ## Changelog [Internal] Reviewed By: christophpurrer Differential Revision: D78005971 fbshipit-source-id: 719f1dfb0594fbe90dd6f08dea21ad20665832df
1 parent 586f5ba commit 57c5eee

23 files changed

Lines changed: 90 additions & 227 deletions

packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ - (void)initialize
5151
{
5252
// _surfacePresenter set in setSurfacePresenter:
5353
_nodesManager = [[RCTNativeAnimatedNodesManager alloc] initWithBridge:nil surfacePresenter:_surfacePresenter];
54-
if (!facebook::react::ReactNativeFeatureFlags::animatedShouldSignalBatch()) {
55-
[_surfacePresenter addObserver:self];
56-
}
54+
[_surfacePresenter addObserver:self];
5755
[[self.moduleRegistry moduleForName:"EventDispatcher"] addDispatchObserver:self];
5856
}
5957

@@ -62,9 +60,7 @@ - (void)invalidate
6260
[super invalidate];
6361
[_nodesManager stopAnimationLoop];
6462
[[self.moduleRegistry moduleForName:"EventDispatcher"] removeDispatchObserver:self];
65-
if (!facebook::react::ReactNativeFeatureFlags::animatedShouldSignalBatch()) {
66-
[_surfacePresenter removeObserver:self];
67-
}
63+
[_surfacePresenter removeObserver:self];
6864
}
6965

7066
/*
@@ -80,11 +76,7 @@ - (void)setSurfacePresenter:(id<RCTSurfacePresenterStub>)surfacePresenter
8076

8177
RCT_EXPORT_METHOD(startOperationBatch) {}
8278

83-
RCT_EXPORT_METHOD(finishOperationBatch)
84-
{
85-
// This method is only called from JS when animatedShouldSignalBatch is enabled.
86-
[self flushOperationQueues];
87-
}
79+
RCT_EXPORT_METHOD(finishOperationBatch) {}
8880

8981
RCT_EXPORT_METHOD(createAnimatedNode : (double)tag config : (NSDictionary<NSString *, id> *)config)
9082
{
@@ -259,39 +251,27 @@ - (void)setSurfacePresenter:(id<RCTSurfacePresenterStub>)surfacePresenter
259251

260252
- (void)queueFlushedOperationBlock:(AnimatedOperation)operation
261253
{
262-
if (facebook::react::ReactNativeFeatureFlags::animatedShouldSignalBatch()) {
254+
dispatch_async(RCTGetUIManagerQueue(), ^{
263255
[self addOperationBlock:operation];
264-
} else {
265-
dispatch_async(RCTGetUIManagerQueue(), ^{
266-
[self addOperationBlock:operation];
267-
// In Bridge, flushing of native animations is done from RCTCxxBridge batchDidComplete().
268-
// Since RCTCxxBridge doesn't exist in Bridgeless, and components are not remounted in Fabric for native
269-
// animations, flush here for changes in Animated.Value for Animated.event.
270-
[self flushOperationQueues];
271-
});
272-
}
256+
// In Bridge, flushing of native animations is done from RCTCxxBridge batchDidComplete().
257+
// Since RCTCxxBridge doesn't exist in Bridgeless, and components are not remounted in Fabric for native
258+
// animations, flush here for changes in Animated.Value for Animated.event.
259+
[self flushOperationQueues];
260+
});
273261
}
274262

275263
- (void)queueOperationBlock:(AnimatedOperation)operation
276264
{
277-
if (facebook::react::ReactNativeFeatureFlags::animatedShouldSignalBatch()) {
265+
dispatch_async(RCTGetUIManagerQueue(), ^{
278266
[self addOperationBlock:operation];
279-
} else {
280-
dispatch_async(RCTGetUIManagerQueue(), ^{
281-
[self addOperationBlock:operation];
282-
});
283-
}
267+
});
284268
}
285269

286270
- (void)queuePreOperationBlock:(AnimatedOperation)operation
287271
{
288-
if (facebook::react::ReactNativeFeatureFlags::animatedShouldSignalBatch()) {
272+
dispatch_async(RCTGetUIManagerQueue(), ^{
289273
[self addPreOperationBlock:operation];
290-
} else {
291-
dispatch_async(RCTGetUIManagerQueue(), ^{
292-
[self addPreOperationBlock:operation];
293-
});
294-
}
274+
});
295275
}
296276

297277
- (void)addOperationBlock:(AnimatedOperation)operation

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<a4a7c66f4603fc6a56018aba12c942ee>>
7+
* @generated SignedSource<<48a25f3bf3e45c8864f84a8cccca473d>>
88
*/
99

1010
/**
@@ -36,12 +36,6 @@ public object ReactNativeFeatureFlags {
3636
@JvmStatic
3737
public fun commonTestFlag(): Boolean = accessor.commonTestFlag()
3838

39-
/**
40-
* Enables start- and finishOperationBatch on any platform.
41-
*/
42-
@JvmStatic
43-
public fun animatedShouldSignalBatch(): Boolean = accessor.animatedShouldSignalBatch()
44-
4539
/**
4640
* Use a C++ implementation of Native Animated instead of the platform implementation.
4741
*/

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

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<9b6d83d6ea0acbc13bce19d869699079>>
7+
* @generated SignedSource<<a2faaafc4bf1b41b69ea4341a16eeb76>>
88
*/
99

1010
/**
@@ -21,7 +21,6 @@ package com.facebook.react.internal.featureflags
2121

2222
internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccessor {
2323
private var commonTestFlagCache: Boolean? = null
24-
private var animatedShouldSignalBatchCache: Boolean? = null
2524
private var cxxNativeAnimatedEnabledCache: Boolean? = null
2625
private var cxxNativeAnimatedRemoveJsSyncCache: Boolean? = null
2726
private var disableMainQueueSyncDispatchIOSCache: Boolean? = null
@@ -88,15 +87,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
8887
return cached
8988
}
9089

91-
override fun animatedShouldSignalBatch(): Boolean {
92-
var cached = animatedShouldSignalBatchCache
93-
if (cached == null) {
94-
cached = ReactNativeFeatureFlagsCxxInterop.animatedShouldSignalBatch()
95-
animatedShouldSignalBatchCache = cached
96-
}
97-
return cached
98-
}
99-
10090
override fun cxxNativeAnimatedEnabled(): Boolean {
10191
var cached = cxxNativeAnimatedEnabledCache
10292
if (cached == null) {

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<75760457dea789ab0951d3a22be3341c>>
7+
* @generated SignedSource<<e72a46d573dedebd70f763843eb459fa>>
88
*/
99

1010
/**
@@ -30,8 +30,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
3030

3131
@DoNotStrip @JvmStatic public external fun commonTestFlag(): Boolean
3232

33-
@DoNotStrip @JvmStatic public external fun animatedShouldSignalBatch(): Boolean
34-
3533
@DoNotStrip @JvmStatic public external fun cxxNativeAnimatedEnabled(): Boolean
3634

3735
@DoNotStrip @JvmStatic public external fun cxxNativeAnimatedRemoveJsSync(): Boolean

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<48fa8921cc2947a713974c9926e1d806>>
7+
* @generated SignedSource<<c7dc0406f2a4e8b4bedde09e8dec5b07>>
88
*/
99

1010
/**
@@ -25,8 +25,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
2525

2626
override fun commonTestFlag(): Boolean = false
2727

28-
override fun animatedShouldSignalBatch(): Boolean = false
29-
3028
override fun cxxNativeAnimatedEnabled(): Boolean = false
3129

3230
override fun cxxNativeAnimatedRemoveJsSync(): Boolean = false

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<356261385b837def94ac5a4ca7ffd05d>>
7+
* @generated SignedSource<<5e082a56b9e6594828e50e2dfef76ea9>>
88
*/
99

1010
/**
@@ -25,7 +25,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
2525
private val accessedFeatureFlags = mutableSetOf<String>()
2626

2727
private var commonTestFlagCache: Boolean? = null
28-
private var animatedShouldSignalBatchCache: Boolean? = null
2928
private var cxxNativeAnimatedEnabledCache: Boolean? = null
3029
private var cxxNativeAnimatedRemoveJsSyncCache: Boolean? = null
3130
private var disableMainQueueSyncDispatchIOSCache: Boolean? = null
@@ -93,16 +92,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
9392
return cached
9493
}
9594

96-
override fun animatedShouldSignalBatch(): Boolean {
97-
var cached = animatedShouldSignalBatchCache
98-
if (cached == null) {
99-
cached = currentProvider.animatedShouldSignalBatch()
100-
accessedFeatureFlags.add("animatedShouldSignalBatch")
101-
animatedShouldSignalBatchCache = cached
102-
}
103-
return cached
104-
}
105-
10695
override fun cxxNativeAnimatedEnabled(): Boolean {
10796
var cached = cxxNativeAnimatedEnabledCache
10897
if (cached == null) {

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<8abf9bfb81265ae0c840457eb6c199bd>>
7+
* @generated SignedSource<<d6de753a08bc272f918066ad90fda301>>
88
*/
99

1010
/**
@@ -25,8 +25,6 @@ import com.facebook.proguard.annotations.DoNotStrip
2525
public interface ReactNativeFeatureFlagsProvider {
2626
@DoNotStrip public fun commonTestFlag(): Boolean
2727

28-
@DoNotStrip public fun animatedShouldSignalBatch(): Boolean
29-
3028
@DoNotStrip public fun cxxNativeAnimatedEnabled(): Boolean
3129

3230
@DoNotStrip public fun cxxNativeAnimatedRemoveJsSync(): Boolean

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

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<5effd7d4ac8034424144ea68c82b61a7>>
7+
* @generated SignedSource<<d2e4ec09356f6857d789cfcc44a83552>>
88
*/
99

1010
/**
@@ -45,12 +45,6 @@ class ReactNativeFeatureFlagsJavaProvider
4545
return method(javaProvider_);
4646
}
4747

48-
bool animatedShouldSignalBatch() override {
49-
static const auto method =
50-
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("animatedShouldSignalBatch");
51-
return method(javaProvider_);
52-
}
53-
5448
bool cxxNativeAnimatedEnabled() override {
5549
static const auto method =
5650
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("cxxNativeAnimatedEnabled");
@@ -396,11 +390,6 @@ bool JReactNativeFeatureFlagsCxxInterop::commonTestFlag(
396390
return ReactNativeFeatureFlags::commonTestFlag();
397391
}
398392

399-
bool JReactNativeFeatureFlagsCxxInterop::animatedShouldSignalBatch(
400-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
401-
return ReactNativeFeatureFlags::animatedShouldSignalBatch();
402-
}
403-
404393
bool JReactNativeFeatureFlagsCxxInterop::cxxNativeAnimatedEnabled(
405394
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
406395
return ReactNativeFeatureFlags::cxxNativeAnimatedEnabled();
@@ -715,9 +704,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
715704
makeNativeMethod(
716705
"commonTestFlag",
717706
JReactNativeFeatureFlagsCxxInterop::commonTestFlag),
718-
makeNativeMethod(
719-
"animatedShouldSignalBatch",
720-
JReactNativeFeatureFlagsCxxInterop::animatedShouldSignalBatch),
721707
makeNativeMethod(
722708
"cxxNativeAnimatedEnabled",
723709
JReactNativeFeatureFlagsCxxInterop::cxxNativeAnimatedEnabled),

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<f7bf09b9287dc649901b99ca3f250c28>>
7+
* @generated SignedSource<<a8d656adc624995ca1e6720829889cb8>>
88
*/
99

1010
/**
@@ -33,9 +33,6 @@ class JReactNativeFeatureFlagsCxxInterop
3333
static bool commonTestFlag(
3434
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
3535

36-
static bool animatedShouldSignalBatch(
37-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
38-
3936
static bool cxxNativeAnimatedEnabled(
4037
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
4138

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<20c25bf5541e37cd5c918684925726df>>
7+
* @generated SignedSource<<1f167a2a71f07b355dc8578cb114cc6f>>
88
*/
99

1010
/**
@@ -30,10 +30,6 @@ bool ReactNativeFeatureFlags::commonTestFlag() {
3030
return getAccessor().commonTestFlag();
3131
}
3232

33-
bool ReactNativeFeatureFlags::animatedShouldSignalBatch() {
34-
return getAccessor().animatedShouldSignalBatch();
35-
}
36-
3733
bool ReactNativeFeatureFlags::cxxNativeAnimatedEnabled() {
3834
return getAccessor().cxxNativeAnimatedEnabled();
3935
}

0 commit comments

Comments
 (0)