Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update config to support specific browser versions
The Babel config had previously supported all browsers with greater than 0.25% global usage (according to `browserlist`). This resulted in `babel-preset-env` including plugins sufficient to support the following minimum browser versions: ``` { "chrome": "49", "android": "4.4", "edge": "16", "firefox": "52", "ios": "9.3", "safari": "11" } ``` Instead, the babel config now explicitly supports chrome >= 58 and firefox >= 53. Chrome and Firefox are the only browsers we currently publish to, and these were the minimum versions with no additional Babel transformations. The minimum browser versions we support should be re-evaluated later, after we have added tests and documentation. The `stage-0` Babel preset has also been replaced with the specific Babel plugins that we depend upon. We don't use most of `stage-0`, so this allowed us to remove many unnecessary transformations. We had to remove this preset soon anyway, because all of the stage presets are deprecated in Babel 7. The `stage-0` preset consisted of these plugins: ``` "transform-do-expressions" "transform-function-bind" "transform-class-constructor-call" "transform-export-extensions" "transform-class-properties" "transform-decorators" "syntax-dynamic-import" "syntax-trailing-function-commas" "transform-async-generator-functions" "transform-async-to-generator" "transform-exponentiation-operator" "transform-object-rest-spread" ``` Of that list, only 'transform-class-properties' and 'transform-object- rest-spread' were required. 'transform-async-to-generator' was being used (as we are using async/await), but our browser targets all support async/await, so that could be removed. The remainder of the plugins were completely unused. Removing some of these transformations exposed bugs in `uglify-es` that only presented themselves in the production build. `gulp-uglify-es` has been updated to a version that uses `terser` instead of `uglify-es`, which has resolved these issues. Relates to MetaMask#6805
- Loading branch information