tradle / rn-nodeify

hack to allow react-native projects to use node core modules, and npm modules that use them
MIT License
615 stars 112 forks source link

Add support for typed arrays #72

Closed Firescar96 closed 5 years ago

Firescar96 commented 6 years ago

I didn't see a mention of typed arrays in the shims. For a react-native project I'm working on I added support for the polyfills from typedarray to the shims.js file generated by rn-nodeify.

This fixed an error I got importing blake2b

Firescar96 commented 6 years ago

Scratch that, it didn't completely fix the error since typedarray doesn't completely support ArrayBuffer. Do you know of a polyfill that does?

mvayngrib commented 6 years ago

@Firescar96 as far as i know, typed arrays are supported natively in most recent ios and android versions, and you shouldn't have to do anything special to add support for them. What error are you hitting?

Firescar96 commented 6 years ago

I got an error on this line that parameter_block is undefined. Above parameter_block is defined as Uint8Array

mvayngrib commented 6 years ago

interesting, but it's unlikely new Uint8Array would return null if they were unsupported. More likely it would crash. Can you add some print statements and check that the line you linked definitely runs second?