Skip to content

fix: remove polyfills from the library#1141

Open
matinzd wants to merge 1 commit intooptimizely:masterfrom
matinzd:patch-1
Open

fix: remove polyfills from the library#1141
matinzd wants to merge 1 commit intooptimizely:masterfrom
matinzd:patch-1

Conversation

@matinzd
Copy link
Copy Markdown

@matinzd matinzd commented Mar 20, 2026

Removing two import statements that are no not needed. Polyfills should be imported/configured by the user in their project. Some people might want to use https://github.com/margelo/react-native-quick-crypto

/cc @mrousavy

Removed unused imports for fast-text-encoding and react-native-get-random-values.
@matinzd matinzd changed the title Remove unused imports in index.react_native.ts fix: remove polyfills from the library Mar 20, 2026
Comment on lines -16 to -18
import 'fast-text-encoding';
import 'react-native-get-random-values';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree users should be able to bring their own polyfills, but removing these imports outright would be a breaking change.

A better approach for the current version would be conditional imports (similar to how we handle @react-native-async-storage/async-storage) - check if the globals already exist before requiring the polyfill packages.

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