[RUM-18412] feat: fix Xcode 27 build issues - #1408
Conversation
c16e8d6 to
bae8ab1
Compare
bae8ab1 to
9350784
Compare
There was a problem hiding this comment.
🔵 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 replaceRCTPromiseResolveBlock/RCTPromiseRejectBlockin Swift@objcAPIs. - 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.
9350784 to
1eef006
Compare
There was a problem hiding this comment.
🟡 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
| /// 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` |
There was a problem hiding this comment.
🟢 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
There was a problem hiding this comment.
🟡 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 { |
| /// 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. |
90c5a11 to
1e6fa2c
Compare
There was a problem hiding this comment.
🟢 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) |
What does this PR do?
Introduces support for Xcode 27 by fixing some Session Replay build issues.
Review checklist (to be filled by reviewers)