mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Split debugger flags into fuseboxEnabledDebug and fuseboxEnabledRelease (#44663)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44663 Changelog: [Internal] Reviewed By: hoxyq Differential Revision: D57733525 fbshipit-source-id: 70a7dacb641b75e73bd4f7e18bc5e3d04bc2c508
This commit is contained in:
committed by
Facebook GitHub Bot
parent
03b8b0997a
commit
29beea6b57
+9
-3
@@ -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<<66b25d6d12959ea3378e8b8dbbae037e>>
|
||||
* @generated SignedSource<<d6c66f8e1322b8962191fa4af5c8da4b>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -107,10 +107,16 @@ public object ReactNativeFeatureFlags {
|
||||
public fun forceBatchingMountItemsOnAndroid(): Boolean = accessor.forceBatchingMountItemsOnAndroid()
|
||||
|
||||
/**
|
||||
* Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled. This flag is global and should not be changed across React Host lifetimes.
|
||||
* Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled in debug builds. This flag is global and should not be changed across React Host lifetimes.
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun fuseboxEnabled(): Boolean = accessor.fuseboxEnabled()
|
||||
public fun fuseboxEnabledDebug(): Boolean = accessor.fuseboxEnabledDebug()
|
||||
|
||||
/**
|
||||
* Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled in release builds. This flag is global and should not be changed across React Host lifetimes.
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun fuseboxEnabledRelease(): Boolean = accessor.fuseboxEnabledRelease()
|
||||
|
||||
/**
|
||||
* Only enqueue Choreographer calls if there is an ongoing animation, instead of enqueueing every frame.
|
||||
|
||||
+16
-6
@@ -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<<86c1725630e3dadfb97ca9bccd618dd7>>
|
||||
* @generated SignedSource<<53fb9cc52c068dd294507e060d06d75f>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -33,7 +33,8 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
|
||||
private var enableUIConsistencyCache: Boolean? = null
|
||||
private var fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeakCache: Boolean? = null
|
||||
private var forceBatchingMountItemsOnAndroidCache: Boolean? = null
|
||||
private var fuseboxEnabledCache: Boolean? = null
|
||||
private var fuseboxEnabledDebugCache: Boolean? = null
|
||||
private var fuseboxEnabledReleaseCache: Boolean? = null
|
||||
private var lazyAnimationCallbacksCache: Boolean? = null
|
||||
private var preventDoubleTextMeasureCache: Boolean? = null
|
||||
private var setAndroidLayoutDirectionCache: Boolean? = null
|
||||
@@ -158,11 +159,20 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun fuseboxEnabled(): Boolean {
|
||||
var cached = fuseboxEnabledCache
|
||||
override fun fuseboxEnabledDebug(): Boolean {
|
||||
var cached = fuseboxEnabledDebugCache
|
||||
if (cached == null) {
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.fuseboxEnabled()
|
||||
fuseboxEnabledCache = cached
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.fuseboxEnabledDebug()
|
||||
fuseboxEnabledDebugCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun fuseboxEnabledRelease(): Boolean {
|
||||
var cached = fuseboxEnabledReleaseCache
|
||||
if (cached == null) {
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.fuseboxEnabledRelease()
|
||||
fuseboxEnabledReleaseCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
+4
-2
@@ -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<<f251cc21200e36fa883205666c4f38d9>>
|
||||
* @generated SignedSource<<8df962abc44ac4368591f34862ccf69e>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -54,7 +54,9 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun forceBatchingMountItemsOnAndroid(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun fuseboxEnabled(): Boolean
|
||||
@DoNotStrip @JvmStatic public external fun fuseboxEnabledDebug(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun fuseboxEnabledRelease(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun lazyAnimationCallbacks(): Boolean
|
||||
|
||||
|
||||
+4
-2
@@ -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<<a85930c3a00dfa8e1008403ecd828357>>
|
||||
* @generated SignedSource<<b9067f03d9ae365120f8d6ef607354a6>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -49,7 +49,9 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
||||
|
||||
override fun forceBatchingMountItemsOnAndroid(): Boolean = false
|
||||
|
||||
override fun fuseboxEnabled(): Boolean = false
|
||||
override fun fuseboxEnabledDebug(): Boolean = false
|
||||
|
||||
override fun fuseboxEnabledRelease(): Boolean = false
|
||||
|
||||
override fun lazyAnimationCallbacks(): Boolean = false
|
||||
|
||||
|
||||
+18
-7
@@ -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<<28e42dd2ab3adbf71e828037a8314f3a>>
|
||||
* @generated SignedSource<<5abf40ebbabb3c0bebead668c1b24ff9>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -37,7 +37,8 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
||||
private var enableUIConsistencyCache: Boolean? = null
|
||||
private var fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeakCache: Boolean? = null
|
||||
private var forceBatchingMountItemsOnAndroidCache: Boolean? = null
|
||||
private var fuseboxEnabledCache: Boolean? = null
|
||||
private var fuseboxEnabledDebugCache: Boolean? = null
|
||||
private var fuseboxEnabledReleaseCache: Boolean? = null
|
||||
private var lazyAnimationCallbacksCache: Boolean? = null
|
||||
private var preventDoubleTextMeasureCache: Boolean? = null
|
||||
private var setAndroidLayoutDirectionCache: Boolean? = null
|
||||
@@ -175,12 +176,22 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun fuseboxEnabled(): Boolean {
|
||||
var cached = fuseboxEnabledCache
|
||||
override fun fuseboxEnabledDebug(): Boolean {
|
||||
var cached = fuseboxEnabledDebugCache
|
||||
if (cached == null) {
|
||||
cached = currentProvider.fuseboxEnabled()
|
||||
accessedFeatureFlags.add("fuseboxEnabled")
|
||||
fuseboxEnabledCache = cached
|
||||
cached = currentProvider.fuseboxEnabledDebug()
|
||||
accessedFeatureFlags.add("fuseboxEnabledDebug")
|
||||
fuseboxEnabledDebugCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun fuseboxEnabledRelease(): Boolean {
|
||||
var cached = fuseboxEnabledReleaseCache
|
||||
if (cached == null) {
|
||||
cached = currentProvider.fuseboxEnabledRelease()
|
||||
accessedFeatureFlags.add("fuseboxEnabledRelease")
|
||||
fuseboxEnabledReleaseCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
+4
-2
@@ -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<<500cd1ff0d3ddbaff62d99f6d9e79e5b>>
|
||||
* @generated SignedSource<<0f008837f44348e62dba2a65e813d49e>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -49,7 +49,9 @@ public interface ReactNativeFeatureFlagsProvider {
|
||||
|
||||
@DoNotStrip public fun forceBatchingMountItemsOnAndroid(): Boolean
|
||||
|
||||
@DoNotStrip public fun fuseboxEnabled(): Boolean
|
||||
@DoNotStrip public fun fuseboxEnabledDebug(): Boolean
|
||||
|
||||
@DoNotStrip public fun fuseboxEnabledRelease(): Boolean
|
||||
|
||||
@DoNotStrip public fun lazyAnimationCallbacks(): Boolean
|
||||
|
||||
|
||||
+21
-7
@@ -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<<37494761b0096640cde5094a2f3ba6ee>>
|
||||
* @generated SignedSource<<4267f2de5ad71437875b03a26ac80d13>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -117,9 +117,15 @@ class ReactNativeFeatureFlagsProviderHolder
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool fuseboxEnabled() override {
|
||||
bool fuseboxEnabledDebug() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("fuseboxEnabled");
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("fuseboxEnabledDebug");
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool fuseboxEnabledRelease() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("fuseboxEnabledRelease");
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
@@ -228,9 +234,14 @@ bool JReactNativeFeatureFlagsCxxInterop::forceBatchingMountItemsOnAndroid(
|
||||
return ReactNativeFeatureFlags::forceBatchingMountItemsOnAndroid();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::fuseboxEnabled(
|
||||
bool JReactNativeFeatureFlagsCxxInterop::fuseboxEnabledDebug(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::fuseboxEnabled();
|
||||
return ReactNativeFeatureFlags::fuseboxEnabledDebug();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::fuseboxEnabledRelease(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::fuseboxEnabledRelease();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::lazyAnimationCallbacks(
|
||||
@@ -320,8 +331,11 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
||||
"forceBatchingMountItemsOnAndroid",
|
||||
JReactNativeFeatureFlagsCxxInterop::forceBatchingMountItemsOnAndroid),
|
||||
makeNativeMethod(
|
||||
"fuseboxEnabled",
|
||||
JReactNativeFeatureFlagsCxxInterop::fuseboxEnabled),
|
||||
"fuseboxEnabledDebug",
|
||||
JReactNativeFeatureFlagsCxxInterop::fuseboxEnabledDebug),
|
||||
makeNativeMethod(
|
||||
"fuseboxEnabledRelease",
|
||||
JReactNativeFeatureFlagsCxxInterop::fuseboxEnabledRelease),
|
||||
makeNativeMethod(
|
||||
"lazyAnimationCallbacks",
|
||||
JReactNativeFeatureFlagsCxxInterop::lazyAnimationCallbacks),
|
||||
|
||||
+5
-2
@@ -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<<ddf6ea7126754a1f10e06eb9ac4fb276>>
|
||||
* @generated SignedSource<<9d2fdfb02452bcedb14af85488d0b8c7>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -69,7 +69,10 @@ class JReactNativeFeatureFlagsCxxInterop
|
||||
static bool forceBatchingMountItemsOnAndroid(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool fuseboxEnabled(
|
||||
static bool fuseboxEnabledDebug(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool fuseboxEnabledRelease(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool lazyAnimationCallbacks(
|
||||
|
||||
@@ -18,7 +18,7 @@ InspectorFlags& InspectorFlags::getInstance() {
|
||||
}
|
||||
|
||||
bool InspectorFlags::getFuseboxEnabled() const {
|
||||
return loadFlagsAndAssertUnchanged().fuseboxEnabled;
|
||||
return loadFlagsAndAssertUnchanged().fuseboxEnabledDebug;
|
||||
}
|
||||
|
||||
void InspectorFlags::dangerouslyResetFlags() {
|
||||
@@ -28,13 +28,13 @@ void InspectorFlags::dangerouslyResetFlags() {
|
||||
const InspectorFlags::Values& InspectorFlags::loadFlagsAndAssertUnchanged()
|
||||
const {
|
||||
InspectorFlags::Values newValues = {
|
||||
.fuseboxEnabled =
|
||||
.fuseboxEnabledDebug =
|
||||
#ifdef REACT_NATIVE_FORCE_ENABLE_FUSEBOX
|
||||
true,
|
||||
#elif defined(HERMES_ENABLE_DEBUGGER)
|
||||
ReactNativeFeatureFlags::fuseboxEnabled(),
|
||||
ReactNativeFeatureFlags::fuseboxEnabledDebug(),
|
||||
#else
|
||||
false,
|
||||
ReactNativeFeatureFlags::fuseboxEnabledRelease(),
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class InspectorFlags {
|
||||
|
||||
private:
|
||||
struct Values {
|
||||
bool fuseboxEnabled;
|
||||
bool fuseboxEnabledDebug;
|
||||
bool operator==(const Values&) const = default;
|
||||
};
|
||||
|
||||
|
||||
+3
-3
@@ -235,8 +235,8 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
ReactInstanceVaryingInspectorFlags,
|
||||
ReactInstanceIntegrationTestWithFlags,
|
||||
::testing::Values(
|
||||
InspectorFlagOverrides{.fuseboxEnabled = false},
|
||||
InspectorFlagOverrides{.fuseboxEnabled = false},
|
||||
InspectorFlagOverrides{.fuseboxEnabled = true}));
|
||||
InspectorFlagOverrides{.fuseboxEnabledDebug = false},
|
||||
InspectorFlagOverrides{.fuseboxEnabledDebug = false},
|
||||
InspectorFlagOverrides{.fuseboxEnabledDebug = true}));
|
||||
|
||||
} // namespace facebook::react::jsinspector_modern
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ namespace facebook::react::jsinspector_modern {
|
||||
using namespace ::testing;
|
||||
|
||||
struct FeatureFlags {
|
||||
const bool fuseboxEnabled = true;
|
||||
const bool fuseboxEnabledDebug = true;
|
||||
};
|
||||
|
||||
class ReactInstanceIntegrationTest : public Test {
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ JsiIntegrationTestGenericEngineAdapter::JsiIntegrationTestGenericEngineAdapter(
|
||||
|
||||
/* static */ InspectorFlagOverrides
|
||||
JsiIntegrationTestGenericEngineAdapter::getInspectorFlagOverrides() noexcept {
|
||||
return {.fuseboxEnabled = true};
|
||||
return {.fuseboxEnabledDebug = true};
|
||||
}
|
||||
|
||||
RuntimeTargetDelegate&
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ JsiIntegrationTestHermesEngineAdapter::JsiIntegrationTestHermesEngineAdapter(
|
||||
/* static */ InspectorFlagOverrides
|
||||
JsiIntegrationTestHermesEngineAdapter::getInspectorFlagOverrides() noexcept {
|
||||
return {
|
||||
.fuseboxEnabled = true,
|
||||
.fuseboxEnabledDebug = true,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -26,9 +26,9 @@ class ReactNativeFeatureFlagsOverrides
|
||||
const InspectorFlagOverrides& overrides)
|
||||
: overrides_(overrides) {}
|
||||
|
||||
bool fuseboxEnabled() override {
|
||||
return overrides_.fuseboxEnabled.value_or(
|
||||
ReactNativeFeatureFlagsDefaults::fuseboxEnabled());
|
||||
bool fuseboxEnabledDebug() override {
|
||||
return overrides_.fuseboxEnabledDebug.value_or(
|
||||
ReactNativeFeatureFlagsDefaults::fuseboxEnabledDebug());
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ namespace facebook::react::jsinspector_modern {
|
||||
struct InspectorFlagOverrides {
|
||||
// NOTE: Keep these entries in sync with ReactNativeFeatureFlagsOverrides in
|
||||
// the implementation file.
|
||||
std::optional<bool> fuseboxEnabled;
|
||||
std::optional<bool> fuseboxEnabledDebug;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -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<<a84c2654be6bc46c82c5dd466cdcf3b0>>
|
||||
* @generated SignedSource<<44c54555ee69104a69d9e60b13ebccbf>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -73,8 +73,12 @@ bool ReactNativeFeatureFlags::forceBatchingMountItemsOnAndroid() {
|
||||
return getAccessor().forceBatchingMountItemsOnAndroid();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::fuseboxEnabled() {
|
||||
return getAccessor().fuseboxEnabled();
|
||||
bool ReactNativeFeatureFlags::fuseboxEnabledDebug() {
|
||||
return getAccessor().fuseboxEnabledDebug();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::fuseboxEnabledRelease() {
|
||||
return getAccessor().fuseboxEnabledRelease();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::lazyAnimationCallbacks() {
|
||||
|
||||
@@ -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<<abfe4f0adc936917b3d505bb5b84382b>>
|
||||
* @generated SignedSource<<8fdad69a7bbf55bdf967292958de6f61>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -103,9 +103,14 @@ class ReactNativeFeatureFlags {
|
||||
RN_EXPORT static bool forceBatchingMountItemsOnAndroid();
|
||||
|
||||
/**
|
||||
* Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled. This flag is global and should not be changed across React Host lifetimes.
|
||||
* Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled in debug builds. This flag is global and should not be changed across React Host lifetimes.
|
||||
*/
|
||||
RN_EXPORT static bool fuseboxEnabled();
|
||||
RN_EXPORT static bool fuseboxEnabledDebug();
|
||||
|
||||
/**
|
||||
* Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled in release builds. This flag is global and should not be changed across React Host lifetimes.
|
||||
*/
|
||||
RN_EXPORT static bool fuseboxEnabledRelease();
|
||||
|
||||
/**
|
||||
* Only enqueue Choreographer calls if there is an ongoing animation, instead of enqueueing every frame.
|
||||
|
||||
+30
-12
@@ -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<<08b1bb44603924e62d8e887c93ce2ea2>>
|
||||
* @generated SignedSource<<bf265572c103948adc9ff44022782e09>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -263,8 +263,8 @@ bool ReactNativeFeatureFlagsAccessor::forceBatchingMountItemsOnAndroid() {
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::fuseboxEnabled() {
|
||||
auto flagValue = fuseboxEnabled_.load();
|
||||
bool ReactNativeFeatureFlagsAccessor::fuseboxEnabledDebug() {
|
||||
auto flagValue = fuseboxEnabledDebug_.load();
|
||||
|
||||
if (!flagValue.has_value()) {
|
||||
// This block is not exclusive but it is not necessary.
|
||||
@@ -272,10 +272,28 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxEnabled() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(13, "fuseboxEnabled");
|
||||
markFlagAsAccessed(13, "fuseboxEnabledDebug");
|
||||
|
||||
flagValue = currentProvider_->fuseboxEnabled();
|
||||
fuseboxEnabled_ = flagValue;
|
||||
flagValue = currentProvider_->fuseboxEnabledDebug();
|
||||
fuseboxEnabledDebug_ = flagValue;
|
||||
}
|
||||
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::fuseboxEnabledRelease() {
|
||||
auto flagValue = fuseboxEnabledRelease_.load();
|
||||
|
||||
if (!flagValue.has_value()) {
|
||||
// This block is not exclusive but it is not necessary.
|
||||
// If multiple threads try to initialize the feature flag, we would only
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(14, "fuseboxEnabledRelease");
|
||||
|
||||
flagValue = currentProvider_->fuseboxEnabledRelease();
|
||||
fuseboxEnabledRelease_ = flagValue;
|
||||
}
|
||||
|
||||
return flagValue.value();
|
||||
@@ -290,7 +308,7 @@ bool ReactNativeFeatureFlagsAccessor::lazyAnimationCallbacks() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(14, "lazyAnimationCallbacks");
|
||||
markFlagAsAccessed(15, "lazyAnimationCallbacks");
|
||||
|
||||
flagValue = currentProvider_->lazyAnimationCallbacks();
|
||||
lazyAnimationCallbacks_ = flagValue;
|
||||
@@ -308,7 +326,7 @@ bool ReactNativeFeatureFlagsAccessor::preventDoubleTextMeasure() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(15, "preventDoubleTextMeasure");
|
||||
markFlagAsAccessed(16, "preventDoubleTextMeasure");
|
||||
|
||||
flagValue = currentProvider_->preventDoubleTextMeasure();
|
||||
preventDoubleTextMeasure_ = flagValue;
|
||||
@@ -326,7 +344,7 @@ bool ReactNativeFeatureFlagsAccessor::setAndroidLayoutDirection() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(16, "setAndroidLayoutDirection");
|
||||
markFlagAsAccessed(17, "setAndroidLayoutDirection");
|
||||
|
||||
flagValue = currentProvider_->setAndroidLayoutDirection();
|
||||
setAndroidLayoutDirection_ = flagValue;
|
||||
@@ -344,7 +362,7 @@ bool ReactNativeFeatureFlagsAccessor::useModernRuntimeScheduler() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(17, "useModernRuntimeScheduler");
|
||||
markFlagAsAccessed(18, "useModernRuntimeScheduler");
|
||||
|
||||
flagValue = currentProvider_->useModernRuntimeScheduler();
|
||||
useModernRuntimeScheduler_ = flagValue;
|
||||
@@ -362,7 +380,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeViewConfigsInBridgelessMode() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(18, "useNativeViewConfigsInBridgelessMode");
|
||||
markFlagAsAccessed(19, "useNativeViewConfigsInBridgelessMode");
|
||||
|
||||
flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode();
|
||||
useNativeViewConfigsInBridgelessMode_ = flagValue;
|
||||
@@ -380,7 +398,7 @@ bool ReactNativeFeatureFlagsAccessor::useStateAlignmentMechanism() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(19, "useStateAlignmentMechanism");
|
||||
markFlagAsAccessed(20, "useStateAlignmentMechanism");
|
||||
|
||||
flagValue = currentProvider_->useStateAlignmentMechanism();
|
||||
useStateAlignmentMechanism_ = flagValue;
|
||||
|
||||
+6
-4
@@ -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<<e05adbe3f6ea91121c0bf5a46c9cd5c5>>
|
||||
* @generated SignedSource<<d42b9949ba1bedd690893c8c34ac6a2b>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -44,7 +44,8 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
bool enableUIConsistency();
|
||||
bool fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak();
|
||||
bool forceBatchingMountItemsOnAndroid();
|
||||
bool fuseboxEnabled();
|
||||
bool fuseboxEnabledDebug();
|
||||
bool fuseboxEnabledRelease();
|
||||
bool lazyAnimationCallbacks();
|
||||
bool preventDoubleTextMeasure();
|
||||
bool setAndroidLayoutDirection();
|
||||
@@ -61,7 +62,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
|
||||
bool wasOverridden_;
|
||||
|
||||
std::array<std::atomic<const char*>, 20> accessedFeatureFlags_;
|
||||
std::array<std::atomic<const char*>, 21> accessedFeatureFlags_;
|
||||
|
||||
std::atomic<std::optional<bool>> commonTestFlag_;
|
||||
std::atomic<std::optional<bool>> allowCollapsableChildren_;
|
||||
@@ -76,7 +77,8 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::atomic<std::optional<bool>> enableUIConsistency_;
|
||||
std::atomic<std::optional<bool>> fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak_;
|
||||
std::atomic<std::optional<bool>> forceBatchingMountItemsOnAndroid_;
|
||||
std::atomic<std::optional<bool>> fuseboxEnabled_;
|
||||
std::atomic<std::optional<bool>> fuseboxEnabledDebug_;
|
||||
std::atomic<std::optional<bool>> fuseboxEnabledRelease_;
|
||||
std::atomic<std::optional<bool>> lazyAnimationCallbacks_;
|
||||
std::atomic<std::optional<bool>> preventDoubleTextMeasure_;
|
||||
std::atomic<std::optional<bool>> setAndroidLayoutDirection_;
|
||||
|
||||
+6
-2
@@ -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<<030a36407880de0362dbabcf604eed87>>
|
||||
* @generated SignedSource<<6535d6d14ba4387ea73d129f064548e0>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -79,7 +79,11 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool fuseboxEnabled() override {
|
||||
bool fuseboxEnabledDebug() override {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool fuseboxEnabledRelease() override {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -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<<fe06fc281a85c7f2addc043cfc8ba0cc>>
|
||||
* @generated SignedSource<<cca43c849147c9a230fb3fa6af795d24>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -38,7 +38,8 @@ class ReactNativeFeatureFlagsProvider {
|
||||
virtual bool enableUIConsistency() = 0;
|
||||
virtual bool fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak() = 0;
|
||||
virtual bool forceBatchingMountItemsOnAndroid() = 0;
|
||||
virtual bool fuseboxEnabled() = 0;
|
||||
virtual bool fuseboxEnabledDebug() = 0;
|
||||
virtual bool fuseboxEnabledRelease() = 0;
|
||||
virtual bool lazyAnimationCallbacks() = 0;
|
||||
virtual bool preventDoubleTextMeasure() = 0;
|
||||
virtual bool setAndroidLayoutDirection() = 0;
|
||||
|
||||
+8
-3
@@ -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<<4cdbf1ace25da2cac7fae22053a6aac4>>
|
||||
* @generated SignedSource<<f554dd81f598e97429e2cba26613102e>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -102,9 +102,14 @@ bool NativeReactNativeFeatureFlags::forceBatchingMountItemsOnAndroid(
|
||||
return ReactNativeFeatureFlags::forceBatchingMountItemsOnAndroid();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::fuseboxEnabled(
|
||||
bool NativeReactNativeFeatureFlags::fuseboxEnabledDebug(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::fuseboxEnabled();
|
||||
return ReactNativeFeatureFlags::fuseboxEnabledDebug();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::fuseboxEnabledRelease(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::fuseboxEnabledRelease();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::lazyAnimationCallbacks(
|
||||
|
||||
+4
-2
@@ -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<<960d94901a0cca61c54ea64c7da7e27a>>
|
||||
* @generated SignedSource<<38587efd4ed8e4ad7cca2e96eda6632f>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -61,7 +61,9 @@ class NativeReactNativeFeatureFlags
|
||||
|
||||
bool forceBatchingMountItemsOnAndroid(jsi::Runtime& runtime);
|
||||
|
||||
bool fuseboxEnabled(jsi::Runtime& runtime);
|
||||
bool fuseboxEnabledDebug(jsi::Runtime& runtime);
|
||||
|
||||
bool fuseboxEnabledRelease(jsi::Runtime& runtime);
|
||||
|
||||
bool lazyAnimationCallbacks(jsi::Runtime& runtime);
|
||||
|
||||
|
||||
@@ -98,10 +98,15 @@ const definitions: FeatureFlagDefinitions = {
|
||||
description:
|
||||
'Forces the mounting layer on Android to always batch mount items instead of dispatching them immediately. This might fix some crashes related to synchronous state updates, where some views dispatch state updates during mount.',
|
||||
},
|
||||
fuseboxEnabled: {
|
||||
fuseboxEnabledDebug: {
|
||||
defaultValue: false,
|
||||
description:
|
||||
'Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled. This flag is global and should not be changed across React Host lifetimes.',
|
||||
'Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled in debug builds. This flag is global and should not be changed across React Host lifetimes.',
|
||||
},
|
||||
fuseboxEnabledRelease: {
|
||||
defaultValue: false,
|
||||
description:
|
||||
'Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled in release builds. This flag is global and should not be changed across React Host lifetimes.',
|
||||
},
|
||||
lazyAnimationCallbacks: {
|
||||
defaultValue: false,
|
||||
|
||||
@@ -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<<601651c6e8770ced4872a2d939a28a78>>
|
||||
* @generated SignedSource<<e2b6e70ce74cd84040583c68b41a285d>>
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
@@ -53,7 +53,8 @@ export type ReactNativeFeatureFlags = {
|
||||
enableUIConsistency: Getter<boolean>,
|
||||
fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak: Getter<boolean>,
|
||||
forceBatchingMountItemsOnAndroid: Getter<boolean>,
|
||||
fuseboxEnabled: Getter<boolean>,
|
||||
fuseboxEnabledDebug: Getter<boolean>,
|
||||
fuseboxEnabledRelease: Getter<boolean>,
|
||||
lazyAnimationCallbacks: Getter<boolean>,
|
||||
preventDoubleTextMeasure: Getter<boolean>,
|
||||
setAndroidLayoutDirection: Getter<boolean>,
|
||||
@@ -155,9 +156,13 @@ export const fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak: Getter<boolea
|
||||
*/
|
||||
export const forceBatchingMountItemsOnAndroid: Getter<boolean> = createNativeFlagGetter('forceBatchingMountItemsOnAndroid', false);
|
||||
/**
|
||||
* Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled. This flag is global and should not be changed across React Host lifetimes.
|
||||
* Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled in debug builds. This flag is global and should not be changed across React Host lifetimes.
|
||||
*/
|
||||
export const fuseboxEnabled: Getter<boolean> = createNativeFlagGetter('fuseboxEnabled', false);
|
||||
export const fuseboxEnabledDebug: Getter<boolean> = createNativeFlagGetter('fuseboxEnabledDebug', false);
|
||||
/**
|
||||
* Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled in release builds. This flag is global and should not be changed across React Host lifetimes.
|
||||
*/
|
||||
export const fuseboxEnabledRelease: Getter<boolean> = createNativeFlagGetter('fuseboxEnabledRelease', false);
|
||||
/**
|
||||
* Only enqueue Choreographer calls if there is an ongoing animation, instead of enqueueing every frame.
|
||||
*/
|
||||
|
||||
+3
-2
@@ -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<<9b6a65c3d49849807a6cb61895a31d85>>
|
||||
* @generated SignedSource<<30b0640e8893abd282c4694d7463e90e>>
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
@@ -36,7 +36,8 @@ export interface Spec extends TurboModule {
|
||||
+enableUIConsistency?: () => boolean;
|
||||
+fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak?: () => boolean;
|
||||
+forceBatchingMountItemsOnAndroid?: () => boolean;
|
||||
+fuseboxEnabled?: () => boolean;
|
||||
+fuseboxEnabledDebug?: () => boolean;
|
||||
+fuseboxEnabledRelease?: () => boolean;
|
||||
+lazyAnimationCallbacks?: () => boolean;
|
||||
+preventDoubleTextMeasure?: () => boolean;
|
||||
+setAndroidLayoutDirection?: () => boolean;
|
||||
|
||||
Reference in New Issue
Block a user