Bug 1461714 - Land debugger's main module sources r=jlast
authorAlexandre Poirot <poirot.alex@gmail.com>
Fri, 05 Oct 2018 08:31:55 +0000
changeset 495516 7d733a368b6d7d14c70055f5b4040323e8e93bad
parent 495515 b0a184126de49c3b61afdd8de02d967f94253644
child 495517 a693ec4fc691c18ae862abe81558ceda740aceed
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',
 )