Bug 1397330 - Define all specs and fronts relying on implicit require. r=jdescottes draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Wed, 13 Sep 2017 22:48:43 +0200
changeset 664857 8f6efc3554071edbe90bcfd1c6c25821f91dd792
parent 664856 c2ce1a0906ffcaff36a3e93be3f86aa8c8ec4032
child 731562 fd9eb146565bfdc06a7477561ce3868f71138544
push id79824
push userbmo:poirot.alex@gmail.com
push dateThu, 14 Sep 2017 13:26:05 +0000
reviewersjdescottes
bugs1397330
milestone57.0a1
Bug 1397330 - Define all specs and fronts relying on implicit require. r=jdescottes MozReview-Commit-ID: HzcEWauFKjz
devtools/shared/fronts/styles.js
devtools/shared/specs/animation.js
devtools/shared/specs/csscoverage.js
devtools/shared/specs/index.js
devtools/shared/specs/layout.js
devtools/shared/specs/performance.js
devtools/shared/specs/styles.js
--- a/devtools/shared/fronts/styles.js
+++ b/devtools/shared/fronts/styles.js
@@ -1,14 +1,13 @@
 /* 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";
 
-require("devtools/shared/fronts/stylesheets");
 const {
   Front,
   FrontClassWithSpec,
   custom,
   preEvent
 } = require("devtools/shared/protocol");
 const {
   pageStyleSpec,
--- a/devtools/shared/specs/animation.js
+++ b/devtools/shared/specs/animation.js
@@ -4,17 +4,16 @@
 "use strict";
 
 const {
   Arg,
   RetVal,
   generateActorSpec,
   types
 } = require("devtools/shared/protocol");
-require("devtools/shared/specs/inspector");
 
 /**
  * Sent with the 'mutations' event as part of an array of changes, used to
  * inform fronts of the type of change that occured.
  */
 types.addDictType("animationMutationChange", {
   // The type of change ("added" or "removed").
   type: "string",
--- a/devtools/shared/specs/csscoverage.js
+++ b/devtools/shared/specs/csscoverage.js
@@ -1,17 +1,15 @@
 /* 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";
 
 const {Arg, RetVal, generateActorSpec} = require("devtools/shared/protocol");
 
-require("devtools/shared/specs/stylesheets");
-
 const cssUsageSpec = generateActorSpec({
   typeName: "cssUsage",
 
   events: {
     "state-change": {
       type: "stateChange",
       stateChange: Arg(0, "json")
     }
--- a/devtools/shared/specs/index.js
+++ b/devtools/shared/specs/index.js
@@ -29,16 +29,36 @@ const Types = [
     spec: "devtools/shared/specs/layout",
     front: "devtools/shared/fronts/layout",
   },
   {
     types: ["longstring"],
     spec: "devtools/shared/specs/string",
     front: "devtools/shared/fronts/string",
   },
+  {
+    types: ["originalsource", "mediarule", "stylesheet", "stylesheets"],
+    spec: "devtools/shared/specs/stylesheets",
+    front: "devtools/shared/fronts/stylesheets",
+  },
+  {
+    types: ["imageData", "domnode"],
+    spec: "devtools/shared/specs/node",
+    front: "devtools/shared/fronts/inspector",
+  },
+  {
+    types: ["domwalker"],
+    spec: "devtools/shared/specs/inspector",
+    front: "devtools/shared/fronts/inspector",
+  },
+  {
+    types: ["performance-recording"],
+    spec: "devtools/shared/specs/performance-recording",
+    front: "devtools/shared/fronts/performancec-recording",
+  },
 ];
 
 const lazySpecs = new Map();
 const lazyFronts = new Map();
 
 // Convert the human readable `Types` list into efficient maps
 Types.forEach(item => {
   item.types.forEach(type => {
--- a/devtools/shared/specs/layout.js
+++ b/devtools/shared/specs/layout.js
@@ -1,16 +1,15 @@
 /* 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";
 
 const { Arg, generateActorSpec, RetVal } = require("devtools/shared/protocol");
-require("devtools/shared/specs/node");
 
 const gridSpec = generateActorSpec({
   typeName: "grid",
 
   methods: {},
 });
 
 const layoutSpec = generateActorSpec({
--- a/devtools/shared/specs/performance.js
+++ b/devtools/shared/specs/performance.js
@@ -1,15 +1,14 @@
 /* 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";
 
 const { Arg, RetVal, generateActorSpec } = require("devtools/shared/protocol");
-require("devtools/shared/specs/performance-recording");
 
 const performanceSpec = generateActorSpec({
   typeName: "performance",
 
   /**
    * The set of events the PerformanceActor emits over RDP.
    */
   events: {
--- a/devtools/shared/specs/styles.js
+++ b/devtools/shared/specs/styles.js
@@ -5,18 +5,16 @@
 
 const {
   Arg,
   Option,
   RetVal,
   generateActorSpec,
   types
 } = require("devtools/shared/protocol");
-require("devtools/shared/specs/node");
-require("devtools/shared/specs/stylesheets");
 
 // Predeclare the domstylerule actor type
 types.addActorType("domstylerule");
 
 /**
  * DOM Nodes returned by the style actor will be owned by the DOM walker
  * for the connection.
   */