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

Ship additional required polyfills #269

Closed
taion opened this issue Jul 28, 2016 · 6 comments
Closed

Ship additional required polyfills #269

taion opened this issue Jul 28, 2016 · 6 comments

Comments

@taion
Copy link

taion commented Jul 28, 2016

Follow-up from #198, #238.

Per http://babeljs.io/docs/usage/caveats/#polyfills, generators are not the only supported language feature that require a polyfill.

Array destructuring, for-of loops, and the array spread operator all require additional polyfills. As such, this project should also ship polyfills for Symbol and Array.from.

It would be possible to accomplish when needed this just by re-enabling transpiling the helpers for the Babel runtime transform, though because of https://phabricator.babeljs.io/T7519, a few of the helpers pull in the Symbol polyfill unnecessarily.

@insin
Copy link
Contributor

insin commented Jul 29, 2016

Is it potentially problematic that babel-runtime vendors core-js? If react-scripts takes a dependency on core-js for default polyfills, it won't be deduplicated by npm.

https://npmcdn.com/babel-runtime/

@taion
Copy link
Author

taion commented Jul 29, 2016

TIL. Wow, that's a bit inconvenient for this use case. I guess babel-runtime has to vendor core-js though.

I suggested babel-runtime as it would only bring in those polyfills if needed. Directly bringing in the polyfills would also work, though.

@insin
Copy link
Contributor

insin commented Jul 29, 2016

Having Symbol guaranteed would also mean the inline elements transform could be used for production builds.

@gaearon
Copy link
Contributor

gaearon commented Sep 30, 2016

For future reference, this is currently blocked on babel/babel#4418.

@clarkbw
Copy link

clarkbw commented Jul 21, 2017

The babel issue babel/babel#4418 is closed now. However I think this issue could be closed as well because I believe the rest is covered by #2391 (Babel 7 Umbrella)

@taion
Copy link
Author

taion commented Jul 25, 2017

Thanks @clarkbw! I think Inbox swallowed my email notification here or something, so I didn't see this until just now.

@taion taion closed this as completed Jul 25, 2017
@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants