Bug 1494162 - Part 45: Lazy load Menu and MenuItem in TabBar. r=pbro
authorGabriel Luong <gabriel.luong@gmail.com>
Thu, 04 Oct 2018 09:19:30 -0400
changeset 487919 01ac27238f7f68ed5766148c8bed012ad3f55e65
parent 487918 37f53e939f61efa9b11d4b4f8f3f1d36b065d79a
child 487920 dd9ecb747f9db84eeddeee817f889933c9ff64cd
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewerspbro
bugs1494162
milestone64.0a1
Bug 1494162 - Part 45: Lazy load Menu and MenuItem in TabBar. r=pbro
devtools/client/shared/components/tabs/TabBar.js
--- a/devtools/client/shared/components/tabs/TabBar.js
+++ b/devtools/client/shared/components/tabs/TabBar.js
@@ -7,20 +7,20 @@
 /* eslint-env browser */
 
 "use strict";
 
 const { Component, createFactory } = require("devtools/client/shared/vendor/react");
 const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
 const dom = require("devtools/client/shared/vendor/react-dom-factories");
 
-const Menu = require("devtools/client/framework/menu");
-const MenuItem = require("devtools/client/framework/menu-item");
+const Sidebar = createFactory(require("devtools/client/shared/components/Sidebar"));
 
-const Sidebar = createFactory(require("devtools/client/shared/components/Sidebar"));
+loader.lazyRequireGetter(this, "Menu", "devtools/client/framework/menu");
+loader.lazyRequireGetter(this, "MenuItem", "devtools/client/framework/menu-item");
 
 // Shortcuts
 const { div } = dom;
 
 /**
  * Renders Tabbar component.
  */
 class Tabbar extends Component {