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

[FSSDK-10316] crypto and text encoder polyfill addition for React native #936

Merged
merged 4 commits into from
Jun 28, 2024

Conversation

junaed-optimizely
Copy link
Contributor

Summary

  • crypto module is not supported by React native. Our SDK currently throws "crypto.getRandomValues() not available" error. A polyfill has been added to avoid that issue.
  • Hermes (React native: JS engine) did not have TextEncoder support until recently. A polyfill has been added for react-native <= 0.73

Test plan

Modified existing React Native test to adjust with the current changes. Existing test should pass

Issues

FSSDK-10316

@coveralls
Copy link

Coverage Status

coverage: 90.307%. remained the same
when pulling ff8c3c2 on junaed/fssdk-10316
into 4909efb on master.

@coveralls
Copy link

Coverage Status

coverage: 90.307%. remained the same
when pulling bf50567 on junaed/fssdk-10316
into 4909efb on master.

Copy link
Contributor

@mikechu-optimizely mikechu-optimizely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some nit but LGTM. Thanks for const+let

__mocks__/fast-text-encoding.ts Outdated Show resolved Hide resolved
__mocks__/react-native-get-random-values.ts Outdated Show resolved Hide resolved
@coveralls
Copy link

Coverage Status

coverage: 90.307%. remained the same
when pulling e0170f3 on junaed/fssdk-10316
into 4909efb on master.

@junaed-optimizely junaed-optimizely merged commit 46e2ab4 into master Jun 28, 2024
20 checks passed
@junaed-optimizely junaed-optimizely deleted the junaed/fssdk-10316 branch June 28, 2024 14:08
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.

3 participants