Target Branch
0.88
Link to commit or PR to be picked
Reverts, both on 0.88-stable:
Description
0.88 is a non-breaking release. #57879 is a confirmed breaking change to the ObjC TurboModule surface and must not ship in it.
The breaking change
Codegen emits a different ObjC type for TurboModule methods taking or returning an ArrayBuffer. Modules that adopted ObjC ArrayBuffer support in 0.87 stop compiling until they update. It is already documented in the 0.88.0-rc.0 changelog under Breaking.
Why two reverts and not one
The type moved twice inside 0.88, so reverting #57879 alone does not restore 0.87:
| Point |
Argument type |
Return type |
| 0.87-stable |
NSMutableData * |
NSMutableData * |
| after #57596 (0.88 only) |
NSMutableData * |
NSData * |
| after #57879 (0.88 only) |
RCTArrayBuffer * |
RCTArrayBuffer * |
NSMutableData is a subclass of NSData, so returning NSData where 0.87 returned NSMutableData still breaks any caller that mutates the result. Reverting only #57879 would leave a second, quieter breaking change in place.
Scope, and how it was determined
Enumerated every 0.88-only commit touching the ObjC TurboModule surface (codegen GenerateModuleObjCpp, RCTArrayBuffer.*, the iOS ReactCommon module dir, iostests, and the Apple cxx-api snapshots), then filtered to those whose added or removed lines mention ArrayBuffer, NSData or NSMutableData. Five matched:
11f9a7f4491 #57879 — revert
5e86c323cef #57596 — revert
d84c13d5111 #57982, 5bb96395949 #57897 — Java only, Android snapshots, zero ObjC codegen type changes
5fb3ebce1ac — Java ArrayBuffer support. Touches the ObjC codegen, but only to add the throwIfUnsupportedPromiseArrayBuffer validation guard. No type mapping, so out of scope.
All four RCTArrayBuffer entries in the public Apple API snapshot blame to 11f9a7f4491 alone.
Kept, not reverted
Both conflict with the revert, but each references RCTArrayBuffer only in context lines, never in an added or removed line. The conflicts are textual adjacency, not a dependency, so both were preserved through hand-resolution.
Verification
- Resolved codegen
serializeMethod.js ArrayBuffer lines are identical to 0.87-stable.
- Regenerated
GenerateModuleHObjCpp snapshot matches 0.87 except for promiseArrayBuffer, which the throwIfUnsupportedPromiseArrayBuffer guard now rejects. That guard is a separate 0.88 change, deliberately retained.
- No
RCTArrayBuffer or mustCopyBytes references remain anywhere under ReactCommon/react/nativemodule/.
convertJSIValueToObjCObject is back to its 4-parameter form with BOOL useNSNull = NO defaulted in the header, so the restored 3-argument call sites compile.
- The three #58190 tests and the #58264 test are all still present.
yarn jest packages/react-native-codegen passes: 64 suites, 3129 tests, 1279 snapshots.
Net: 16 files, 132 insertions, 607 deletions.
The iOS build and the ObjC unit tests are covered by branch CI rather than locally.
Target Branch
0.88
Link to commit or PR to be picked
Reverts, both on
0.88-stable:11f9a7f4491) — RCTArrayBuffer zero-copy class for ObjC TM5e86c323cef) — Use NSData for the JS->ObjC ArrayBuffer argument pathDescription
0.88 is a non-breaking release. #57879 is a confirmed breaking change to the ObjC TurboModule surface and must not ship in it.
The breaking change
Codegen emits a different ObjC type for TurboModule methods taking or returning an
ArrayBuffer. Modules that adopted ObjCArrayBuffersupport in 0.87 stop compiling until they update. It is already documented in the 0.88.0-rc.0 changelog underBreaking.Why two reverts and not one
The type moved twice inside 0.88, so reverting #57879 alone does not restore 0.87:
NSMutableData *NSMutableData *NSMutableData *NSData *RCTArrayBuffer *RCTArrayBuffer *NSMutableDatais a subclass ofNSData, so returningNSDatawhere 0.87 returnedNSMutableDatastill breaks any caller that mutates the result. Reverting only #57879 would leave a second, quieter breaking change in place.Scope, and how it was determined
Enumerated every 0.88-only commit touching the ObjC TurboModule surface (codegen
GenerateModuleObjCpp,RCTArrayBuffer.*, the iOSReactCommonmodule dir,iostests, and the Apple cxx-api snapshots), then filtered to those whose added or removed lines mentionArrayBuffer,NSDataorNSMutableData. Five matched:11f9a7f4491#57879 — revert5e86c323cef#57596 — revertd84c13d5111#57982,5bb96395949#57897 — Java only, Android snapshots, zero ObjC codegen type changes5fb3ebce1ac— Java ArrayBuffer support. Touches the ObjC codegen, but only to add thethrowIfUnsupportedPromiseArrayBuffervalidation guard. No type mapping, so out of scope.All four
RCTArrayBufferentries in the public Apple API snapshot blame to11f9a7f4491alone.Kept, not reverted
253a84c8d1c) — TurboModule identity on rethrown exceptionsea291d7422e) — top-level JS null to ObjC asnilBoth conflict with the revert, but each references
RCTArrayBufferonly in context lines, never in an added or removed line. The conflicts are textual adjacency, not a dependency, so both were preserved through hand-resolution.e7bb11ae162) — also kept. It adds one#import <react/bridging/ArrayBuffer.h>line. After the reverts,RCTTurboModuleArrayBufferTests.mmis byte-identical to 0.87 apart from that import, and the header exists on 0.87.Verification
serializeMethod.jsArrayBuffer lines are identical to 0.87-stable.GenerateModuleHObjCppsnapshot matches 0.87 except forpromiseArrayBuffer, which thethrowIfUnsupportedPromiseArrayBufferguard now rejects. That guard is a separate 0.88 change, deliberately retained.RCTArrayBufferormustCopyBytesreferences remain anywhere underReactCommon/react/nativemodule/.convertJSIValueToObjCObjectis back to its 4-parameter form withBOOL useNSNull = NOdefaulted in the header, so the restored 3-argument call sites compile.yarn jest packages/react-native-codegenpasses: 64 suites, 3129 tests, 1279 snapshots.Net: 16 files, 132 insertions, 607 deletions.
The iOS build and the ObjC unit tests are covered by branch CI rather than locally.