Skip to content

Commit 9b1940d

Browse files
cortinicofacebook-github-bot
authored andcommitted
Decouple Hermes factory header from C++ paths
Summary: `RCTHermesInstanceFactory.h` is part of React's umbrella header, but it imported a lower-level C++ header that was unavailable while a SwiftPM Release build compiled the `React` module. Forward-declare the opaque `JSRuntimeFactoryRef` handle instead of relying on transitive C++ header search paths. This preserves the C ABI and mirrors the existing self-contained declaration used by `RCTJSRuntimeConfiguratorProtocol.h`. The first observed failure was at `024b474ce92ba66744af602ee67691cd11498485`; the immediately preceding `main` SPM Release run passed, but that commit only changed `RCTInstance.mm`, so source-level attribution remains uncertain. The risk is limited to keeping two equivalent opaque aliases in sync; both remain `void *`. Validation covered the internal Apple runtime target, all React Native C++ API snapshot configurations, formatter, and lint. A full SwiftPM/Xcode rerun was not available on the Linux build host. Changelog: [iOS][Fixed] - Fix SwiftPM Release builds failing to compile the React umbrella module Differential Revision: D123142962
1 parent 024b474 commit 9b1940d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎packages/react-native/React/Runtime/RCTHermesInstanceFactory.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
#import <react/runtime/JSRuntimeFactoryCAPI.h>
9-
108
#pragma once
119

10+
// Forward declaration keeps this umbrella header independent of C++ header search paths.
1211
#ifdef __cplusplus
12+
using JSRuntimeFactoryRef = void *;
1313
extern "C" {
14+
#else
15+
typedef void *JSRuntimeFactoryRef;
1416
#endif
1517

1618
JSRuntimeFactoryRef jsrt_create_hermes_factory(void);

0 commit comments

Comments
 (0)