Object.assign et al are not polyfilled
Created by: conatus
Hi all,
Thanks for your wonderful work on this.
When testing a React app using create-react-app
on a old version of mobile Safari I noticed that Object.assign
was failing.
I looked and saw that polyfill support is turned off on the configuration of babel-plugin-transform-runtime
https://github.com/facebookincubator/create-react-app/blob/master/config/babel.prod.js#L33-L37
I worked around this by, for the moment, slightly inefficiently manually adding babel-polyfill
and using the more "traditional" import 'babel-polyfill';
at the root of the application to include core-js
polyfills.
Seems that if the goal is zero configuration setup this is going to be a gotcha for more than a few folks. Unsure if the best approach is to simply turn on the polyfill in babel-plugin-transform-runtime
as the documentation seems to suggest this is not the intent of this transformation to supplement native methods like Object.assign
.