Skip to content

Commit 99c60bf

Browse files
zeyapfacebook-github-bot
authored andcommitted
Create feature flag cxxNativeAnimatedRemoveJsSync (#52067)
Summary: Pull Request resolved: #52067 ## Changelog: [Internal] [Changed] - Create feature flag cxxNativeAnimatedRemoveJsSync for optimization in cxx animated Reviewed By: christophpurrer Differential Revision: D76763197 fbshipit-source-id: 503d7cea53b6a5c3ed769b0d77a9d64730029433
1 parent a477ee6 commit 99c60bf

20 files changed

Lines changed: 185 additions & 69 deletions

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

Lines changed: 7 additions & 1 deletion
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<<4c40e490481c50d2f19830366f50aad5>>
7+
* @generated SignedSource<<d8013c4b4ec45f241908e7f8f23f7dd1>>
88
*/
99

1010
/**
@@ -48,6 +48,12 @@ public object ReactNativeFeatureFlags {
4848
@JvmStatic
4949
public fun cxxNativeAnimatedEnabled(): Boolean = accessor.cxxNativeAnimatedEnabled()
5050

51+
/**
52+
* Removes JS sync at end of native animation
53+
*/
54+
@JvmStatic
55+
public fun cxxNativeAnimatedRemoveJsSync(): Boolean = accessor.cxxNativeAnimatedRemoveJsSync()
56+
5157
/**
5258
* Disable sync dispatch on the main queue on iOS
5359
*/

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

Lines changed: 11 additions & 1 deletion
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<<8cb9eb082005be480c39272ffc7dde03>>
7+
* @generated SignedSource<<15b001b69d9ea8bedbce2ce0f70bfa8e>>
88
*/
99

1010
/**
@@ -23,6 +23,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
2323
private var commonTestFlagCache: Boolean? = null
2424
private var animatedShouldSignalBatchCache: Boolean? = null
2525
private var cxxNativeAnimatedEnabledCache: Boolean? = null
26+
private var cxxNativeAnimatedRemoveJsSyncCache: Boolean? = null
2627
private var disableMainQueueSyncDispatchIOSCache: Boolean? = null
2728
private var disableMountItemReorderingAndroidCache: Boolean? = null
2829
private var disableTextLayoutManagerCacheAndroidCache: Boolean? = null
@@ -100,6 +101,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
100101
return cached
101102
}
102103

104+
override fun cxxNativeAnimatedRemoveJsSync(): Boolean {
105+
var cached = cxxNativeAnimatedRemoveJsSyncCache
106+
if (cached == null) {
107+
cached = ReactNativeFeatureFlagsCxxInterop.cxxNativeAnimatedRemoveJsSync()
108+
cxxNativeAnimatedRemoveJsSyncCache = cached
109+
}
110+
return cached
111+
}
112+
103113
override fun disableMainQueueSyncDispatchIOS(): Boolean {
104114
var cached = disableMainQueueSyncDispatchIOSCache
105115
if (cached == null) {

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

Lines changed: 3 additions & 1 deletion
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<<b6ddd7c2e829c427e7d6b07bc588cd8c>>
7+
* @generated SignedSource<<dc8ac9241675deb1324d8ff0572f2fad>>
88
*/
99

1010
/**
@@ -34,6 +34,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
3434

3535
@DoNotStrip @JvmStatic public external fun cxxNativeAnimatedEnabled(): Boolean
3636

37+
@DoNotStrip @JvmStatic public external fun cxxNativeAnimatedRemoveJsSync(): Boolean
38+
3739
@DoNotStrip @JvmStatic public external fun disableMainQueueSyncDispatchIOS(): Boolean
3840

3941
@DoNotStrip @JvmStatic public external fun disableMountItemReorderingAndroid(): Boolean

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

Lines changed: 3 additions & 1 deletion
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<<76edde93369be682e837189f82871dfe>>
7+
* @generated SignedSource<<56835f26710665a11a05879a0c90e577>>
88
*/
99

1010
/**
@@ -29,6 +29,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
2929

3030
override fun cxxNativeAnimatedEnabled(): Boolean = false
3131

32+
override fun cxxNativeAnimatedRemoveJsSync(): Boolean = false
33+
3234
override fun disableMainQueueSyncDispatchIOS(): Boolean = false
3335

3436
override fun disableMountItemReorderingAndroid(): Boolean = false

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

Lines changed: 12 additions & 1 deletion
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<<e718763435de15f788b1f510e4799a67>>
7+
* @generated SignedSource<<a6444cccfff813fe0e96c20855496560>>
88
*/
99

1010
/**
@@ -27,6 +27,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
2727
private var commonTestFlagCache: Boolean? = null
2828
private var animatedShouldSignalBatchCache: Boolean? = null
2929
private var cxxNativeAnimatedEnabledCache: Boolean? = null
30+
private var cxxNativeAnimatedRemoveJsSyncCache: Boolean? = null
3031
private var disableMainQueueSyncDispatchIOSCache: Boolean? = null
3132
private var disableMountItemReorderingAndroidCache: Boolean? = null
3233
private var disableTextLayoutManagerCacheAndroidCache: Boolean? = null
@@ -107,6 +108,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
107108
return cached
108109
}
109110

111+
override fun cxxNativeAnimatedRemoveJsSync(): Boolean {
112+
var cached = cxxNativeAnimatedRemoveJsSyncCache
113+
if (cached == null) {
114+
cached = currentProvider.cxxNativeAnimatedRemoveJsSync()
115+
accessedFeatureFlags.add("cxxNativeAnimatedRemoveJsSync")
116+
cxxNativeAnimatedRemoveJsSyncCache = cached
117+
}
118+
return cached
119+
}
120+
110121
override fun disableMainQueueSyncDispatchIOS(): Boolean {
111122
var cached = disableMainQueueSyncDispatchIOSCache
112123
if (cached == null) {

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

Lines changed: 3 additions & 1 deletion
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<<892db232156970e8241d1f1ddde3a745>>
7+
* @generated SignedSource<<e671a1bb72c4b5afcd6f364f05666e89>>
88
*/
99

1010
/**
@@ -29,6 +29,8 @@ public interface ReactNativeFeatureFlagsProvider {
2929

3030
@DoNotStrip public fun cxxNativeAnimatedEnabled(): Boolean
3131

32+
@DoNotStrip public fun cxxNativeAnimatedRemoveJsSync(): Boolean
33+
3234
@DoNotStrip public fun disableMainQueueSyncDispatchIOS(): Boolean
3335

3436
@DoNotStrip public fun disableMountItemReorderingAndroid(): Boolean

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

Lines changed: 15 additions & 1 deletion
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<<bb0b241f561c9c443d6453fa259d0a5d>>
7+
* @generated SignedSource<<b9aef65ab7a1dffc1646519619dedc58>>
88
*/
99

1010
/**
@@ -57,6 +57,12 @@ class ReactNativeFeatureFlagsJavaProvider
5757
return method(javaProvider_);
5858
}
5959

60+
bool cxxNativeAnimatedRemoveJsSync() override {
61+
static const auto method =
62+
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("cxxNativeAnimatedRemoveJsSync");
63+
return method(javaProvider_);
64+
}
65+
6066
bool disableMainQueueSyncDispatchIOS() override {
6167
static const auto method =
6268
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("disableMainQueueSyncDispatchIOS");
@@ -370,6 +376,11 @@ bool JReactNativeFeatureFlagsCxxInterop::cxxNativeAnimatedEnabled(
370376
return ReactNativeFeatureFlags::cxxNativeAnimatedEnabled();
371377
}
372378

379+
bool JReactNativeFeatureFlagsCxxInterop::cxxNativeAnimatedRemoveJsSync(
380+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
381+
return ReactNativeFeatureFlags::cxxNativeAnimatedRemoveJsSync();
382+
}
383+
373384
bool JReactNativeFeatureFlagsCxxInterop::disableMainQueueSyncDispatchIOS(
374385
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
375386
return ReactNativeFeatureFlags::disableMainQueueSyncDispatchIOS();
@@ -655,6 +666,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
655666
makeNativeMethod(
656667
"cxxNativeAnimatedEnabled",
657668
JReactNativeFeatureFlagsCxxInterop::cxxNativeAnimatedEnabled),
669+
makeNativeMethod(
670+
"cxxNativeAnimatedRemoveJsSync",
671+
JReactNativeFeatureFlagsCxxInterop::cxxNativeAnimatedRemoveJsSync),
658672
makeNativeMethod(
659673
"disableMainQueueSyncDispatchIOS",
660674
JReactNativeFeatureFlagsCxxInterop::disableMainQueueSyncDispatchIOS),

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

Lines changed: 4 additions & 1 deletion
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<<04986fa84ec60aa0816ee79ab68e56aa>>
7+
* @generated SignedSource<<f2c3bfb76a9efd7d5bc6c01ab1cccb2c>>
88
*/
99

1010
/**
@@ -39,6 +39,9 @@ class JReactNativeFeatureFlagsCxxInterop
3939
static bool cxxNativeAnimatedEnabled(
4040
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
4141

42+
static bool cxxNativeAnimatedRemoveJsSync(
43+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
44+
4245
static bool disableMainQueueSyncDispatchIOS(
4346
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
4447

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

Lines changed: 5 additions & 1 deletion
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<<96d8201a39879e04c384303d1087a0b0>>
7+
* @generated SignedSource<<f0d437a484030567e820239e1b854a51>>
88
*/
99

1010
/**
@@ -38,6 +38,10 @@ bool ReactNativeFeatureFlags::cxxNativeAnimatedEnabled() {
3838
return getAccessor().cxxNativeAnimatedEnabled();
3939
}
4040

41+
bool ReactNativeFeatureFlags::cxxNativeAnimatedRemoveJsSync() {
42+
return getAccessor().cxxNativeAnimatedRemoveJsSync();
43+
}
44+
4145
bool ReactNativeFeatureFlags::disableMainQueueSyncDispatchIOS() {
4246
return getAccessor().disableMainQueueSyncDispatchIOS();
4347
}

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

Lines changed: 6 additions & 1 deletion
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<<25b3585f3648fe156fab4a5abbf32e60>>
7+
* @generated SignedSource<<8112c62255be23bde3fc558953dc8b67>>
88
*/
99

1010
/**
@@ -54,6 +54,11 @@ class ReactNativeFeatureFlags {
5454
*/
5555
RN_EXPORT static bool cxxNativeAnimatedEnabled();
5656

57+
/**
58+
* Removes JS sync at end of native animation
59+
*/
60+
RN_EXPORT static bool cxxNativeAnimatedRemoveJsSync();
61+
5762
/**
5863
* Disable sync dispatch on the main queue on iOS
5964
*/

0 commit comments

Comments
 (0)