Skip to content
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

ES2016 feature Array.includes is not transpiled #942

Closed
kasperpeulen opened this issue Oct 22, 2016 · 5 comments
Closed

ES2016 feature Array.includes is not transpiled #942

kasperpeulen opened this issue Oct 22, 2016 · 5 comments

Comments

@kasperpeulen
Copy link
Contributor

kasperpeulen commented Oct 22, 2016

Array.prototype.includes is not transpiled not sure if this a problem with a babel setting here or a problem with babel itself. But this break IE.

@EnoahNetzach
Copy link
Contributor

Related to #914, CRA purposely doesn't bring in a lot of polyfills, and Array.prototype.includes has to be polyfilled on IE

@kasperpeulen
Copy link
Contributor Author

kasperpeulen commented Oct 22, 2016

@EnoahNetzach I would say that a polyfill is not necessary, you could transpile array.includes(i) to array.indexOf(i) !== -1

Edit: Oops, I see now that this is hard to transpile, because you have to know that array is an Array.

@vernondegoede
Copy link

vernondegoede commented Oct 22, 2016

Polyfills are defined in packages/react-scripts/config/polyfills.js. Looks like there's no support for array.includes at this moment.

@vernondegoede
Copy link

vernondegoede commented Oct 22, 2016

@gaearon said in #170 that more polyfills can be added in the future.

I believe Array.prototype.includes would be a good one to include by default.

@gaearon
Copy link
Contributor

gaearon commented Nov 20, 2016

Closing in favor of #969: we need to document available polyfills.
We don't intend to include most of the ES polyfills by default.

@gaearon gaearon closed this as completed Nov 20, 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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants