From 981141c9a103f4ab09019bcbb059e93226f29691 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Wed, 26 Jun 2024 03:53:54 -0700 Subject: [PATCH] Expose preprocessor flag for fuseboxEnabledDebug (#45167) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/45167 Configures a `REACT_NATIVE_ENABLE_FUSEBOX_DEBUG` flag, and exposes this flag in the Buck target. This is an additional hook to enable the new debugger stack (codename Fusebox) as part of our internal rollout. Changelog: [Internal] Reviewed By: hoxyq Differential Revision: D59014161 fbshipit-source-id: f05e8b01ed07da90ef6d7a66ade05f462dd82023 --- .../ReactCommon/jsinspector-modern/InspectorFlags.cpp | 8 ++++++-- .../ReactCommon/jsinspector-modern/InspectorFlags.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/react-native/ReactCommon/jsinspector-modern/InspectorFlags.cpp b/packages/react-native/ReactCommon/jsinspector-modern/InspectorFlags.cpp index 8ba4df31f5f..d2bc254ccee 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/InspectorFlags.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/InspectorFlags.cpp @@ -18,7 +18,7 @@ InspectorFlags& InspectorFlags::getInstance() { } bool InspectorFlags::getFuseboxEnabled() const { - return loadFlagsAndAssertUnchanged().fuseboxEnabledDebug; + return loadFlagsAndAssertUnchanged().fuseboxEnabled; } void InspectorFlags::dangerouslyResetFlags() { @@ -28,11 +28,15 @@ void InspectorFlags::dangerouslyResetFlags() { const InspectorFlags::Values& InspectorFlags::loadFlagsAndAssertUnchanged() const { InspectorFlags::Values newValues = { - .fuseboxEnabledDebug = + .fuseboxEnabled = #ifdef REACT_NATIVE_FORCE_ENABLE_FUSEBOX true, #elif defined(HERMES_ENABLE_DEBUGGER) +#ifdef REACT_NATIVE_ENABLE_FUSEBOX_DEBUG + true, +#else ReactNativeFeatureFlags::fuseboxEnabledDebug(), +#endif #else ReactNativeFeatureFlags::fuseboxEnabledRelease(), #endif diff --git a/packages/react-native/ReactCommon/jsinspector-modern/InspectorFlags.h b/packages/react-native/ReactCommon/jsinspector-modern/InspectorFlags.h index 821347b79f3..38f243fb40f 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/InspectorFlags.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/InspectorFlags.h @@ -32,7 +32,7 @@ class InspectorFlags { private: struct Values { - bool fuseboxEnabledDebug; + bool fuseboxEnabled; bool operator==(const Values&) const = default; };