Bug 1494162 - Part 46: Lazy load openDocLink and assert in MeatballMenu. r=jdescottes
authorGabriel Luong <gabriel.luong@gmail.com>
Wed, 03 Oct 2018 09:38:00 -0400
changeset 487707 2a30a201d8cd303cece8e48e95bc586f757c1cdf
parent 487706 3e91b286a63ebd01c89287ede31554702e582e83
child 487708 217d78349cb5b404b8999bc28291da3c086d61df
child 487724 3530790e23d18b6f8f73471e367a942f201dd452
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewersjdescottes
bugs1494162
milestone64.0a1
Bug 1494162 - Part 46: Lazy load openDocLink and assert in MeatballMenu. r=jdescottes
devtools/client/framework/components/MeatballMenu.js
--- a/devtools/client/framework/components/MeatballMenu.js
+++ b/devtools/client/framework/components/MeatballMenu.js
@@ -1,26 +1,26 @@
 /* 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 { PureComponent } = require("devtools/client/shared/vendor/react");
+const { PureComponent, createFactory } = require("devtools/client/shared/vendor/react");
 const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
-const { createFactory } = require("devtools/client/shared/vendor/react");
 const MenuItem = createFactory(
   require("devtools/client/shared/components/menu/MenuItem")
 );
 const MenuList = createFactory(
   require("devtools/client/shared/components/menu/MenuList")
 );
 const dom = require("devtools/client/shared/vendor/react-dom-factories");
 const { hr } = dom;
-const { openDocLink } = require("devtools/client/shared/link");
-const { assert } = require("devtools/shared/DevToolsUtils");
+
+loader.lazyRequireGetter(this, "openDocLink", "devtools/client/shared/link", true);
+loader.lazyRequireGetter(this, "assert", "devtools/shared/DevToolsUtils", true);
 
 const openDevToolsDocsLink = () => {
   openDocLink(
     "https://developer.mozilla.org/docs/Tools?utm_source=devtools&utm_medium=tabbar-menu"
   );
 };
 
 const openCommunityLink = () => {