Skip to content

Add polyfill from polyfill.io #174

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

Closed
wants to merge 1 commit into from

Conversation

ForbesLindesay
Copy link
Contributor

@ForbesLindesay ForbesLindesay commented Jul 25, 2016

Note that we lock to the current default feature set (default-3.6). Future versions of create-react-app will want to update this version number, but we wouldn't want users to inadvertently get different polyfills.

[closes #170]

Note that we lock to the current default feature set (default-3.6).  Future versions of create-react-app will want to update this version number, but we wouldn't want users to inadvertently get different polyfills.
@ghost ghost added the CLA Signed label Jul 25, 2016
@gaearon
Copy link
Contributor

gaearon commented Jul 25, 2016

Future versions of create-react-app will want to update this version number, but we wouldn't want users to inadvertently get different polyfills.

Why would that be bad? They’re only adding, not removing stuff, right?

@ForbesLindesay
Copy link
Contributor Author

They’re only adding, not removing stuff, right?

Probably/Mostly. They haven't committed to never removing anything from the default set. Although they haven't done so yet, it would have been reasonable at one point for them to include Array.prototype.contains in the default set (it was a long way down the standards path) but an incompatibility was discovered at the last minute and contains was deprecated in favour of includes. At this point it would have been reasonable for them to remove the contains polyfill.

You can see what they say about this under https://polyfill.io/v2/docs/features/#default-sets

@gaearon
Copy link
Contributor

gaearon commented Jul 25, 2016

How about we use this set?

https://cdn.polyfill.io/v2/polyfill.js?features=es6,fetch,Symbol&unknown=polyfill
(min: https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,fetch,Symbol&unknown=polyfill)

This seems like the most valuable stuff in React apps, and also protects against issues like #561 with unknown=polyfill.

@gaearon
Copy link
Contributor

gaearon commented Jul 25, 2016

It’s also more descriptive than default-3.6.

@gaearon
Copy link
Contributor

gaearon commented Jul 25, 2016

Also worth checking: does their Promise polyfill swallow errors.

@JakeChampion
Copy link

I don't think you can solve uncaught rejections in userland (polyfills).

@gaearon
Copy link
Contributor

gaearon commented Jul 25, 2016

I don't think you can solve uncaught rejections in userland (polyfills).

Why not? It won’t be 100% accurate but we need to err on the side of less head scratching. Advanced Promise users who know what they’re doing with temporarily unhandled rejections will just include another polyfill.

@gaearon
Copy link
Contributor

gaearon commented Jul 25, 2016

Also core-js does this.

@gaearon
Copy link
Contributor

gaearon commented Jul 27, 2016

We went with embedded fetch and Promise polyfills for now so closing.

@gaearon gaearon closed this Jul 27, 2016
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Polyfill
3 participants