Bug 1494162 - Part 17: Lazy load the redux middlewares in create-store. r=pbro
☠☠ backed out by 14272a8b7f32 ☠ ☠
authorGabriel Luong <gabriel.luong@gmail.com>
Fri, 28 Sep 2018 13:14:34 -0400
changeset 494509 bbbf97a5802e06abd3e4ca3d285b6dcbc13bc360
parent 494508 c1dac4bffc06affff447997009266209a9e04091
child 494510 973fbb5bbadcafcb1b49fe82b452eff4da5b2838
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)
reviewerspbro
bugs1494162
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 1494162 - Part 17: Lazy load the redux middlewares in create-store. r=pbro
devtools/client/shared/redux/create-store.js
--- a/devtools/client/shared/redux/create-store.js
+++ b/devtools/client/shared/redux/create-store.js
@@ -2,19 +2,20 @@
  * 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 { createStore, applyMiddleware } = require("devtools/client/shared/vendor/redux");
 const { thunk } = require("./middleware/thunk");
 const { waitUntilService } = require("./middleware/wait-service");
 const { task } = require("./middleware/task");
-const { log } = require("./middleware/log");
 const { promise } = require("./middleware/promise");
-const { history } = require("./middleware/history");
+
+loader.lazyRequireGetter(this, "history", "devtools/client/shared/redux/middleware/history", true);
+loader.lazyRequireGetter(this, "log", "devtools/client/shared/redux/middleware/log", true);
 
 /**
  * This creates a dispatcher with all the standard middleware in place
  * that all code requires. It can also be optionally configured in
  * various ways, such as logging and recording.
  *
  * @param {object} opts:
  *        - log: log all dispatched actions to console