Skip to content

fix(deps): switch react-native-get-random-values to optional#1298

Open
SYoder1 wants to merge 1 commit into
segmentio:masterfrom
SYoder1:syoder1-random-values
Open

fix(deps): switch react-native-get-random-values to optional#1298
SYoder1 wants to merge 1 commit into
segmentio:masterfrom
SYoder1:syoder1-random-values

Conversation

@SYoder1

@SYoder1 SYoder1 commented Jun 27, 2026

Copy link
Copy Markdown

react-native-get-random-values is required as a peer dependency in both the core and sovran packages. This is used for UUID v4 generation.

I am using react-native-quick-crypto in my app and already polyfill the crypto.getRandomValues function globally. The peer dependency forces me to install react-native-get-random-values even though it no-op on setup.

On the same topic:
I have found in my testing that the UUID generation done on the native side is about 40% faster then using the JS uuid package. Looking back a past PRs and issues, it seems that it has bounced around a few times from being a pure native function to then using uuid and a polyfill because issues while debugging.

I wonder if there is a middle ground where it checks for the best solution at run time, without needing to use a slower solution all the time.

Example: crypto.randomUUID() -> if native module, generate uuid -> use polyfill and uuid package.

@SYoder1

SYoder1 commented Jun 27, 2026

Copy link
Copy Markdown
Author

@abueide I know you just update the peer version of react-native-get-random-values but I would Love your thoughts on making it optional

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

Successfully merging this pull request may close these issues.

2 participants