Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduling Profiler: Improve import performance by dropping IE support #19872

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions packages/react-devtools-scheduling-profiler/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const chromeManifest = require('../react-devtools-extensions/chrome/manifest.json');
const firefoxManifest = require('../react-devtools-extensions/firefox/manifest.json');

const minChromeVersion = parseInt(chromeManifest.minimum_chrome_version, 10);
const minFirefoxVersion = parseInt(
firefoxManifest.applications.gecko.strict_min_version,
10,
);
validateVersion(minChromeVersion);
validateVersion(minFirefoxVersion);

function validateVersion(version) {
if (version > 0 && version < 200) {
return;
}
throw new Error('Suspicious browser version in manifest: ' + version);
}

module.exports = api => {
const isTest = api.env('test');
const targets = {};
if (isTest) {
targets.node = 'current';
} else {
targets.chrome = minChromeVersion.toString();
targets.firefox = minFirefoxVersion.toString();
// We won't support IE because that'll double profile import times.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unfortunate that we have to "support" IE for the case of RN, particularly if this results in less optimal compiled code. Maybe we can address this in a more wholistic way.

  1. I'll follow up with the Hermes team to see if this is still the best way to target Hermes for the standalone DevTools' embedded backend.
  2. I'll post a PR (shortly) that kills this target for everything except that standalone backend. (That seems better than leaving it on for everything except the scheduling profiler.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks!

}
const plugins = [
['@babel/plugin-transform-flow-strip-types'],
['@babel/plugin-proposal-class-properties', {loose: false}],
];
if (process.env.NODE_ENV !== 'production') {
plugins.push(['@babel/plugin-transform-react-jsx-source']);
}
return {
plugins,
presets: [
['@babel/preset-env', {targets}],
'@babel/preset-react',
'@babel/preset-flow',
],
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ const DEVTOOLS_VERSION = getVersionString();
const imageInlineSizeLimit = 10000;

const babelOptions = {
configFile: resolve(
__dirname,
'..',
'react-devtools-shared',
'babel.config.js',
),
configFile: resolve(__dirname, 'babel.config.js'),
plugins: shouldUseDevServer
? [resolve(builtModulesDir, 'react-refresh/babel')]
: [],
Expand Down