4 ms·
For Topicbox (which doesn’t use React, but that’s irrelevant), I decided a good signal to check was Object.values; if it’s missing, we include core-js. Thus, ol
by chrismorgan 9y ago
For Topicbox (which doesn’t use React, but that’s irrelevant), I decided a good signal to check was Object.values; if it’s missing, we include core-js. Thus, older browsers (IE, Safari≤10.0, iOS≤10.2, Chrome≤53, Firefox≤46 and Edge≤13?) will pull that in, but recent versions of all browsers won’t need the weight (the check is very light, and the overhead roughly `Object.values||require('core-js')`), and you have a solid and dependable ES6+ base to build on.
- realityking 9y agoI assume you're then dynamically loading core-js when it's required? Dynamic module loading is something we've avoided so far, maybe we need to start looking into that.
- chrismorgan 9y agoThis article may interest you: https://philipwalton.com/articles/loading-polyfills-only-when-needed/ https://philipwalton.com/articles/loading-polyfills-only-whe... Also on being able to use new syntax: https://philipwalton.com/articles/deploying-es2015-code-in-production-today/ https://philipwalton.com/articles/deploying-es2015-code-in-p...