Bug 1494162 - Part 17: Lazy load the redux middlewares in create-store. r=pbro
authorGabriel Luong <gabriel.luong@gmail.com>
Fri, 28 Sep 2018 13:14:34 -0400
changeset 494562 63e5313bfc6d65759185af640c128183f08ae170
parent 494561 81c88e41f78b0c8956a5aabd4b5b72b3789ff313
child 494563 5fd32a2fbc66ce325be5c3adab70368f20cfce53
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