Skip to content

Commit 5774bd1

Browse files
zeyapfacebook-github-bot
authored andcommitted
create FeatureFlag overrideBySynchronousMountPropsAtMountingAndroid (#53603)
Summary: Pull Request resolved: #53603 ## Changelog: [General] [Added] - create FeatureFlag overrideBySynchronousMountPropsAtMountingAndroid Reviewed By: rshest Differential Revision: D81690079 fbshipit-source-id: cb381004135ef9cd072c6f99703d9e7f4a40dd6a
1 parent 3a3f3a4 commit 5774bd1

20 files changed

Lines changed: 157 additions & 40 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<<92a6edded037a504fc1c2c8ae88deae1>>
7+
* @generated SignedSource<<c217318f9f313103ca31d8e7698851d8>>
88
*/
99

1010
/**
@@ -324,6 +324,12 @@ public object ReactNativeFeatureFlags {
324324
@JvmStatic
325325
public fun hideOffscreenVirtualViewsOnIOS(): Boolean = accessor.hideOffscreenVirtualViewsOnIOS()
326326

327+
/**
328+
* Override props at mounting with synchronously mounted (i.e. direct manipulation) props from Native Animated.
329+
*/
330+
@JvmStatic
331+
public fun overrideBySynchronousMountPropsAtMountingAndroid(): Boolean = accessor.overrideBySynchronousMountPropsAtMountingAndroid()
332+
327333
/**
328334
* Enable the V2 in-app Performance Monitor. This flag is global and should not be changed across React Host lifetimes.
329335
*/

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<<ebbc6602fc8e3fb4c510bbd47361a7f0>>
7+
* @generated SignedSource<<4ed350d8dfa42caf27d346dfcfbed974>>
88
*/
99

1010
/**
@@ -69,6 +69,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
6969
private var fuseboxEnabledReleaseCache: Boolean? = null
7070
private var fuseboxNetworkInspectionEnabledCache: Boolean? = null
7171
private var hideOffscreenVirtualViewsOnIOSCache: Boolean? = null
72+
private var overrideBySynchronousMountPropsAtMountingAndroidCache: Boolean? = null
7273
private var perfMonitorV2EnabledCache: Boolean? = null
7374
private var preparedTextCacheSizeCache: Double? = null
7475
private var preventShadowTreeCommitExhaustionCache: Boolean? = null
@@ -531,6 +532,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
531532
return cached
532533
}
533534

535+
override fun overrideBySynchronousMountPropsAtMountingAndroid(): Boolean {
536+
var cached = overrideBySynchronousMountPropsAtMountingAndroidCache
537+
if (cached == null) {
538+
cached = ReactNativeFeatureFlagsCxxInterop.overrideBySynchronousMountPropsAtMountingAndroid()
539+
overrideBySynchronousMountPropsAtMountingAndroidCache = cached
540+
}
541+
return cached
542+
}
543+
534544
override fun perfMonitorV2Enabled(): Boolean {
535545
var cached = perfMonitorV2EnabledCache
536546
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<<4410628511f112f3eef22434a05fa757>>
7+
* @generated SignedSource<<6c201de02071a834e411b6761d7f863b>>
88
*/
99

1010
/**
@@ -126,6 +126,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
126126

127127
@DoNotStrip @JvmStatic public external fun hideOffscreenVirtualViewsOnIOS(): Boolean
128128

129+
@DoNotStrip @JvmStatic public external fun overrideBySynchronousMountPropsAtMountingAndroid(): Boolean
130+
129131
@DoNotStrip @JvmStatic public external fun perfMonitorV2Enabled(): Boolean
130132

131133
@DoNotStrip @JvmStatic public external fun preparedTextCacheSize(): Double

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<<c2662bb149153d80e1b42029f7377eb9>>
7+
* @generated SignedSource<<88256ff0f51c33caee5af50bb3424288>>
88
*/
99

1010
/**
@@ -121,6 +121,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
121121

122122
override fun hideOffscreenVirtualViewsOnIOS(): Boolean = false
123123

124+
override fun overrideBySynchronousMountPropsAtMountingAndroid(): Boolean = false
125+
124126
override fun perfMonitorV2Enabled(): Boolean = false
125127

126128
override fun preparedTextCacheSize(): Double = 200.0

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<<2f65e0e9066a8c2c35c44ea7c73dbedc>>
7+
* @generated SignedSource<<57fca2370d6b3f1edf7045a0b4c94350>>
88
*/
99

1010
/**
@@ -73,6 +73,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
7373
private var fuseboxEnabledReleaseCache: Boolean? = null
7474
private var fuseboxNetworkInspectionEnabledCache: Boolean? = null
7575
private var hideOffscreenVirtualViewsOnIOSCache: Boolean? = null
76+
private var overrideBySynchronousMountPropsAtMountingAndroidCache: Boolean? = null
7677
private var perfMonitorV2EnabledCache: Boolean? = null
7778
private var preparedTextCacheSizeCache: Double? = null
7879
private var preventShadowTreeCommitExhaustionCache: Boolean? = null
@@ -584,6 +585,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
584585
return cached
585586
}
586587

588+
override fun overrideBySynchronousMountPropsAtMountingAndroid(): Boolean {
589+
var cached = overrideBySynchronousMountPropsAtMountingAndroidCache
590+
if (cached == null) {
591+
cached = currentProvider.overrideBySynchronousMountPropsAtMountingAndroid()
592+
accessedFeatureFlags.add("overrideBySynchronousMountPropsAtMountingAndroid")
593+
overrideBySynchronousMountPropsAtMountingAndroidCache = cached
594+
}
595+
return cached
596+
}
597+
587598
override fun perfMonitorV2Enabled(): Boolean {
588599
var cached = perfMonitorV2EnabledCache
589600
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<<e97601660cfd4f614ac934ba20ca4635>>
7+
* @generated SignedSource<<ef31518f0fe8ff6f6a5c15936cab9d87>>
88
*/
99

1010
/**
@@ -121,6 +121,8 @@ public interface ReactNativeFeatureFlagsProvider {
121121

122122
@DoNotStrip public fun hideOffscreenVirtualViewsOnIOS(): Boolean
123123

124+
@DoNotStrip public fun overrideBySynchronousMountPropsAtMountingAndroid(): Boolean
125+
124126
@DoNotStrip public fun perfMonitorV2Enabled(): Boolean
125127

126128
@DoNotStrip public fun preparedTextCacheSize(): Double

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<<f9c4f8d97edff1b016873b0a6121b76b>>
7+
* @generated SignedSource<<846db2d7c3c6020dec04789fe2784f8a>>
88
*/
99

1010
/**
@@ -333,6 +333,12 @@ class ReactNativeFeatureFlagsJavaProvider
333333
return method(javaProvider_);
334334
}
335335

336+
bool overrideBySynchronousMountPropsAtMountingAndroid() override {
337+
static const auto method =
338+
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("overrideBySynchronousMountPropsAtMountingAndroid");
339+
return method(javaProvider_);
340+
}
341+
336342
bool perfMonitorV2Enabled() override {
337343
static const auto method =
338344
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("perfMonitorV2Enabled");
@@ -702,6 +708,11 @@ bool JReactNativeFeatureFlagsCxxInterop::hideOffscreenVirtualViewsOnIOS(
702708
return ReactNativeFeatureFlags::hideOffscreenVirtualViewsOnIOS();
703709
}
704710

711+
bool JReactNativeFeatureFlagsCxxInterop::overrideBySynchronousMountPropsAtMountingAndroid(
712+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
713+
return ReactNativeFeatureFlags::overrideBySynchronousMountPropsAtMountingAndroid();
714+
}
715+
705716
bool JReactNativeFeatureFlagsCxxInterop::perfMonitorV2Enabled(
706717
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
707718
return ReactNativeFeatureFlags::perfMonitorV2Enabled();
@@ -980,6 +991,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
980991
makeNativeMethod(
981992
"hideOffscreenVirtualViewsOnIOS",
982993
JReactNativeFeatureFlagsCxxInterop::hideOffscreenVirtualViewsOnIOS),
994+
makeNativeMethod(
995+
"overrideBySynchronousMountPropsAtMountingAndroid",
996+
JReactNativeFeatureFlagsCxxInterop::overrideBySynchronousMountPropsAtMountingAndroid),
983997
makeNativeMethod(
984998
"perfMonitorV2Enabled",
985999
JReactNativeFeatureFlagsCxxInterop::perfMonitorV2Enabled),

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<<6a98f8398948f8d56e51d3eff19c5d05>>
7+
* @generated SignedSource<<e4d45c3e12ab378a5b99d14f7f0ed4fd>>
88
*/
99

1010
/**
@@ -177,6 +177,9 @@ class JReactNativeFeatureFlagsCxxInterop
177177
static bool hideOffscreenVirtualViewsOnIOS(
178178
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
179179

180+
static bool overrideBySynchronousMountPropsAtMountingAndroid(
181+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
182+
180183
static bool perfMonitorV2Enabled(
181184
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
182185

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<<5bd932f1d52596dad6ea86a2674170ff>>
7+
* @generated SignedSource<<fd6af2db2dd4735d70d888bc9fd9487d>>
88
*/
99

1010
/**
@@ -222,6 +222,10 @@ bool ReactNativeFeatureFlags::hideOffscreenVirtualViewsOnIOS() {
222222
return getAccessor().hideOffscreenVirtualViewsOnIOS();
223223
}
224224

225+
bool ReactNativeFeatureFlags::overrideBySynchronousMountPropsAtMountingAndroid() {
226+
return getAccessor().overrideBySynchronousMountPropsAtMountingAndroid();
227+
}
228+
225229
bool ReactNativeFeatureFlags::perfMonitorV2Enabled() {
226230
return getAccessor().perfMonitorV2Enabled();
227231
}

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<<3cde1e9bcf234515551ba57ecf02e3a7>>
7+
* @generated SignedSource<<8979be03db13b9f45d313018192c0c35>>
88
*/
99

1010
/**
@@ -284,6 +284,11 @@ class ReactNativeFeatureFlags {
284284
*/
285285
RN_EXPORT static bool hideOffscreenVirtualViewsOnIOS();
286286

287+
/**
288+
* Override props at mounting with synchronously mounted (i.e. direct manipulation) props from Native Animated.
289+
*/
290+
RN_EXPORT static bool overrideBySynchronousMountPropsAtMountingAndroid();
291+
287292
/**
288293
* Enable the V2 in-app Performance Monitor. This flag is global and should not be changed across React Host lifetimes.
289294
*/

0 commit comments

Comments
 (0)