4 ms·
Small nitpick: the reduced file size appears to be, in part, due to depending on Map and Set. Polyfilling these will, in turn, increase file size so there's no
by skrebbel 9y ago
Small nitpick: the reduced file size appears to be, in part, due to depending on Map and Set. Polyfilling these will, in turn, increase file size so there's no real file size impact in practice. IMO the blog post could've been more honest about that.
Fantastic release nevertheless!
- crucialfelix 9y agoI don't think you would need to polyfill Map: http://kangax.github.io/compat-table/es6/#test-Map http://kangax.github.io/compat-table/es6/#test-Map or Set: http://kangax.github.io/compat-table/es6/#test-Set http://kangax.github.io/compat-table/es6/#test-Set I will probably continue to transpile for the moment (till I can check everything). There is also polyfill.io which would only polyfill old browsers.
- danabramov 9y agoThe polyfilling is only necessary for IE10 and lower. Many people who are conscious about size don't support old browsers so that's a real win for them. You could also include polyfills conditionally by sniffing the user agent. I'm also fairly sure there exist smaller polyfills for Map and Set. We should probably look for them and suggest them instead.
- skrebbel 9y ago> You could also include polyfills conditionally by sniffing the user agent. That's a pretty good idea, actually. Thanks for the suggestion!
- spicyj 9y agoThis wasn't actually the reason for the reduction, but it is something we weren't acutely accounting for since we already have Map+Set polyfills in our apps and expect most other users to as well. We'll see if we can recommend a smaller polyfill that isn't as large.
- skrebbel 9y agoAwesome! I must admit I never really saw the added value of Map and Set given the size increase - for most purposes objects and arrays work fine in practice. I strongly doubt I'm the only one there.