Closed erikt9 closed 2 years ago
No, it would be insanely harmful to remove them, given how easy it is for you to remove them in your bundled if and only if you know that your application doesn't need them.
Polyfills should and will remain for eternity, because it's the safest default, always.
When bundling with webpack, polyglot.js takes up 91k of space (unminified). If I alias the polyfill dependencies of this library 'string.prototype.trim', 'object.entries', 'array.prototype.foreach' to implementations that simply call the modern browser functionality, the bundle is 20K.
Given the dominating percentage of the overall package size the polyfills are consuming, it may be best to remove them and allow the developer to supply them if they so choose. At the very least, it may be time for the polyfills 'string.prototype.trim' and 'array.prototype.foreach' to be removed as these are long standard ES5 features.