Skip to content

ArrayBuffer support to ObjC TurboModules #56986

Open
paradowstack wants to merge 6 commits into
facebook:mainfrom
paradowstack:feat/array-buffers-objc
Open

ArrayBuffer support to ObjC TurboModules #56986
paradowstack wants to merge 6 commits into
facebook:mainfrom
paradowstack:feat/array-buffers-objc

Conversation

@paradowstack
Copy link
Copy Markdown
Contributor

Summary:

Adds ArrayBuffer support to ObjC TurboModules, following the C++ ArrayBuffer PR (226ef2e).

  • Codegen support for ArrayBufferTypeAnnotation in ObjC module specs (NSMutableData * params/returns, new ArrayBufferKind)
  • RCTZeroCopyDataNSMutableData subclass for wrapping external memory without copying
  • Three-path JSI↔ObjC conversion: native-backed zero-copy, sync JS-backed borrow, async copy
  • isSync flag threaded through the invocation path to select the correct conversion strategy; defaults to NO (safe copy) for call sites outside the TurboModule dispatch path

Android support will follow in a separate PR. This PR touches some Java parts only to get the project building.

Changelog:

[IOS] [ADDED] - Add ArrayBuffer support to ObjC TurboModules

Test Plan:

  • New unit tests in RCTTurboModuleArrayBufferTests.mm
  • rn-tester: getArrayBuffer, createNativeBuffer, processAsyncBuffer, getAsyncBuffer added to NativeSampleTurboModule

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 28, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Callstack Partner: Callstack Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant