Bug 1492893 - [Devtools Performance-new] Remove the unused toolbox object from the redux store r=gregtatum

MozReview-Commit-ID: 1LJ6HypOYbM

Differential Revision: https://phabricator.services.mozilla.com/D6469

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Julien Wajsberg 2018-09-21 15:57:05 +00:00
Родитель 9136559bb3
Коммит 8dccd09804
6 изменённых файлов: 5 добавлений и 21 удалений

Просмотреть файл

@ -6,9 +6,6 @@
const { PureComponent } = require("devtools/client/shared/vendor/react");
const { div, button, p } = require("devtools/client/shared/vendor/react-dom-factories");
const { openDocLink } = require("devtools/client/shared/link");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const { connect } = require("devtools/client/shared/vendor/react-redux");
const selectors = require("devtools/client/performance-new/store/selectors");
/**
* This component provides a helpful description for what is going on in the component
@ -16,10 +13,7 @@ const selectors = require("devtools/client/performance-new/store/selectors");
*/
class Description extends PureComponent {
static get propTypes() {
return {
// StateProps:
toolbox: PropTypes.object.isRequired
};
return {};
}
constructor(props) {
@ -71,8 +65,4 @@ class Description extends PureComponent {
}
}
const mapStateToProps = state => ({
toolbox: selectors.getToolbox(state)
});
module.exports = connect(mapStateToProps)(Description);
module.exports = Description;

Просмотреть файл

@ -28,16 +28,15 @@ const {
/**
* Initialize the panel by creating a redux store, and render the root component.
*
* @param toolbox - The toolbox
* @param perfFront - The Perf actor's front. Used to start and stop recordings.
* @param preferenceFront - Used to get the recording preferences from the device.
*/
async function gInit(toolbox, perfFront, preferenceFront) {
async function gInit(perfFront, preferenceFront) {
const store = createStore(reducers);
// Do some initialization, especially with privileged things that are part of the
// the browser.
store.dispatch(actions.initializeStore({
toolbox,
perfFront,
receiveProfile,
// Pull the default recording settings from the reducer, and update them according

Просмотреть файл

@ -35,7 +35,7 @@ class PerformancePanel {
this.isReady = true;
this.emit("ready");
this.panelWin.gInit(this.toolbox, perfFront, preferenceFront);
this.panelWin.gInit(perfFront, preferenceFront);
return this;
}

Просмотреть файл

@ -129,7 +129,6 @@ function initializedValues(state = null, action) {
switch (action.type) {
case "INITIALIZE_STORE":
return {
toolbox: action.toolbox,
perfFront: action.perfFront,
receiveProfile: action.receiveProfile,
setRecordingPreferences: action.setRecordingPreferences

Просмотреть файл

@ -30,7 +30,6 @@ const getInitializedValues = state => {
};
const getPerfFront = state => getInitializedValues(state).perfFront;
const getToolbox = state => getInitializedValues(state).toolbox;
const getReceiveProfileFn = state => getInitializedValues(state).receiveProfile;
const getSetRecordingPreferencesFn =
state => getInitializedValues(state).setRecordingPreferences;
@ -47,7 +46,6 @@ module.exports = {
getRecordingSettings,
getInitializedValues,
getPerfFront,
getToolbox,
getReceiveProfileFn,
getSetRecordingPreferencesFn
};

Просмотреть файл

@ -169,7 +169,6 @@ function createPerfComponent() {
const selectors = require("devtools/client/performance-new/store/selectors");
const perfFrontMock = new MockPerfFront();
const toolboxMock = {};
const store = createStore(reducers);
const container = document.querySelector("#container");
const receiveProfileCalls = [];
@ -185,7 +184,6 @@ function createPerfComponent() {
function mountComponent() {
store.dispatch(actions.initializeStore({
toolbox: toolboxMock,
perfFront: perfFrontMock,
receiveProfile: receiveProfileMock,
recordingSettingsFromPreferences: selectors.getRecordingSettings(store.getState()),