Skip to content

Commit c57a22f

Browse files
j-piaseckifacebook-github-bot
authored andcommitted
Forward declare JSExecutorFactory in RCTAppSetupUtils (#58134)
Summary: `RCTAppSetupUtils.h` is a public header - every app's AppDelegate imports it as `<React/RCTAppSetupUtils.h>` - but it imported `<jsireact/JSIExecutor.h>` 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 `<cxxreact/JSExecutor.h>`. 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<T>` needs only an incomplete type in a declaration - and `<cxxreact/JSExecutor.h>` moves to the implementation file. Code that relied on reaching `JSIExecutor` or `JSExecutorFactory` through this header should import `<jsireact/JSIExecutor.h>` or `<cxxreact/JSExecutor.h>` directly. Changelog: [iOS][Changed] - `RCTAppSetupUtils.h` no longer transitively imports `JSIExecutor.h` or `JSExecutor.h` Differential Revision: D117330792
1 parent 25c5539 commit c57a22f

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
#endif
1919

2020
#import <ReactCommon/RCTTurboModuleManager.h>
21-
#import <jsireact/JSIExecutor.h>
2221

2322
@protocol RCTDependencyProvider;
2423

2524
// Forward declaration to decrease compilation coupling
2625
namespace facebook::react {
26+
class JSExecutorFactory;
2727
class RuntimeScheduler;
28-
}
28+
} // namespace facebook::react
2929
RCT_EXTERN NSArray<NSString *> *RCTAppSetupUnstableModulesRequiringMainQueueSetup(
3030
id<RCTDependencyProvider> dependencyProvider);
3131

packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#import "RCTAppSetupUtils.h"
99

10+
#import <cxxreact/JSExecutor.h>
1011
#import <react/renderer/runtimescheduler/RuntimeScheduler.h>
1112
#import <react/renderer/runtimescheduler/RuntimeSchedulerBinding.h>
1213

0 commit comments

Comments
 (0)