ES6 + Babel + which polyfills ?
On a recent big project we choose to work with ecmascript 6. It’s great. I already does this on meteor projects. But, in this case, we had to be compliant with a large set of browers. Not old ones, but at least IE11, and we had to get a bad but redable experience on IE10.
We choose Babel to transpile our JS, Gulp for the build system, and Browserify for the js packaging. We noticed some bugs on IE10 because of parent constructior call order not managed finely in this browser. But we also had some problem because of missing feature like String.startsWith.
So to solve these problems, in our class constructor we have added a fallback (if isIE() then call parent constructor). And we installed babel-polyfills. But there is a counter parts for this. the polyfills are huge : around 254Ko minified. Even with the gzip server options it was too much.
Today i found a cool project : core-js. I noticed that babel talk about it, but i didn’t get the time to have a look for it. Today, i removed babel-polyfills and add only wanted polyfills with core-js. I saved around 245Ko. This is cool !