@samitouri / QOS-React-2 / commits / a8de69f358

DevTools: Drop IE 11 support (#19875)

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.

Brian Vaughn committed Sep 21, 2020 at 11:07 UTC a8de69f358acb6d0be5f1c2970592fb0b1b821a1
2 files changed +12 -2
packages/react-devtools-core/webpack.backend.js
+5
@@ -17,6 +17,11 @@ const __DEV__ = NODE_ENV === 'development';
17
18 const DEVTOOLS_VERSION = getVersionString();
19
20 +// This targets RN/Hermes.
21 +process.env.BABEL_CONFIG_ADDITIONAL_TARGETS = JSON.stringify({
22 + ie: '11',
23 +});
24 +
25 module.exports = {
26 mode: __DEV__ ? 'development' : 'production',
27 devtool: __DEV__ ? 'cheap-module-eval-source-map' : 'source-map',
packages/react-devtools-shared/babel.config.js
+7 -2
@@ -25,8 +25,13 @@ module.exports = api => {
25 targets.chrome = minChromeVersion.toString();
26 targets.firefox = minFirefoxVersion.toString();
27
28 - // This targets RN/Hermes.
29 - targets.ie = '11';
28 + let additionalTargets = process.env.BABEL_CONFIG_ADDITIONAL_TARGETS;
29 + if (additionalTargets) {
30 + additionalTargets = JSON.parse(additionalTargets);
31 + for (const target in additionalTargets) {
32 + targets[target] = additionalTargets[target];
33 + }
34 + }
35 }
36 const plugins = [
37 ['@babel/plugin-transform-flow-strip-types'],