-
Notifications
You must be signed in to change notification settings - Fork 161
Description
Description
We need to remove the react-native-get-random-values
dependency from our cryptography
package.
Problem
This package was previously added as a workaround to ensure that users running @hashgraph/sdk
in Expo or React Native environments would not need to manually import react-native-get-random-values
at the root level (App.js/tsx
). While this made initial integration easier for those users, it introduced an unintended side effect: our cryptography package, which should be strictly environment-agnostic, now includes React-specific dependencies.
This is problematic because:
- It breaks the abstraction boundary — the cryptography package should have zero knowledge of whether it is being used in a Node, browser, or React Native context.
- It unnecessarily pulls React Native dependencies into environments that don’t need them.
- It causes issues with dependency trees, tree shaking, and potentially confuses consumers of the package.
Acceptance Criteria
- Remove
react-native-get-random-values
fromdependencies
orpeerDependencies
. - Remove any
import "react-native-get-random-values"
statements from this package. - Update documentation to clearly state that React Native / Expo users must import
react-native-get-random-values
themselves before using the SDK. - Audit any other references or implicit assumptions about React Native within the cryptography package.
Notes
We acknowledge that this workaround was originally introduced with good intentions — to simplify the setup for users of the SDK on Expo. However, it's more important for the integrity and maintainability of our codebase to ensure proper separation of concerns. It’s better long-term to push this responsibility to the app layer.
Let’s get this fixed and keep our packages clean and environment-independent.