You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@
30
30
31
31
<hr />
32
32
33
-
react-native-url-polyfill is a full implementation of the WHATWG [URL Standard](https://url.spec.whatwg.org/) optimized for React Native.
33
+
react-native-url-polyfill is an implementation of the WHATWG [URL Standard](https://url.spec.whatwg.org/) optimized for React Native.
34
34
35
35
-**Lightweight**. Uses a forked version of [`whatwg-url`](https://github.com/jsdom/whatwg-url) ([`whatwg-url-without-unicode`](https://github.com/charpeni/whatwg-url)) where unicode support has been stripped out — Going down from [372 KB](https://bundlephobia.com/[email protected]) to [40.9 KB](https://bundlephobia.com/[email protected]).
36
36
-**Trustworthy**. Follows closely the URL Standard spec, and relys on unit tests and Detox e2e tests within [React Native](https://github.com/facebook/react-native).
@@ -50,10 +50,10 @@ Meanwhile, React Native has grown around that polyfill, then some unexpected err
> - Creating an instance of URL like: `new URL('http://facebook.com')` throws an exception [react-native#16434](https://github.com/facebook/react-native/issues/16434).
52
52
53
-
Unfortunately, adding `react-native-url-polyfill` to React Native source code will means adding 📦 **78.78 KB** (as of RN 0.65) to the JavaScript bundle.
54
-
55
53
That's why you may need this external dependency. So, if you use `URL` within your app, you probably want to take a look at the installation steps below!
56
54
55
+
Unfortunately, adding `react-native-url-polyfill` to React Native source code will means adding 📦 **78.78 KB** (as of RN 0.65) to the JavaScript bundle, that's why it's not included by default.
56
+
57
57
## Installation
58
58
59
59
First, you need to install the polyfill, which can be done with [Yarn](https://yarnpkg.com/) or [npm](https://www.npmjs.com/).
@@ -99,7 +99,7 @@ import { setupURLPolyfill } from 'react-native-url-polyfill';
99
99
setupURLPolyfill();
100
100
```
101
101
102
-
### Option 3 (_Convenient_)
102
+
### Option 3 (_Convenient_ / ponyfill)
103
103
104
104
If you prefer not to apply this polyfill over React Native's default `URL`, you can still import those classes manually when you want them.
0 commit comments