Skip to content

[DevTools][iOS] Compile React DevTools runtime settings modules out of production builds - #60166

Open
huntie wants to merge 1 commit into
mainfrom
pr60166
Open

huntie wants to merge 1 commit into
mainfrom
pr60166

Conversation

@huntie

@huntie huntie commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

ReactDevToolsRuntimeSettingsModule backs React DevTools "reload and profile", whose only caller, setUpReactDevTools, runs under __DEV__. Its native implementations ship in every build, so gate them on REACT_NATIVE_DEBUGGER_ENABLED_DEVONLY, which the C++ module's registration in DefaultTurboModules already uses.

Changes

  • Compile the iOS module and the C++ module, plus its DevToolsRuntimeSettings store, only under REACT_NATIVE_DEBUGGER_ENABLED_DEVONLY.
  • Keep RCTDevToolsRuntimeSettingsCls and ReactDevToolsRuntimeSettingsModuleProvider defined, returning nil and nullptr otherwise, matching RCTPerfMonitorCls. JS already reads the module as nullable.
  • Define REACT_NATIVE_DEBUGGER_ENABLED_DEVONLY in Debug for React-CoreModules (CocoaPods, Package.swift) and the two devtoolsruntimesettings CMake targets.

Note

Buck targets for React-CoreModules and devtoolsruntimesettings need the same Debug-only define, or the module is missing in internal dev builds.

Changelog: [Internal]

Test Plan

  • React-CoreModules builds from RNTester's Pods in Release and Debug. The Release RCTDevToolsRuntimeSettingsModule.o defines only RCTDevToolsRuntimeSettingsCls; Debug defines the full class.
  • Both C++ files pass clang++ -fsyntax-only -Wall -Wextra -Werror with and without the define.
  • swift package dump-package shows the Debug-only define on React-CoreModules.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 19, 2026
@huntie
huntie requested a review from javache November 19, 2026 21:41
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Nov 19, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant