From 8ce3730fdf98c771f8169e7a5b591f28ad0806f0 Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Wed, 9 Sep 2026 00:43:02 -0700 Subject: [PATCH] Forward declare JSExecutorFactory in RCTAppSetupUtils (#58134) Summary: `RCTAppSetupUtils.h` is a public header - every app's AppDelegate imports it as `` - but it imported `` while naming nothing from it. The only symbol it needs out of that include chain is `JSExecutorFactory`, the return type of `RCTAppSetupDefaultJsExecutorFactory`, which is declared in ``. Both `jsiexecutor:jsiexecutor` and `cxxreact:bridge` are private targets under the three-tier C++ stable API visibility model. The type is forward declared alongside the existing `RuntimeScheduler` forward declaration - `std::unique_ptr` needs only an incomplete type in a declaration - and `` moves to the implementation file. Code that relied on reaching `JSIExecutor` or `JSExecutorFactory` through this header should import `` or `` directly. Changelog: [iOS][Changed] - `RCTAppSetupUtils.h` no longer transitively imports `JSIExecutor.h` or `JSExecutor.h` Differential Revision: D117330792 --- .../react-native/Libraries/AppDelegate/RCTAppSetupUtils.h | 4 ++-- .../react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h index 9053e656326c..ca6ff6cc0807 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h +++ b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h @@ -14,14 +14,14 @@ #import #import -#import @protocol RCTDependencyProvider; // Forward declaration to decrease compilation coupling namespace facebook::react { +class JSExecutorFactory; class RuntimeScheduler; -} +} // namespace facebook::react RCT_EXTERN NSArray *RCTAppSetupUnstableModulesRequiringMainQueueSetup( id dependencyProvider); diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm index ae3ae256a8c1..d5aabd85ea1c 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm @@ -7,6 +7,7 @@ #import "RCTAppSetupUtils.h" +#import #import #import