Skip to content

[0.88] Revert RCTArrayBuffer ObjC TurboModule type change (breaking in a non-breaking release) #1417

Description

@fabriziocucci

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions