Skip to content

Commit 5fc7cac

Browse files
committed
Revert back to original Chrome and Firefox support matrix
1 parent b48ab94 commit 5fc7cac

File tree

1 file changed

+27
-16
lines changed

1 file changed

+27
-16
lines changed

packages/react-devtools-scheduling-profiler/babel.config.js

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,42 @@
1+
const chromeManifest = require('../react-devtools-extensions/chrome/manifest.json');
2+
const firefoxManifest = require('../react-devtools-extensions/firefox/manifest.json');
3+
4+
const minChromeVersion = parseInt(chromeManifest.minimum_chrome_version, 10);
5+
const minFirefoxVersion = parseInt(
6+
firefoxManifest.applications.gecko.strict_min_version,
7+
10,
8+
);
9+
validateVersion(minChromeVersion);
10+
validateVersion(minFirefoxVersion);
11+
12+
function validateVersion(version) {
13+
if (version > 0 && version < 200) {
14+
return;
15+
}
16+
throw new Error('Suspicious browser version in manifest: ' + version);
17+
}
18+
119
module.exports = api => {
220
const isTest = api.env('test');
3-
21+
const targets = {};
22+
if (isTest) {
23+
targets.node = 'current';
24+
} else {
25+
targets.chrome = minChromeVersion.toString();
26+
targets.firefox = minFirefoxVersion.toString();
27+
// We won't support IE because that'll double profile import times.
28+
}
429
const plugins = [
530
['@babel/plugin-transform-flow-strip-types'],
631
['@babel/plugin-proposal-class-properties', {loose: false}],
7-
8-
// The plugins below fix compilation errors on Webpack 4.
9-
// See: https://github.com/webpack/webpack/issues/10227
10-
// TODO: Remove once we're on Webpack 5.
11-
['@babel/plugin-proposal-optional-chaining'],
12-
['@babel/plugin-proposal-nullish-coalescing-operator'],
1332
];
1433
if (process.env.NODE_ENV !== 'production') {
1534
plugins.push(['@babel/plugin-transform-react-jsx-source']);
1635
}
17-
1836
return {
1937
plugins,
2038
presets: [
21-
[
22-
'@babel/preset-env',
23-
{
24-
targets: isTest
25-
? {node: 'current'}
26-
: 'last 2 Chrome versions, last 2 Firefox versions',
27-
},
28-
],
39+
['@babel/preset-env', {targets}],
2940
'@babel/preset-react',
3041
'@babel/preset-flow',
3142
],

0 commit comments

Comments
 (0)