Move RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION to its only consumer (#55528)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55528

Move the RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION define from RCTDefines.h to RCTDevSettings.mm, which is its only consumer. This removes a __has_include dependency from the shared header, making RCTDefines.h usable as a standalone lightweight target without pulling in RCTPackagerConnection.h.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D93018381

fbshipit-source-id: bff276bb788197bb59a7f4626cc355d85a8dea87
This commit is contained in:
Pieter De Baets authored and meta-codesync[bot] committed 2026-02-12 06:59:33 -08:00
1 parent 5ee695ad8f
commit 6802eb92ff
2 files changed
+8 -8

No files matched your search

@@ -95,14 +95,6 @@
#define RCT_DEV_MENU RCT_DEV
#endif
#ifndef RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION
#if RCT_DEV && (__has_include("RCTPackagerConnection.h") || __has_include(<React/RCTPackagerConnection.h>))
#define RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION 1
#else
#define RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION 0
#endif
#endif
#if RCT_DEV
#define RCT_IF_DEV(...) __VA_ARGS__
#else
@@ -36,6 +36,14 @@ static NSString *const kRCTDevSettingsUserDefaultsKey = @"RCTDevMenu";
#import <React/RCTPackagerConnection.h>
#endif
#ifndef RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION
#if RCT_DEV && (__has_include("RCTPackagerConnection.h") || __has_include(<React/RCTPackagerConnection.h>))
#define RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION 1
#else
#define RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION 0
#endif
#endif
#if RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION
#import <React/RCTPackagerClient.h>
#endif