-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
react-native-url-polyfill is a full implementation of the WHATWG [URL Standard](https://url.spec.whatwg.org/) that has been optimized for React Native. | ||
|
||
- **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). | ||
- **Light**. Instead of using directly [`whatwg-url`](https://github.com/jsdom/whatwg-url), this polyfill uses a forked version ([`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 [54 KB](https://bundlephobia.com/[email protected]). | ||
- **Light**. Instead of using directly [`whatwg-url`](https://github.com/jsdom/whatwg-url), this polyfill uses a forked version ([`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 [41 KB](https://bundlephobia.com/[email protected].0-0). | ||
- **Blob support**. Supports React Native's Blob without additional steps. | ||
|
||
## Why do we need this? | ||
|
@@ -46,7 +46,7 @@ Meanwhile, React Native has grown around that polyfill, then some unexpected err | |
> - URL incorrectly adds trailing slash [react-native#24428](https://github.com/facebook/react-native/issues/24428). | ||
> - 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). | ||
Unfortunately, adding `react-native-url-polyfill` to React Native source code will means adding 📦 **84.76 KB** to the JavaScript bundle, even if you don't use `URL` because 🚇 [Metro](https://github.com/facebook/metro) doesn't support [optional imports](https://github.com/react-native-community/discussions-and-proposals/issues/120). | ||
Unfortunately, adding `react-native-url-polyfill` to React Native source code will means adding 📦 **73.41 KB** to the JavaScript bundle, even if you don't use `URL` because 🚇 [Metro](https://github.com/facebook/metro) doesn't support [optional imports](https://github.com/react-native-community/discussions-and-proposals/issues/120). | ||
|
||
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! | ||
|
||
|