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
Copy expo-random module to crypto #20217
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing to consider that we talked about: add warnings to functions in expo-random
, so people upgrading to SDK 48 will see it.
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
Co-authored-by: Tomasz Sapeta <tomasz.sapeta@swmansion.com>
dccb052
to
929e2a3
Compare
Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines. I've found some issues in your pull request that should be addressed (click on them for more details) 👇
|
Is there also a migration planned for Quick workaround otherwise is: import * as Crypto from 'expo-crypto';
const webCrypto = typeof crypto !== 'undefined' ? crypto : Crypto;
if (typeof crypto === 'undefined') {
Object.defineProperty(window, 'crypto', {
configurable: true,
enumerable: true,
get: () => webCrypto,
});
} But actually I just noticed my usecase is solved with |
Yes, I think we'll eventually migrate That's perfect if |
Why
Two modules have no clear separation of concerns and we want to do significant expansion on the crypto functionality to use the new TypedArrays
expo-modules
API.It's easier if we sunset
expo-random
and useexpo-crypto
instead, as suggested by @tsapeta.How
Copied functions, added a test screen to
expo-crypto
.Test Plan
Copied existing tests, so the coverage should remain unchanged.
Checklist
expo prebuild
& EAS Build (eg: updated a module plugin).