Skip to content

Commit ff094d8

Browse files
rubennortefacebook-github-bot
authored andcommitted
Clean up feature flag for mount hooks on Android (#44206)
Summary: Pull Request resolved: #44206 Changelog: [internal] We finally managed to implement mount hooks without reliability issues on Android, so we can clean up the feature flag and enable it unconditionally. Reviewed By: cortinico Differential Revision: D56467379 fbshipit-source-id: d797ec770b731135332bc9f39df1c1e684b3bde4
1 parent 0a80270 commit ff094d8

20 files changed

+30
-134
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,9 +1233,7 @@ public void didMountItems(@Nullable List<MountItem> mountItems) {
12331233
listener.didMountItems(FabricUIManager.this);
12341234
}
12351235

1236-
if (!ReactNativeFeatureFlags.enableMountHooksAndroid()
1237-
|| mountItems == null
1238-
|| mountItems.isEmpty()) {
1236+
if (mountItems == null || mountItems.isEmpty()) {
12391237
return;
12401238
}
12411239

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<<61b929b9624eeaedfa12d2f390299447>>
7+
* @generated SignedSource<<8915b173bf7bc423cff555366f522615>>
88
*/
99

1010
/**
@@ -64,12 +64,6 @@ public object ReactNativeFeatureFlags {
6464
@JvmStatic
6565
public fun enableMicrotasks(): Boolean = accessor.enableMicrotasks()
6666

67-
/**
68-
* Enables the notification of mount operations to mount hooks on Android.
69-
*/
70-
@JvmStatic
71-
public fun enableMountHooksAndroid(): Boolean = accessor.enableMountHooksAndroid()
72-
7367
/**
7468
* Uses new, deduplicated logic for constructing Android Spannables from text fragments
7569
*/

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<<46e1a8dd088d588ea9eec703d7155710>>
7+
* @generated SignedSource<<f7e306b346e95ea68be34c7d7708c316>>
88
*/
99

1010
/**
@@ -26,7 +26,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
2626
private var enableCleanTextInputYogaNodeCache: Boolean? = null
2727
private var enableCustomDrawOrderFabricCache: Boolean? = null
2828
private var enableMicrotasksCache: Boolean? = null
29-
private var enableMountHooksAndroidCache: Boolean? = null
3029
private var enableSpannableBuildingUnificationCache: Boolean? = null
3130
private var enableSynchronousStateUpdatesCache: Boolean? = null
3231
private var enableUIConsistencyCache: Boolean? = null
@@ -92,15 +91,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
9291
return cached
9392
}
9493

95-
override fun enableMountHooksAndroid(): Boolean {
96-
var cached = enableMountHooksAndroidCache
97-
if (cached == null) {
98-
cached = ReactNativeFeatureFlagsCxxInterop.enableMountHooksAndroid()
99-
enableMountHooksAndroidCache = cached
100-
}
101-
return cached
102-
}
103-
10494
override fun enableSpannableBuildingUnification(): Boolean {
10595
var cached = enableSpannableBuildingUnificationCache
10696
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<<56ac4a5eaf65775fdb757fc10ed82908>>
7+
* @generated SignedSource<<43d74c7b95ae537455e1aafe7daeb397>>
88
*/
99

1010
/**
@@ -40,8 +40,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
4040

4141
@DoNotStrip @JvmStatic public external fun enableMicrotasks(): Boolean
4242

43-
@DoNotStrip @JvmStatic public external fun enableMountHooksAndroid(): Boolean
44-
4543
@DoNotStrip @JvmStatic public external fun enableSpannableBuildingUnification(): Boolean
4644

4745
@DoNotStrip @JvmStatic public external fun enableSynchronousStateUpdates(): 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<<6cc4fccd13a1e426a2d6a2a24530e5e6>>
7+
* @generated SignedSource<<c6c02b3249add27dd868af02151235aa>>
88
*/
99

1010
/**
@@ -35,8 +35,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
3535

3636
override fun enableMicrotasks(): Boolean = false
3737

38-
override fun enableMountHooksAndroid(): Boolean = false
39-
4038
override fun enableSpannableBuildingUnification(): Boolean = false
4139

4240
override fun enableSynchronousStateUpdates(): 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<<c1c7546acade83cf63f3c06e78352982>>
7+
* @generated SignedSource<<919173dae59866dbd93ccbfa3a7f9118>>
88
*/
99

1010
/**
@@ -30,7 +30,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
3030
private var enableCleanTextInputYogaNodeCache: Boolean? = null
3131
private var enableCustomDrawOrderFabricCache: Boolean? = null
3232
private var enableMicrotasksCache: Boolean? = null
33-
private var enableMountHooksAndroidCache: Boolean? = null
3433
private var enableSpannableBuildingUnificationCache: Boolean? = null
3534
private var enableSynchronousStateUpdatesCache: Boolean? = null
3635
private var enableUIConsistencyCache: Boolean? = null
@@ -102,16 +101,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
102101
return cached
103102
}
104103

105-
override fun enableMountHooksAndroid(): Boolean {
106-
var cached = enableMountHooksAndroidCache
107-
if (cached == null) {
108-
cached = currentProvider.enableMountHooksAndroid()
109-
accessedFeatureFlags.add("enableMountHooksAndroid")
110-
enableMountHooksAndroidCache = cached
111-
}
112-
return cached
113-
}
114-
115104
override fun enableSpannableBuildingUnification(): Boolean {
116105
var cached = enableSpannableBuildingUnificationCache
117106
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<<a5cbe59693a5f7d64af6e004951ab971>>
7+
* @generated SignedSource<<a022c7f29ebb4b7351253a32efe6203a>>
88
*/
99

1010
/**
@@ -35,8 +35,6 @@ public interface ReactNativeFeatureFlagsProvider {
3535

3636
@DoNotStrip public fun enableMicrotasks(): Boolean
3737

38-
@DoNotStrip public fun enableMountHooksAndroid(): Boolean
39-
4038
@DoNotStrip public fun enableSpannableBuildingUnification(): Boolean
4139

4240
@DoNotStrip public fun enableSynchronousStateUpdates(): 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<<f8ac6f7e857808ade5d0f26ec7924604>>
7+
* @generated SignedSource<<63bb565e7ab5a1e16ce5f9a7d0b93303>>
88
*/
99

1010
/**
@@ -75,12 +75,6 @@ class ReactNativeFeatureFlagsProviderHolder
7575
return method(javaProvider_);
7676
}
7777

78-
bool enableMountHooksAndroid() override {
79-
static const auto method =
80-
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableMountHooksAndroid");
81-
return method(javaProvider_);
82-
}
83-
8478
bool enableSpannableBuildingUnification() override {
8579
static const auto method =
8680
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableSpannableBuildingUnification");
@@ -175,11 +169,6 @@ bool JReactNativeFeatureFlagsCxxInterop::enableMicrotasks(
175169
return ReactNativeFeatureFlags::enableMicrotasks();
176170
}
177171

178-
bool JReactNativeFeatureFlagsCxxInterop::enableMountHooksAndroid(
179-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
180-
return ReactNativeFeatureFlags::enableMountHooksAndroid();
181-
}
182-
183172
bool JReactNativeFeatureFlagsCxxInterop::enableSpannableBuildingUnification(
184173
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
185174
return ReactNativeFeatureFlags::enableSpannableBuildingUnification();
@@ -265,9 +254,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
265254
makeNativeMethod(
266255
"enableMicrotasks",
267256
JReactNativeFeatureFlagsCxxInterop::enableMicrotasks),
268-
makeNativeMethod(
269-
"enableMountHooksAndroid",
270-
JReactNativeFeatureFlagsCxxInterop::enableMountHooksAndroid),
271257
makeNativeMethod(
272258
"enableSpannableBuildingUnification",
273259
JReactNativeFeatureFlagsCxxInterop::enableSpannableBuildingUnification),

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<<a6b8839cf6f9e87848289a8c5c37a5c8>>
7+
* @generated SignedSource<<c676d8771641013158d8b07a19ba556b>>
88
*/
99

1010
/**
@@ -48,9 +48,6 @@ class JReactNativeFeatureFlagsCxxInterop
4848
static bool enableMicrotasks(
4949
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
5050

51-
static bool enableMountHooksAndroid(
52-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
53-
5451
static bool enableSpannableBuildingUnification(
5552
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
5653

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<<0fe73e0526dbc2f860029b8cb0fbcfe3>>
7+
* @generated SignedSource<<e0775f2263b3a9dd8e69dde74557ba2a>>
88
*/
99

1010
/**
@@ -45,10 +45,6 @@ bool ReactNativeFeatureFlags::enableMicrotasks() {
4545
return getAccessor().enableMicrotasks();
4646
}
4747

48-
bool ReactNativeFeatureFlags::enableMountHooksAndroid() {
49-
return getAccessor().enableMountHooksAndroid();
50-
}
51-
5248
bool ReactNativeFeatureFlags::enableSpannableBuildingUnification() {
5349
return getAccessor().enableSpannableBuildingUnification();
5450
}

0 commit comments

Comments
 (0)