-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
RFC: Do not include package-local polyfills. #1867
Conversation
61b6b42
to
1c5b025
Compare
Looks good, thanks for trimming this down 👍 |
cd1807c
to
b592f28
Compare
@leebyron has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
71cc27c
to
e63ef05
Compare
@leebyron has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
0d4a502
to
35a8cbd
Compare
Ok, so of course this ended up being way more complicated than originally anticipated. Using native Promises instead of polyfilled Promises broke a bunch of tests since native Promises are implemented using |
4a01e9c
to
82825ee
Compare
This removes babel's core-js polyfills from the distributed NPM builds. This aids in further reducing app bundle size when targeting modern browsers, and allows flexibility in how these polyfills are provided if necessary, which can help fix React Native specific issues, as illustrated in #1799 and #1704 and #1818. The drawback is that polyfills for these things are now something that client developers will need to think about directly. Shipping Relay to older browsers before this diff should work fine, but after this diff will require global polyfills. As such, this diff may constitute at least a minor-breaking change.
@leebyron has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Alas, because FB's internal environment still asserts a polyfilled Promise during test runs, these tests will fail in that environment even though they succeed in this one. Closing this PR in favor of #1870, but hopefully this work is not meaningless if we ever change how this internal environment works and wish to support native promises in these tests. |
This removes babel's core-js polyfills from the distributed NPM builds. This aids in further reducing app bundle size when targeting modern browsers, and allows flexibility in how these polyfills are provided if necessary, which can help fix React Native specific issues, as illustrated in #1799 and #1704 and #1818.
The drawback is that polyfills for these things are now something that client developers will need to think about directly. Shipping Relay to older browsers before this diff should work fine, but after this diff will require global polyfills. As such, this diff may constitute at least a minor-breaking change.