Skip to content

Commit

Permalink
Configure unstable-react-profiling build mode
Browse files Browse the repository at this point in the history
Summary:
This is a mostly internal diff enabling us to selectively enable Fusebox in release builds (experimental).

Changelog: [Internal]

Differential Revision: D64110061
  • Loading branch information
huntie authored and facebook-github-bot committed Oct 15, 2024
1 parent 11392c7 commit 912d27f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/react-native/ReactAndroid/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ android {

buildConfigField("boolean", "IS_INTERNAL_BUILD", "false")
buildConfigField("int", "EXOPACKAGE_FLAGS", "0")
buildConfigField("boolean", "UNSTABLE_ENABLE_FUSEBOX_RELEASE", "false")

resValue("integer", "react_native_dev_server_port", reactNativeDevServerPort())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.facebook.react.common.SurfaceDelegate;
import com.facebook.react.common.SurfaceDelegateFactory;
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
import com.facebook.react.common.build.ReactBuildConfig;
import com.facebook.react.devsupport.DevSupportManagerFactory;
import com.facebook.react.devsupport.interfaces.DevLoadingViewManager;
import com.facebook.react.devsupport.interfaces.PausedInDebuggerOverlayManager;
Expand Down Expand Up @@ -92,7 +93,8 @@ protected ReactInstanceManagerBuilder getBaseReactInstanceManagerBuilder() {
ReactInstanceManager.builder()
.setApplication(mApplication)
.setJSMainModulePath(getJSMainModuleName())
.setUseDeveloperSupport(getUseDeveloperSupport())
.setUseDeveloperSupport(
getUseDeveloperSupport() || ReactBuildConfig.UNSTABLE_ENABLE_FUSEBOX_RELEASE)
.setDevSupportManagerFactory(getDevSupportManagerFactory())
.setDevLoadingViewManager(getDevLoadingViewManager())
.setRequireActivity(getShouldRequireActivity())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ public object ReactBuildConfig {
@JvmField public val IS_INTERNAL_BUILD: Boolean = BuildConfig.IS_INTERNAL_BUILD

@JvmField public val EXOPACKAGE_FLAGS: Int = BuildConfig.EXOPACKAGE_FLAGS

/** [Experimental] Enable React Native DevTools in release builds. */
@JvmField
public val UNSTABLE_ENABLE_FUSEBOX_RELEASE: Boolean = BuildConfig.UNSTABLE_ENABLE_FUSEBOX_RELEASE
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,9 @@ public ReactHostImpl(
mBGExecutor = bgExecutor;
mUIExecutor = uiExecutor;
mMemoryPressureRouter = new MemoryPressureRouter(context);
mAllowPackagerServerAccess = allowPackagerServerAccess;
mUseDevSupport = useDevSupport;
mAllowPackagerServerAccess =
allowPackagerServerAccess || ReactBuildConfig.UNSTABLE_ENABLE_FUSEBOX_RELEASE;
mUseDevSupport = useDevSupport || ReactBuildConfig.UNSTABLE_ENABLE_FUSEBOX_RELEASE;

if (mUseDevSupport) {
mDevSupportManager =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ const InspectorFlags::Values& InspectorFlags::loadFlagsAndAssertUnchanged()
true,
#elif defined(HERMES_ENABLE_DEBUGGER)
ReactNativeFeatureFlags::fuseboxEnabledDebug(),
#elif defined(REACT_NATIVE_ENABLE_FUSEBOX_RELEASE)
true,
#else
ReactNativeFeatureFlags::fuseboxEnabledRelease(),
#endif
Expand Down

0 comments on commit 912d27f

Please sign in to comment.