Skip to content

Commit

Permalink
DevTools: Drop IE 11 support
Browse files Browse the repository at this point in the history
DevTools shared Babel config previously supported IE 11 to target Hermes (for the standalone backend that gets embedded within React Native apps). This targeting resulted in less optimal code for other DevTools targets though which did not need to support IE 11. This PR updates the shared config to remove IE 11 support by default, and only enables it for the standalone backend target.
  • Loading branch information
Brian Vaughn committed Sep 21, 2020
1 parent a774502 commit a2e4c88
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions packages/react-devtools-core/webpack.backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ const __DEV__ = NODE_ENV === 'development';

const DEVTOOLS_VERSION = getVersionString();

// This targets RN/Hermes.
process.env.BABEL_CONFIG_ADDITIONAL_TARGETS = JSON.stringify({
ie: '11',
});

module.exports = {
mode: __DEV__ ? 'development' : 'production',
devtool: __DEV__ ? 'cheap-module-eval-source-map' : 'source-map',
Expand Down
9 changes: 7 additions & 2 deletions packages/react-devtools-shared/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ module.exports = api => {
targets.chrome = minChromeVersion.toString();
targets.firefox = minFirefoxVersion.toString();

// This targets RN/Hermes.
targets.ie = '11';
let additionalTargets = process.env.BABEL_CONFIG_ADDITIONAL_TARGETS;
if (additionalTargets) {
additionalTargets = JSON.parse(additionalTargets);
for (const target in additionalTargets) {
targets[target] = additionalTargets[target];
}
}
}
const plugins = [
['@babel/plugin-transform-flow-strip-types'],
Expand Down

0 comments on commit a2e4c88

Please sign in to comment.