Bug 1461714 - Land debugger's main module sources r=jlast
☠☠ backed out by c23c2bd92302 ☠ ☠
authorAlexandre Poirot <poirot.alex@gmail.com>
Wed, 03 Oct 2018 20:17:52 +0000
changeset 495259 b37a0f29a956f16fd757ad0884b9f907f3d15f3c
parent 495258 c4c98ffc7f4f34ca6823ee35fb9f7d869d34ce28
child 495260 bf098432003adaa3862f8271de486ee3bdbd8362
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1461714
milestone64.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 1461714 - Land debugger's main module sources r=jlast MozReview-Commit-ID: DXYRD1hWarA Depends on D1741 Differential Revision: https://phabricator.services.mozilla.com/D7622
devtools/client/debugger/new/src/main.js
devtools/client/debugger/new/src/moz.build
--- a/devtools/client/debugger/new/src/main.js
+++ b/devtools/client/debugger/new/src/main.js
@@ -1,82 +1,64 @@
-"use strict";
-
-var _react = require("devtools/client/shared/vendor/react");
-
-var _react2 = _interopRequireDefault(_react);
-
-var _reactDom = require("devtools/client/shared/vendor/react-dom");
-
-var _reactDom2 = _interopRequireDefault(_reactDom);
-
-var _devtoolsEnvironment = require("devtools/client/debugger/new/dist/vendors").vendored["devtools-environment"];
-
-var _client = require("./client/index");
-
-var _bootstrap = require("./utils/bootstrap");
-
-var _sourceQueue = require("./utils/source-queue");
-
-var _sourceQueue2 = _interopRequireDefault(_sourceQueue);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
 /* 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/>. */
+
+// @flow
+
+import React from "react";
+import ReactDOM from "react-dom";
+
+import { isFirefoxPanel } from "devtools-environment";
+
+import { onConnect } from "./client";
+import { teardownWorkers } from "./utils/bootstrap";
+import sourceQueue from "./utils/source-queue";
+
 function unmountRoot() {
   const mount = document.querySelector("#mount .launchpad-root");
-
-  _reactDom2.default.unmountComponentAtNode(mount);
+  ReactDOM.unmountComponentAtNode(mount);
 }
 
-if ((0, _devtoolsEnvironment.isFirefoxPanel)()) {
+if (isFirefoxPanel()) {
   module.exports = {
     bootstrap: ({
       threadClient,
       tabTarget,
       debuggerClient,
       sourceMaps,
       toolboxActions
-    }) => {
-      return (0, _client.onConnect)({
-        tab: {
-          clientType: "firefox"
+    }: any) => {
+      return onConnect(
+        {
+          tab: { clientType: "firefox" },
+          tabConnection: {
+            tabTarget,
+            threadClient,
+            debuggerClient
+          }
         },
-        tabConnection: {
-          tabTarget,
-          threadClient,
-          debuggerClient
+        {
+          services: { sourceMaps },
+          toolboxActions
         }
-      }, {
-        services: {
-          sourceMaps
-        },
-        toolboxActions
-      });
+      );
     },
     destroy: () => {
       unmountRoot();
-
-      _sourceQueue2.default.clear();
-
-      (0, _bootstrap.teardownWorkers)();
+      sourceQueue.clear();
+      teardownWorkers();
     }
   };
 } else {
-  const {
-    bootstrap,
-    L10N
-  } = require("devtools/shared/flags");
-
-  window.L10N = L10N; // $FlowIgnore:
+  const { bootstrap, L10N } = require("devtools-launchpad");
 
-  window.L10N.setBundle(require("devtools/shared/flags"));
-  bootstrap(_react2.default, _reactDom2.default).then(connection => {
-    (0, _client.onConnect)(connection, {
-      services: {
-        sourceMaps: require("devtools/client/shared/source-map/index.js")
-      },
+  window.L10N = L10N;
+  // $FlowIgnore:
+  window.L10N.setBundle(require("../assets/panel/debugger.properties"));
+
+  bootstrap(React, ReactDOM).then(connection => {
+    onConnect(connection, {
+      services: { sourceMaps: require("devtools-source-map") },
       toolboxActions: {}
     });
   });
-}
\ No newline at end of file
+}
--- a/devtools/client/debugger/new/src/moz.build
+++ b/devtools/client/debugger/new/src/moz.build
@@ -8,11 +8,11 @@ DIRS += [
     'client',
     'components',
     'reducers',
     'selectors',
     'utils',
     'workers',
 ]
 
-DevToolsModules(
+DebuggerModules(
     'main.js',
 )