Skip to content

[RUM-18412] feat: fix Xcode 27 build issues - #1408

Open
marco-saia-datadog wants to merge 2 commits into
developfrom
marcosaia/RUM-18412/xcode-27-support
Open

[RUM-18412] feat: fix Xcode 27 build issues#1408
marco-saia-datadog wants to merge 2 commits into
developfrom
marcosaia/RUM-18412/xcode-27-support

Conversation

@marco-saia-datadog

@marco-saia-datadog marco-saia-datadog commented Sep 7, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Introduces support for Xcode 27 by fixing some Session Replay build issues.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)
  • If this PR is auto-generated, please make sure also to manually update the code related to the change

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The changes affect Swift-generated Objective-C header interoperability and Xcode-specific build behavior, which is hard to validate safely without a human/CI-confirmed build on the target toolchain.

Pull request overview

This PR updates the iOS Swift ↔ Objective-C bridging used by the React Native modules to better support Xcode 27 by avoiding React promise block typealiases in generated -Swift.h headers.

Changes:

  • Introduces local Swift closure typealiases (RCTPromiseResolve / RCTPromiseReject) to replace RCTPromiseResolveBlock / RCTPromiseRejectBlock in Swift @objc APIs.
  • Updates multiple Swift implementation entrypoints (Core + Session Replay) to use the new typealiases (marked @escaping).
  • Adjusts Session Replay’s Objective-C++ bridge file to explicitly import RCTBridgeModule.h.
File summaries
File Description
packages/react-native-session-replay/ios/Sources/RCTPromiseTypes.swift Adds local promise closure typealiases for Session Replay Swift APIs.
packages/react-native-session-replay/ios/Sources/DdSessionReplayImplementation.swift Switches exported Swift methods to the new promise closure typealiases.
packages/react-native-session-replay/ios/Sources/DdSessionReplay.mm Imports RCTBridgeModule.h before consuming the generated Swift header.
packages/core/ios/Sources/RCTPromiseTypes.swift Adds local promise closure typealiases for Core Swift APIs.
packages/core/ios/Sources/DdTraceImplementation.swift Updates span APIs to use the new promise closure typealiases.
packages/core/ios/Sources/DdSdkImplementation.swift Updates SDK APIs to use the new promise closure typealiases.
packages/core/ios/Sources/DdRumImplementation.swift Updates RUM APIs to use the new promise closure typealiases.
packages/core/ios/Sources/DdLogsImplementation.swift Updates Logs APIs to use the new promise closure typealiases.
packages/core/ios/Sources/DdFlagsImplementation.swift Updates Flags APIs to use the new promise closure typealiases.
Review details
  • Files reviewed: 9/9 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/core/ios/Sources/RCTPromiseTypes.swift Outdated
Comment thread packages/react-native-session-replay/ios/Sources/RCTPromiseTypes.swift Outdated
Copilot AI review requested due to automatic review settings September 8, 2026 08:48
@marco-saia-datadog
marco-saia-datadog force-pushed the marcosaia/RUM-18412/xcode-27-support branch from 9350784 to 1eef006 Compare September 8, 2026 08:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Xcode 27 *-Swift.h/React promise typedef import-order issue likely still exists in other Swift modules (e.g. internal-testing-tools) that continue to expose @objc methods using RCTPromiseResolveBlock/RCTPromiseRejectBlock while importing *-Swift.h before React headers.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 9/9 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +11 to +15
/// Using these plain Swift closure types instead of React's typealiases keeps the generated
/// Objective-C interface header (`-Swift.h`) from referencing `RCTPromiseResolveBlock`/`RCTPromiseRejectBlock`
/// by name: Swift emits the underlying block signature directly instead, so the header no longer
/// depends on `RCTBridgeModule.h` being importable wherever it is consumed. The block signatures are
/// structurally identical to React's, so `.mm` callers can pass `RCTPromiseResolveBlock`/`RCTPromiseRejectBlock`

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in 90c5a11

Copilot AI review requested due to automatic review settings September 8, 2026 08:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are scoped to Objective-C header compatibility/typealiasing, appear internally consistent across the touched modules, and do not introduce behavioral logic changes.

Review details
  • Files reviewed: 9/9 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 8, 2026 09:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

There is at least one promise rejection path that still passes a nil reject code, which is inconsistent with typical React Native promise contracts and should be corrected.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 11/11 changed files
  • Comments generated: 2
  • Review effort level: Lite


@objc
public func getAllEvents(feature: String, resolve:RCTPromiseResolveBlock, reject:RCTPromiseRejectBlock) -> Void {
public func getAllEvents(feature: String, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
Comment on lines +14 to +20
/// depends on `RCTBridgeModule.h` being importable wherever it is consumed. The block signatures are
/// structurally identical to React's, so `.mm` callers can pass `RCTPromiseResolveBlock`/`RCTPromiseRejectBlock`
/// values through unchanged.
///
/// The `code`/`message` parameters stay optional here (unlike the non-optional versions used in
/// `core`/`react-native-session-replay`) because `getAllEvents` in `DdInternalTestingImplementation`
/// rejects with a `nil` code.
Copilot AI review requested due to automatic review settings September 8, 2026 09:59
@marco-saia-datadog
marco-saia-datadog force-pushed the marcosaia/RUM-18412/xcode-27-support branch from 90c5a11 to 1e6fa2c Compare September 8, 2026 09:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are straightforward API-signature adjustments to improve Xcode 27 compatibility, with only a minor spelling nit identified.

Review details
  • Files reviewed: 11/11 changed files
  • Comments generated: 1
  • Review effort level: Lite

} catch {
consolePrint("\(error)", .error)
reject(nil, "Cannot serialize events, check XCode console for more information", nil)
reject("JSON_SERIALIZATION_ERROR", "Cannot serialize events, check XCode console for more information", nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants