Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayBuffer over RN Bridge #107

Closed
EternalDeiwos opened this issue Mar 8, 2019 · 3 comments
Closed

ArrayBuffer over RN Bridge #107

EternalDeiwos opened this issue Mar 8, 2019 · 3 comments

Comments

@EternalDeiwos
Copy link

Introduction

There has been discussion on the main repo (facebook/react-native#1424) about the use of ArrayBuffers over the React Native Bridge -- specifically around the use of websockets. This issue was resolved and we are now supposedly able to receive websocket message and fetch response bodies as ArrayBuffers (I haven't done this myself but I've seen a bunch of things suggesting that it works). Would it be possible to extend these specific cases to support ArrayBuffers as a first class data type for the RN Bridge?

The Core of It

Those of us who are attempting to use native features for communication and cryptographic operations (among many others) would benefit from being able to pass data through the bridge. In particular, this would ease access to device hardware such as the Android KeyStore / iOS Secure Enclave, NFC, etc.

Current Solutions

Currently I'm just base64 encoding my ArrayBuffers and passing them through the bridge as a string.

Discussion

  • How are you currently getting around this (if not the same as the above)?
  • Are there things you'd like to do that do not have a work-around?
  • What would be involved in supporting this?
@kelset
Copy link
Member

kelset commented Mar 8, 2019

👋 there - as stated in the README and the issue template, this repo is for long-form discussions. Yours seems more a precise feature request, so I suggest you use Canny instead.

That said, two more things:

  1. with the current re-architecture of RN ongoing, the bridge will change significantly, so I think that you should check the dedicated discussions in this repo (probably TurboModules and JSI are the ones that may interest you most

  2. You should also take a look at this conversation Support for server-sent events (EventSource) #99 as I feel it overlaps a bit with what you are working with

@kelset kelset closed this as completed Mar 8, 2019
@elicwhite
Copy link

Also, I believe TurboModules will provide exactly what you are looking for. JS and Native will be able to share references to objects and memory managed by native.

@pke
Copy link

pke commented Mar 4, 2021

@TheSavior had TurboModules landed in RN yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants