Skip to content

Commit

Permalink
Update bundle sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
charpeni committed Feb 10, 2020
1 parent 1fa0302 commit 5843f96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -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!

Expand Down

0 comments on commit 5843f96

Please sign in to comment.