Files
react-native/packages/react-native-codegen
Kamil Paradowski 54b88d9dea ArrayBuffer support to ObjC TurboModules
Summary:
Adds ArrayBuffer support to ObjC TurboModules, following the C++ ArrayBuffer PR ([`226ef2e`](https://github.com/facebook/react-native/commit/226ef2e7c5d1928d5696dc23efc1b8950ba00e37)).

- Codegen support for `ArrayBufferTypeAnnotation` in ObjC module specs (`NSMutableData *` params/returns, new `ArrayBufferKind`)
- JSI↔ObjC conversion wraps native-backed buffers zero-copy via `-[NSMutableData initWithBytesNoCopy:length:deallocator:]`; the deallocator retains the backing store so the bytes stay valid even if the `NSMutableData` escapes the call or the source ArrayBuffer is garbage-collected
- JS-backed buffers are copied, which is safe on both the synchronous and asynchronous paths

This PR is iOS-only; Android support follows in a separate PR.

## Changelog:

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

X-link: https://github.com/facebook/react-native/pull/56986

Reviewed By: javache

Differential Revision: D106846249

Pulled By: christophpurrer

fbshipit-source-id: 3393d5d6f31a1412f5d52328c90e51205aa6b153
2026-06-27 23:41:58 -07:00
..

@react-native/codegen

npm npm downloads

Code generation tools for React Native. Parses TypeScript and Flow NativeModule and Component specs and generates the native binding code used by the New Architecture.