Bug 1793760 - [devtools] Remove custom mappings for react modules. r=jdescottes

Differential Revision: https://phabricator.services.mozilla.com/D158666
This commit is contained in:
Alexandre Poirot 2022-10-10 11:45:00 +00:00
parent e7aee2779a
commit 3b965e8556
4 changed files with 0 additions and 66 deletions

View File

@ -143,23 +143,6 @@ function getDuplicatedModules(loaders) {
* duplicated modules.
*/
function runDuplicatedModulesTest(loaders, allowedDupes) {
const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
);
if (AppConstants.DEBUG_JS_MODULES) {
// DevTools load different modules when DEBUG_JS_MODULES is true, which
// makes the hardcoded allowedDupes incorrect. Fail the test early and return.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1590630.
ok(
false,
"The DevTools metrics tests should not run with " +
"`--enable-debug-js-modules`. Please disable this option " +
"and run the test again."
);
// early return to avoid polluting the logs with irrelevant errors.
return;
}
const duplicatedModules = getDuplicatedModules(loaders);
// Remove allowedDupes entries, and fail if an allowed entry is not found.

View File

@ -9,12 +9,6 @@ loader.lazyRequireGetter(
"NetworkHelper",
"resource://devtools/shared/webconsole/network-helper.js"
);
loader.lazyGetter(this, "debugJsModules", function() {
const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
);
return !!AppConstants.DEBUG_JS_MODULES;
});
const {
getTheme,
@ -240,7 +234,6 @@ function exportData(win, headers) {
const json = new win.Text();
const JSONView = Cu.cloneInto(
{
debugJsModules,
headers,
json,
readyState: "uninitialized",

View File

@ -18,13 +18,6 @@ define("ServicesMock", () => ({ appinfo: {} }));
/**
* RequireJS configuration for JSON Viewer.
*
* ReactJS library is shared among DevTools. The minified (production) version
* of the library is always available, and is used by default.
*
* In order to use the developer version you need to specify the following
* in your .mozconfig (see also bug 1181646):
* ac_add_options --enable-debug-js-modules
*
* React module ID is using exactly the same (relative) path as the rest
* of the code base, so it's consistent and modules can be easily reused.
*/
@ -34,18 +27,6 @@ require.config({
"devtools/client/jsonview": "resource://devtools-client-jsonview",
"devtools/client/shared": "resource://devtools-client-shared",
"devtools/shared": "resource://devtools/shared",
"devtools/client/shared/vendor/react": JSONView.debugJsModules
? "resource://devtools-client-shared/vendor/react-dev"
: "resource://devtools-client-shared/vendor/react",
"devtools/client/shared/vendor/react-dom": JSONView.debugJsModules
? "resource://devtools-client-shared/vendor/react-dom-dev"
: "resource://devtools-client-shared/vendor/react-dom",
"devtools/client/shared/vendor/react-prop-types": JSONView.debugJsModules
? "resource://devtools-client-shared/vendor/react-prop-types-dev"
: "resource://devtools-client-shared/vendor/react-prop-types",
"devtools/client/shared/vendor/react-dom-test-utils": JSONView.debugJsModules
? "resource://devtools-client-shared/vendor/react-dom-test-utils-dev"
: "resource://devtools-client-shared/vendor/react-dom-test-utils",
Services: "resource://devtools-client-shared/vendor/react-prop-types",
},
map: {

View File

@ -14,9 +14,6 @@ var { Loader, Require, resolveURI, unload } = ChromeUtils.import(
var { requireRawId } = ChromeUtils.importESModule(
"resource://devtools/shared/loader/loader-plugin-raw.sys.mjs"
);
const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
);
const EXPORTED_SYMBOLS = [
"DevToolsLoader",
@ -101,7 +98,6 @@ function DevToolsLoader({
"devtools/shared/locales": "chrome://devtools-shared/locale",
"devtools/startup/locales": "chrome://devtools-startup/locale",
"toolkit/locales": "chrome://global/locale",
...this.devPaths,
};
this.loader = new Loader({
@ -177,25 +173,6 @@ function DevToolsLoader({
}
DevToolsLoader.prototype = {
get devPaths() {
if (AppConstants.DEBUG_JS_MODULES) {
return {
"devtools/client/shared/vendor/react":
"resource://devtools/client/shared/vendor/react-dev",
"devtools/client/shared/vendor/react-dom":
"resource://devtools/client/shared/vendor/react-dom-dev",
"devtools/client/shared/vendor/react-dom-server":
"resource://devtools/client/shared/vendor/react-dom-server-dev",
"devtools/client/shared/vendor/react-prop-types":
"resource://devtools/client/shared/vendor/react-prop-types-dev",
"devtools/client/shared/vendor/react-dom-test-utils":
"resource://devtools/client/shared/vendor/react-dom-test-utils-dev",
};
}
return {};
},
destroy(reason = "shutdown") {
unload(this.loader, reason);
delete this.loader;