Currently babel-runtime does not polyfill all ES6 language features, so we sometimes run into bugs when we expect certain prototype methods to be available.
For example String.prototype.startsWith
is unavailable in IE11
Currently babel-runtime does not polyfill all ES6 language features...
Half true. We're not actually using babel/polyfill
, we're using the babel/runtime
with webpack, which only polyfills non-prototype things. So we get Map and Set and Object.assign, but not things on String.prototype like startsWith.
The concern in the past was the size of the full polyfill. Given the number of crasher bugs that have slipped through on various platforms because of confusion about what's available and what's not, I think we should bite the bullet and pull in the polyfill.
Half true. We're not actually using babel/polyfill, we're using the babel/runtime with webpack
;) was the title of this issue not clear enough?
:smiley_cat:
I have no idea what I thought I was adding when I wrote that original comment. Total reading comprehension fail on my part. Sorry about that. :person_frowning:
No worries :+1: Thanks for adding notes on the size concerns.
Minified and gzipped it looks like it's 32k (grab the polyfill here to see). That would bring our build.js from about 170k to about 200k. It's not insignificant, but I'd pay that price to enable the features and avoid the problems we've run into. Would be great if we could include it dynamically based on feature-sniffing though. Not sure if that's a thing.
@mtias I think you are the filesize arbiter and czar. What do you think?
This issue has been marked as stale because it hasn't been updated in a while. It will be closed in a week. If you would like it to remain open, can you please comment below and see what you can do to get things moving with this issue? Thanks! 🙏
Fixed in #25419 by @jblz
That would bring our build.js from about 170k to about 200k.
oh the good old days
Most helpful comment
oh the good old days