Bug 1486446 - Remove Console Launchpad support; r=bgrins.
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Mon, 27 Aug 2018 16:31:58 +0000
changeset 491296 6f6eab842feaf00a38653dd4405aca1ec4d075db
parent 491295 a360d3279b9f2ac82a7e81f3878a6eff63a466e8
child 491297 a2e7223d34fcb8eefedf5aa303ad9f0b9fe9b5e0
push id1815
push userffxbld-merge
push dateMon, 15 Oct 2018 10:40:45 +0000
treeherdermozilla-release@18d4c09e9378 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1486446
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1486446 - Remove Console Launchpad support; r=bgrins. It's broken and unmaintained for a long time now, the Console Team does not use it and has no plan doing so. Differential Revision: https://phabricator.services.mozilla.com/D4348
devtools/client/webconsole/README.md
devtools/client/webconsole/bin/configure.js
devtools/client/webconsole/bin/dev-server.js
devtools/client/webconsole/local-dev/index.js
devtools/client/webconsole/package.json
devtools/client/webconsole/test/fixtures/DebuggerClient.js
devtools/client/webconsole/webconsole-frame.js
devtools/client/webconsole/webpack.config.js
--- a/devtools/client/webconsole/README.md
+++ b/devtools/client/webconsole/README.md
@@ -1,149 +1,67 @@
 # WebConsole
 
 The WebConsole (webconsole) shows you all the console API calls made by scripts and alerts
 you when javascript errors are thrown by a script.
 It can also display network logs, and you can evaluate expressions using the console
 input, a.k.a. JsTerm. You can read more about it on [MDN](https://developer.mozilla.org/en-US/docs/Tools/Web_Console)
 to learn all the features and how to use the tool.
 
-## Old / New frontend
-
-The current console used in the toolbox is called the new frontend, and the code lives at
-the root of the `devtools/client/webconsole/` folder.
-The old console code is located in the `devtools/client/webconsole/old` folder.
-Both frontends use the same code for the console input, also called JsTerm (see `jsterm.js`).
-The old frontend is still used for the Browser Console, but is planned to be removed in the
-near future (see Bug 1381834).
-
-## Run WebConsole in DevTools panel
+## Run WebConsole
 
 If you want to build the WebConsole inside of the DevTools toolbox (Firefox Devtools Panels),
 follow the [simple Firefox build](http://docs.firefox-dev.tools/getting-started/build.html)
-document in MDN. Start your compiled firefox and open the Firefox developer tool, you can
+documentation. Start your compiled firefox and open the Firefox developer tool, you can
 then see the WebConsole tab.
 
-## Run WebConsole in a browser tab (experimental)
-
-### Prerequisite
-
-If you would like to run the WebConsole in the browser tab, you need following packages:
-
-* [node](https://nodejs.org/) >= 7.10.0 JavaScript runtime.
-* [yarn](https://yarnpkg.com/docs/install) >= 1.0.0 the package dependency management tool.
-* [Firefox](https://www.mozilla.org/firefox/new/) any version or build from the source code.
-
-### Run WebConsole
-
-Navigate to the `mozilla-central/devtools/client/webconsole` folder with your terminal.
-Note that this folder is available after `mozilla-central` was cloned in order to get a
-local copy of the repository. Then run the following commands:
-
-```bash
-# Install packages
-yarn install
-
-# Create a dev server instance for hosting webconsole on browser
-yarn start
-```
-
-Open `localhost:8000` to see what we call the [launchpad](https://github.com/devtools-html/devtools-core/tree/master/packages/devtools-launchpad).
-The UI that let you start a new Firefox window which will be the target (or debuggee).
-Launchpad will communicate with Firefox (the remote debugging server) and list all opened tabs from Firefox.
-You can then navigate to a website you want in the target window, and you should see it appears
-in the `localhost:8000` page. Clicking on it will start the WebConsole in the browser tab.
-
-### How it works
-
-The WebConsole uses [webpack](https://webpack.js.org/) and several packages from [devtools-core](https://github.com/devtools-html/devtools-core)
-to run as a normal web page. The WebConsole uses [Mozilla remote debugging protocol](http://searchfox.org/mozilla-central/source/devtools/docs/backend/protocol.md)
-to fetch messages and execute commands against Firefox.
-
-Open `localhost:8000` in any browser to see the
-interface. Devtools Launchpad will communicate with Firefox (the remote debugging server)
-and list all opened tabs from Firefox. Click one of the browser tab entry, now you can see
-the WebConsole runs in a browser tab.
-
-### DevTools shared modules
-
-When working on console running via launchpad, you may need to modify code on external modules.
-Besides the third party modules, here are modules required for the WebConsole
-(hosted under the `devtools-core` Github repo, which contains modules shared across Devtools).
-
-* [devtools-config](https://github.com/devtools-html/devtools-core/blob/master/packages/devtools-config/#readme) config used in dev server
-* [devtools-launchpad](https://github.com/devtools-html/devtools-core/blob/master/packages/devtools-launchpad/#readme) provide the dev server, landing page and the bootstrap functions to run devtools in the browser tab.
-* [devtools-modules](https://github.com/devtools-html/devtools-core/blob/master/packages/devtools-modules/#readme) Devtools shared and shim modules.
-* [devtools-source-editor](https://github.com/devtools-html/devtools-core/blob/master/packages/devtools-source-editor/#readme) Source Editor component.
-* [devtools-reps](https://github.com/devtools-html/debugger.html/blob/master/packages/devtools-reps/#readme) remote object formatter for variables representation.
-
-Changes to those modules need to be done on Github, using the Pull Request workflow.
-Then, a new version of the modified package need to be released on npm so the version number
-can be updated in WebConsole's `package.json`. Some modules have a release process,
-look for `RELEASE.md` file in the module folder, or ask a maintainer if you are
-unsure about the release process.
-
 ## Code Structure
 
-Top level files are used to launch the WebConsole inside of the DevTools toolbox or run in
-the browser tab (experimental). The same code base is used to run in both environments.
-
-### Run inside of the DevTools toolbox
-
-Files used to run the WebConsole inside of the DevTools toolbox.
+Top level files are used to launch the WebConsole inside of the DevTools toolbox.
+The main files used to run the WebConsole are:
 
 * `main.js` called by devtools toolbox to launch the WebConsole panel.
 * `index.html` panel UI and launch scripts.
 
-### Run in the browser tab (experimental)
-
-Files used to run the WebConsole in the browser tab
-
-* `bin/` files to launch test server.
-* `configs/` dev configs.
-* `local-dev/index.js` the entry point, equivalent to `index.html`.
-* `webpack.config.js` the webpack config file, including plenty of module aliases map to shims and polyfills.
-* `package.json` declare every required packages and available commands.
-
-To run in the browser tab, the WebConsole needs to get some dependencies from npm module.
-Check `package.json` to see all dependencies. Check `webpack.config.js` to find the module alias,
-and check [devtools-core](https://github.com/devtools-html/devtools-core) packages to dive
-into actual modules used by the WebConsole and other Devtools.
-
 ### UI
 
 The WebConsole UI is built using [React](http://docs.firefox-dev.tools/frontend/react.html)
 components (in `components/`).
 
 The React application is rendered from `webconsole-output-wrapper.js`.
-It contains 3 top components:
+It contains 4 top components:
 * **ConsoleOutput** (in `ConsoleOutput.js`) is the component where messages are rendered.
 * **FilterBar** (in `FilterBar.js`) is the component for the filter bars (filter input and toggle buttons).
 * **SideBar** (in `SideBar.js`) is the component that render the sidebar where objects can be placed in.
+* **JsTerm** (in `JsTerm.js`) is the component that render the console input.
 
 We prefer stateless component (defined by function) instead of stateful component
 (defined by class) unless the component has to maintain its internal state.
 
 ### State
 
-Besides the UI, the WebConsole manages the app state via [Redux](When working on console running via launchpad).
+Besides the UI, the WebConsole manages the app state via [Redux].
 The following locations define the app state:
 
 * `src/constants.js` constants used across the tool including action and event names.
 * `src/actions/` for all actions that change the state.
 * `src/reducers/` for all reducers that change the state.
 * `src/selectors/` functions that return a formatted version of parts of the app state.
 
 The redux state is a plain javascript object with the following properties:
 ```js
 {
   // State of the filter input and toggle buttons
   filters,
+  // State of the input history
+  history,
   // Console messages data and state (hidden, expanded, groups, …)
   messages,
+  // State of notifications displayed on the output (e.g. self-XSS warning message)
+  notifications,
   // Preferences (persist message, message limit, …)
   prefs,
   // Interface state (filter bar visible, sidebar visible, …)
   ui,
 }
 ```
 
 ### Tests
deleted file mode 100644
--- a/devtools/client/webconsole/bin/configure.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* eslint-env node */
-
-"use strict";
-
-const fs = require("fs");
-const path = require("path");
-
-function getConfig() {
-  if (process.env.TARGET === "firefox-panel") {
-    return require("../configs/firefox-panel.json");
-  }
-
-  const developmentConfig = require("../configs/development.json");
-
-  let localConfig = {};
-  if (fs.existsSync(path.resolve(__dirname, "../configs/local.json"))) {
-    localConfig = require("../configs/local.json");
-  }
-
-  return Object.assign({}, developmentConfig, localConfig);
-}
-
-module.exports = {
-  getConfig,
-};
deleted file mode 100644
--- a/devtools/client/webconsole/bin/dev-server.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* eslint-env node */
-
-"use strict";
-
-const toolbox = require("devtools-launchpad/index");
-const feature = require("devtools-config");
-const { getConfig } = require("./configure");
-
-const envConfig = getConfig();
-
-feature.setConfig(envConfig);
-
-const webpackConfig = require("../webpack.config");
-
-toolbox.startDevServer(envConfig, webpackConfig, __dirname);
deleted file mode 100644
--- a/devtools/client/webconsole/local-dev/index.js
+++ /dev/null
@@ -1,99 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- /* eslint-env browser */
-
-"use strict";
-
-const React = require("react");
-const ReactDOM = require("react-dom");
-const { EventEmitter } = require("devtools-modules");
-const { Services: { appinfo, pref } } = require("devtools-modules");
-const { bootstrap } = require("devtools-launchpad");
-
-EventEmitter.decorate(window);
-
-require("../../themes/widgets.css");
-require("../../themes/webconsole.css");
-require("../../themes/components-frame.css");
-require("../../themes/light-theme.css");
-require("../../shared/components/reps/reps.css");
-require("../../shared/components/tabs/Tabs.css");
-require("../../shared/components/tabs/TabBar.css");
-require("../../netmonitor/src/assets/styles/httpi.css");
-
-pref("devtools.debugger.remote-timeout", 10000);
-pref("devtools.hud.loglimit", 10000);
-pref("devtools.webconsole.filter.error", true);
-pref("devtools.webconsole.filter.warn", true);
-pref("devtools.webconsole.filter.info", true);
-pref("devtools.webconsole.filter.log", true);
-pref("devtools.webconsole.filter.debug", true);
-pref("devtools.webconsole.filter.css", false);
-pref("devtools.webconsole.filter.net", false);
-pref("devtools.webconsole.filter.netxhr", false);
-pref("devtools.webconsole.ui.filterbar", false);
-pref("devtools.webconsole.inputHistoryCount", 50);
-pref("devtools.webconsole.persistlog", false);
-pref("devtools.webconsole.timestampMessages", false);
-pref("devtools.webconsole.sidebarToggle", true);
-
-const WebConsoleOutputWrapper = require("../webconsole-output-wrapper");
-const WebConsoleFrame = require("../webconsole-frame").WebConsoleFrame;
-
-// Copied from netmonitor/index.js:
-window.addEventListener("DOMContentLoaded", () => {
-  for (const link of document.head.querySelectorAll("link")) {
-    link.href = link.href.replace(/(resource|chrome)\:\/\//, "/");
-  }
-
-  if (appinfo.OS === "Darwin") {
-    document.documentElement.setAttribute("platform", "mac");
-  } else if (appinfo.OS === "Linux") {
-    document.documentElement.setAttribute("platform", "linux");
-  } else {
-    document.documentElement.setAttribute("platform", "win");
-  }
-});
-
-let consoleFrame;
-function onConnect(connection) {
-  // If we are on the main dashboard don't render the component
-  if (!connection || !connection.tabConnection || !connection.tabConnection.tabTarget) {
-    return;
-  }
-
-  // Replicate the DOM that the root component lives within
-  document.querySelector("#mount").innerHTML = `
-    <div id="app-wrapper" class="theme-body">
-      <div id="output-container" role="document" aria-live="polite" />
-    </div>
-  `;
-
-  // Stub out properties that are received from hudservice
-  const owner = {
-    iframeWindow: window,
-    chromeWindow: window,
-    hudId: "hud_0",
-    getDebuggerFrames: () => { },
-    getInspectorSelection: () => { },
-    target: connection.tabConnection.tabTarget,
-    _browserConsole: false,
-    WebConsoleOutputWrapper,
-  };
-  consoleFrame = new WebConsoleFrame(owner);
-  consoleFrame.init().then(function() {
-    console.log("WebConsoleFrame initialized");
-  });
-}
-
-// This is just a hack until the local dev environment includes jsterm
-window.evaluateJS = function(input) {
-  consoleFrame.webConsoleClient.evaluateJSAsync(`${input}`, function(r) {
-    consoleFrame.consoleOutput.dispatchMessageAdd(r);
-  }, {});
-};
-
-document.documentElement.classList.add("theme-light");
-bootstrap(React, ReactDOM).then(onConnect);
deleted file mode 100644
--- a/devtools/client/webconsole/package.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
-  "name": "webconsole",
-  "version": "0.0.1",
-  "engines": {
-    "node": ">=7.10.0"
-  },
-  "scripts": {
-    "start": "cross-env NODE_ENV=production node bin/dev-server",
-    "dev": " cross-env NODE_ENV=development node bin/dev-server"
-  },
-  "dependencies": {
-    "babel-plugin-transform-flow-strip-types": "^6.22.0",
-    "babel-plugin-transform-react-jsx": "^6.24.1",
-    "babel-plugin-transform-object-rest-spread": "^6.26.0",
-    "cross-env": "^3.1.3",
-    "devtools-config": "0.0.12",
-    "devtools-launchpad": "^0.0.119",
-    "devtools-modules": "0.0.37",
-    "file-loader": "^1.1.6",
-    "netmonitor": "file:../netmonitor",
-    "raw-loader": "^0.5.1",
-    "react": "=16.2.0",
-    "react-dom": "=16.2.0",
-    "react-prop-types": "=0.4.0",
-    "react-redux": "=5.0.6",
-    "redux": "^3.7.2",
-    "require-hacker": "^2.1.4"
-  }
-}
deleted file mode 100644
--- a/devtools/client/webconsole/test/fixtures/DebuggerClient.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-// Objects and functions were cherry-picked from devtools/shared/client/main.js, in
-// order to make the console launchpad Worker.
-
-// mock, we only need DebuggerClient.requester
-const DebuggerClient = function(transport) {};
-
-/**
- * A declarative helper for defining methods that send requests to the server.
- *
- * @param packetSkeleton
- *        The form of the packet to send. Can specify fields to be filled from
- *        the parameters by using the |arg| function.
- * @param before
- *        The function to call before sending the packet. Is passed the packet,
- *        and the return value is used as the new packet. The |this| context is
- *        the instance of the client object we are defining a method for.
- * @param after
- *        The function to call after the response is received. It is passed the
- *        response, and the return value is considered the new response that
- *        will be passed to the callback. The |this| context is the instance of
- *        the client object we are defining a method for.
- * @return Request
- *         The `Request` object that is a Promise object and resolves once
- *         we receive the response. (See request method for more details)
- */
-DebuggerClient.requester = function(packetSkeleton, config = {}) {
-  const { before, after } = config;
-  return function(...args) {
-    let outgoingPacket = {
-      to: packetSkeleton.to || this.actor
-    };
-
-    let maxPosition = -1;
-    for (const k of Object.keys(packetSkeleton)) {
-      if (packetSkeleton[k] instanceof DebuggerClient.Argument) {
-        const { position } = packetSkeleton[k];
-        outgoingPacket[k] = packetSkeleton[k].getArgument(args);
-        maxPosition = Math.max(position, maxPosition);
-      } else {
-        outgoingPacket[k] = packetSkeleton[k];
-      }
-    }
-
-    if (before) {
-      outgoingPacket = before.call(this, outgoingPacket);
-    }
-
-    return this.request(outgoingPacket, (response) => {
-      if (after) {
-        const { from } = response;
-        response = after.call(this, response);
-        if (!response.from) {
-          response.from = from;
-        }
-      }
-
-      // The callback is always the last parameter.
-      const thisCallback = args[maxPosition + 1];
-      if (thisCallback) {
-        thisCallback(response);
-      }
-      return response;
-    }, "DebuggerClient.requester request callback");
-  };
-};
-
-function arg(pos) {
-  return new DebuggerClient.Argument(pos);
-}
-
-DebuggerClient.Argument = function(position) {
-  this.position = position;
-};
-
-DebuggerClient.Argument.prototype.getArgument = function(params) {
-  if (!(this.position in params)) {
-    throw new Error("Bad index into params: " + this.position);
-  }
-  return params[this.position];
-};
-
-module.exports = { arg, DebuggerClient };
--- a/devtools/client/webconsole/webconsole-frame.js
+++ b/devtools/client/webconsole/webconsole-frame.js
@@ -19,20 +19,16 @@ const { l10n } = require("devtools/clien
 loader.lazyRequireGetter(this, "AppConstants", "resource://gre/modules/AppConstants.jsm", true);
 
 const ZoomKeys = require("devtools/client/shared/zoom-keys");
 
 const PREF_MESSAGE_TIMESTAMP = "devtools.webconsole.timestampMessages";
 const PREF_PERSISTLOG = "devtools.webconsole.persistlog";
 const PREF_SIDEBAR_ENABLED = "devtools.webconsole.sidebarToggle";
 
-// XXX: This file is incomplete (see bug 1326937).
-// It's used when loading the webconsole with devtools-launchpad, but will ultimately be
-// the entry point for the new frontend
-
 /**
  * A WebConsoleFrame instance is an interactive console initialized *per target*
  * that displays console log data as well as provides an interactive terminal to
  * manipulate the target's document content.
  *
  * The WebConsoleFrame is responsible for the actual Web Console UI
  * implementation.
  *
@@ -231,20 +227,18 @@ WebConsoleFrame.prototype = {
   _initUI: function() {
     this.document = this.window.document;
     this.rootElement = this.document.documentElement;
 
     this.outputNode = this.document.getElementById("output-container");
 
     const toolbox = gDevTools.getToolbox(this.owner.target);
 
-    // Handle both launchpad and toolbox loading
-    const Wrapper = this.owner.WebConsoleOutputWrapper || this.window.WebConsoleOutput;
-    this.consoleOutput =
-      new Wrapper(this.outputNode, this, toolbox, this.owner, this.document);
+    this.consoleOutput = new this.window.WebConsoleOutput(
+      this.outputNode, this, toolbox, this.owner, this.document);
     // Toggle the timestamp on preference change
     Services.prefs.addObserver(PREF_MESSAGE_TIMESTAMP, this._onToolboxPrefChanged);
     this._onToolboxPrefChanged();
 
     this._initShortcuts();
     this._initOutputSyntaxHighlighting();
 
     if (toolbox) {
deleted file mode 100644
--- a/devtools/client/webconsole/webpack.config.js
+++ /dev/null
@@ -1,160 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* eslint-env node */
-/* eslint max-len: [0] */
-
-"use strict";
-
-const {toolboxConfig} = require("./node_modules/devtools-launchpad/index");
-const { NormalModuleReplacementPlugin } = require("webpack");
-const {getConfig} = require("./bin/configure");
-
-const path = require("path");
-const projectPath = path.join(__dirname, "local-dev");
-
-const webpackConfig = {
-  entry: {
-    console: [path.join(projectPath, "index.js")],
-  },
-
-  module: {
-    rules: [
-      {
-        test: /\.(png|svg)$/,
-        loader: "file-loader?name=[path][name].[ext]",
-      },
-      {
-        test: /\.js$/,
-        loaders: [
-          /*
-          * The version of webpack used in the launchpad seems to have trouble
-          * with the require("raw!${file}") that we use for the properties
-          * file in l10.js.
-          * This loader goes through the whole code and remove the "raw!" prefix
-          * so the raw-loader declared in devtools-launchpad config can load
-          * those files.
-          */
-          "rewrite-raw",
-          // Replace all references to this.browserRequire() by require()
-          "rewrite-browser-require",
-          // Replace all references to loader.lazyRequire() by require()
-          "rewrite-lazy-require",
-          // Replace all references to loader.lazyGetter() by require()
-          "rewrite-lazy-getter",
-        ],
-      }
-    ]
-  },
-
-  resolveLoader: {
-    modules: [
-      path.resolve("./node_modules"),
-      path.resolve("../shared/webpack"),
-    ]
-  },
-
-  output: {
-    path: path.join(__dirname, "assets/build"),
-    filename: "[name].js",
-    publicPath: "/assets/build",
-  },
-
-  externals: [
-    {
-      "promise": "var Promise",
-    }
-  ],
-};
-
-webpackConfig.resolve = {
-  modules: [
-    // Make sure webpack is always looking for modules in
-    // `webconsole/node_modules` directory first.
-    path.resolve(__dirname, "node_modules"), "node_modules"
-  ],
-  alias: {
-    "Services": "devtools-modules/src/Services",
-
-    "devtools/client/webconsole/utils": path.join(__dirname, "test/fixtures/WebConsoleUtils"),
-
-    "devtools/client/shared/vendor/immutable": "immutable",
-    "devtools/client/shared/vendor/react": "react",
-    "devtools/client/shared/vendor/react-dom": "react-dom",
-    "devtools/client/shared/vendor/react-redux": "react-redux",
-    "devtools/client/shared/vendor/redux": "redux",
-    "devtools/client/shared/vendor/reselect": "reselect",
-
-    "resource://gre/modules/AppConstants.jsm": path.join(__dirname, "../../client/shared/webpack/shims/app-constants-stub"),
-
-    "devtools/client/framework/devtools": path.join(__dirname, "../../client/shared/webpack/shims/framework-devtools-shim"),
-    "devtools/client/framework/menu": "devtools-modules/src/menu",
-    "devtools/client/sourceeditor/editor": "devtools-source-editor/src/source-editor",
-
-    "devtools/client/shared/unicode-url": "./node_modules/devtools-modules/src/unicode-url",
-    "devtools/client/shared/zoom-keys": "devtools-modules/src/zoom-keys",
-
-    "devtools/shared/fronts/timeline": path.join(__dirname, "../../client/shared/webpack/shims/fronts-timeline-shim"),
-    "devtools/shared/event-emitter": "devtools-modules/src/utils/event-emitter",
-    "devtools/shared/client/debugger-client": path.join(__dirname, "test/fixtures/DebuggerClient"),
-    "devtools/shared/platform/clipboard": path.join(__dirname, "../../client/shared/webpack/shims/platform-clipboard-stub"),
-    "devtools/shared/platform/stack": path.join(__dirname, "../../client/shared/webpack/shims/platform-stack-stub"),
-
-    // Locales need to be explicitly mapped to the en-US subfolder
-    "toolkit/locales": path.join(__dirname, "../../../toolkit/locales/en-US"),
-    "devtools/client/locales": path.join(__dirname, "../../client/locales/en-US"),
-    "devtools/shared/locales": path.join(__dirname, "../../shared/locales/en-US"),
-    "devtools/startup/locales": path.join(__dirname, "../../shared/locales/en-US"),
-
-    // Unless a path explicitly needs to be rewritten or shimmed, all devtools paths can
-    // be mapped to ../../
-    "devtools": path.join(__dirname, "../../"),
-  }
-};
-
-const mappings = [
-  [
-    /utils\/menu/, "devtools-launchpad/src/components/shared/menu"
-  ],
-  [
-    /chrome:\/\/devtools\/skin/,
-    (result) => {
-      result.request = result.request
-        .replace("./chrome://devtools/skin", path.join(__dirname, "../themes"));
-    }
-  ],
-  [
-    /chrome:\/\/devtools\/content/,
-    (result) => {
-      result.request = result.request
-        .replace("./chrome://devtools/content", path.join(__dirname, ".."));
-    }
-  ],
-  [
-    /resource:\/\/devtools/,
-    (result) => {
-      result.request = result.request
-        .replace("./resource://devtools/client", path.join(__dirname, ".."));
-    }
-  ],
-];
-
-webpackConfig.plugins = mappings.map(([regex, res]) =>
-  new NormalModuleReplacementPlugin(regex, res));
-
-const basePath = path.join(__dirname, "../../").replace(/\\/g, "\\\\");
-
-const config = toolboxConfig(webpackConfig, getConfig(), {
-  // Exclude to transpile all scripts in devtools/ but not for this folder nor netmonitor.
-  babelExcludes: new RegExp(`^${basePath}(.(?!(webconsole|netmonitor)))*$`),
-  disablePostCSS: true,
-});
-
-// Remove loaders from devtools-launchpad's webpack.config.js
-// * For svg-inline loader:
-//   Webconsole uses file loader to bundle image assets instead of svg-inline-loader
-config.module.rules = config.module.rules
-  .filter((rule) => !["svg-inline-loader"].includes(rule.loader));
-
-module.exports = config;