Skip to content

[0.87] Fix Swift C++ interop build failure in jsinspector-modern tracing #1351

Description

@cipolleschi

Target Branch

0.87

Link to commit or PR to be picked

react/react-native@3861118

Description

This fixes a build-breaking iOS regression for libraries using Swift C++ interop with the prebuilt React Native core, including Nitro-based libraries. On Xcode 26.3, Swift's ClangImporter attempts to instantiate ill-formed implicit copy constructors for TraceRecordingState and HostTracingProfile, causing every Swift file in affected consumers to fail with no matching function for call to __construct_at.

The fix makes the two already-effectively-move-only types explicitly move-only, so Swift imports them correctly as non-copyable. It does not change runtime behavior, and all React Native usages were audited as references or moves.

This is appropriate for 0.87 because that release requires Xcode 26 and is currently in the RC cycle. It fixes core integration with third-party libraries, matching the support policy criteria for bugs in the core React Native experience and APIs used by third-party libraries.

Validation was performed on a fresh React Native nightly app using react-native-unistyles@3.3.0, react-native-nitro-modules, the prebuilt core, and Xcode 26.3: stock headers reproduced the failure, while the patched headers built successfully with no __construct_at, shadowNodeFromValue, or module errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type Pick RequestPick requests to include commits inside a React Native release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions