diff --git a/devtools/client/aboutdebugging-new/aboutdebugging.js b/devtools/client/aboutdebugging-new/aboutdebugging.js index 4a7441d789bc..84cf3ab13674 100644 --- a/devtools/client/aboutdebugging-new/aboutdebugging.js +++ b/devtools/client/aboutdebugging-new/aboutdebugging.js @@ -12,17 +12,10 @@ const { require } = BrowserLoader({ }); const Services = require("Services"); -const { bindActionCreators } = require("devtools/client/shared/vendor/redux"); const { createFactory } = require("devtools/client/shared/vendor/react"); const { render, unmountComponentAtNode } = require("devtools/client/shared/vendor/react-dom"); -const Provider = - createFactory(require("devtools/client/shared/vendor/react-redux").Provider); - -const actions = require("./src/actions/index"); -const { configureStore } = require("./src/create-store"); -const ThisFirefox = require("./src/runtimes/this-firefox"); const App = createFactory(require("./src/components/App")); @@ -34,13 +27,7 @@ const AboutDebugging = { return; } - this.store = configureStore(); - this.actions = bindActionCreators(actions, this.store.dispatch); - - const thisFirefox = new ThisFirefox(); - this.updateSelectedRuntime(thisFirefox); - - render(Provider({ store: this.store }, App({ thisFirefox })), this.mount); + render(App(), this.mount); }, destroy() { @@ -50,10 +37,6 @@ const AboutDebugging = { get mount() { return document.getElementById("mount"); }, - - updateSelectedRuntime(runtime) { - this.actions.updateSelectedRuntime(runtime); - }, }; window.addEventListener("DOMContentLoaded", () => { diff --git a/devtools/client/aboutdebugging-new/src/actions/index.js b/devtools/client/aboutdebugging-new/src/actions/index.js deleted file mode 100644 index dc76402b6882..000000000000 --- a/devtools/client/aboutdebugging-new/src/actions/index.js +++ /dev/null @@ -1,9 +0,0 @@ -/* 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 runtimes = require("./runtimes"); - -Object.assign(exports, runtimes); diff --git a/devtools/client/aboutdebugging-new/src/actions/moz.build b/devtools/client/aboutdebugging-new/src/actions/moz.build deleted file mode 100644 index e321f13acb4c..000000000000 --- a/devtools/client/aboutdebugging-new/src/actions/moz.build +++ /dev/null @@ -1,8 +0,0 @@ -# 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/. - -DevToolsModules( - 'index.js', - 'runtimes.js', -) diff --git a/devtools/client/aboutdebugging-new/src/actions/runtimes.js b/devtools/client/aboutdebugging-new/src/actions/runtimes.js deleted file mode 100644 index 2e132a5efb6d..000000000000 --- a/devtools/client/aboutdebugging-new/src/actions/runtimes.js +++ /dev/null @@ -1,20 +0,0 @@ -/* 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 { - UPDATE_SELECTED_RUNTIME, -} = require("../constants"); - -function updateSelectedRuntime(runtime) { - return { - type: UPDATE_SELECTED_RUNTIME, - runtime, - }; -} - -module.exports = { - updateSelectedRuntime, -}; diff --git a/devtools/client/aboutdebugging-new/src/components/App.js b/devtools/client/aboutdebugging-new/src/components/App.js index bc1c2e852c81..dc581cdd77d1 100644 --- a/devtools/client/aboutdebugging-new/src/components/App.js +++ b/devtools/client/aboutdebugging-new/src/components/App.js @@ -4,40 +4,20 @@ "use strict"; -const { connect } = require("devtools/client/shared/vendor/react-redux"); const { createFactory, PureComponent } = require("devtools/client/shared/vendor/react"); const dom = require("devtools/client/shared/vendor/react-dom-factories"); -const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); - -const Runtime = require("../runtimes/runtime"); -const ThisFirefox = require("../runtimes/this-firefox"); const Sidebar = createFactory(require("./Sidebar")); class App extends PureComponent { - static get propTypes() { - return { - selectedRuntime: PropTypes.instanceOf(Runtime), - thisFirefox: PropTypes.instanceOf(ThisFirefox).isRequired, - }; - } - render() { - const { selectedRuntime, thisFirefox } = this.props; - return dom.div( { className: "app", }, - Sidebar({ selectedRuntime, thisFirefox }) + Sidebar() ); } } -const mapStateToProps = state => { - return { - selectedRuntime: state.runtimes.selectedRuntime, - }; -}; - -module.exports = connect(mapStateToProps)(App); +module.exports = App; diff --git a/devtools/client/aboutdebugging-new/src/components/Sidebar.js b/devtools/client/aboutdebugging-new/src/components/Sidebar.js index f5507ec7dbb1..01e05015b6d0 100644 --- a/devtools/client/aboutdebugging-new/src/components/Sidebar.js +++ b/devtools/client/aboutdebugging-new/src/components/Sidebar.js @@ -6,24 +6,13 @@ const { createFactory, PureComponent } = require("devtools/client/shared/vendor/react"); const dom = require("devtools/client/shared/vendor/react-dom-factories"); -const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); -const ThisFirefox = require("../runtimes/this-firefox"); - -const Runtime = require("../runtimes/runtime"); const SidebarItem = createFactory(require("./SidebarItem")); +const FIREFOX_ICON = "chrome://devtools/skin/images/firefox-logo-glyph.svg"; + class Sidebar extends PureComponent { - static get propTypes() { - return { - selectedRuntime: PropTypes.instanceOf(Runtime), - thisFirefox: PropTypes.instanceOf(ThisFirefox).isRequired, - }; - } - render() { - const { selectedRuntime, thisFirefox } = this.props; - return dom.section( { className: "sidebar", @@ -31,9 +20,9 @@ class Sidebar extends PureComponent { dom.ul( {}, SidebarItem({ - icon: thisFirefox.getIcon(), - isSelected: thisFirefox === selectedRuntime, - name: thisFirefox.getName(), + icon: FIREFOX_ICON, + isSelected: true, + name: "This Firefox", }) ) ); diff --git a/devtools/client/aboutdebugging-new/src/constants.js b/devtools/client/aboutdebugging-new/src/constants.js deleted file mode 100644 index 0ea6205b284b..000000000000 --- a/devtools/client/aboutdebugging-new/src/constants.js +++ /dev/null @@ -1,11 +0,0 @@ -/* 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 actionTypes = { - UPDATE_SELECTED_RUNTIME: "UPDATE_SELECTED_RUNTIME", -}; - -module.exports = Object.assign({}, actionTypes); diff --git a/devtools/client/aboutdebugging-new/src/create-store.js b/devtools/client/aboutdebugging-new/src/create-store.js deleted file mode 100644 index 04d08d0d9bbc..000000000000 --- a/devtools/client/aboutdebugging-new/src/create-store.js +++ /dev/null @@ -1,18 +0,0 @@ -/* 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 { createStore } = require("devtools/client/shared/vendor/redux"); - -const rootReducer = require("./reducers/index"); -const { RuntimesState } = require("./reducers/runtimes-state"); - -exports.configureStore = function() { - const initialState = { - runtimes: new RuntimesState(), - }; - - return createStore(rootReducer, initialState); -}; diff --git a/devtools/client/aboutdebugging-new/src/moz.build b/devtools/client/aboutdebugging-new/src/moz.build index 99c09fda4096..cb0fe6e948aa 100644 --- a/devtools/client/aboutdebugging-new/src/moz.build +++ b/devtools/client/aboutdebugging-new/src/moz.build @@ -3,13 +3,5 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. DIRS += [ - 'actions', 'components', - 'runtimes', - 'reducers', ] - -DevToolsModules( - 'constants.js', - 'create-store.js' -) diff --git a/devtools/client/aboutdebugging-new/src/reducers/index.js b/devtools/client/aboutdebugging-new/src/reducers/index.js deleted file mode 100644 index 255d3043afd4..000000000000 --- a/devtools/client/aboutdebugging-new/src/reducers/index.js +++ /dev/null @@ -1,12 +0,0 @@ -/* 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 { combineReducers } = require("devtools/client/shared/vendor/redux"); -const { runtimesReducer } = require("./runtimes-state"); - -module.exports = combineReducers({ - runtimes: runtimesReducer, -}); diff --git a/devtools/client/aboutdebugging-new/src/reducers/moz.build b/devtools/client/aboutdebugging-new/src/reducers/moz.build deleted file mode 100644 index 0bd7dddf9c1d..000000000000 --- a/devtools/client/aboutdebugging-new/src/reducers/moz.build +++ /dev/null @@ -1,8 +0,0 @@ -# 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/. - -DevToolsModules( - 'index.js', - 'runtimes-state.js', -) diff --git a/devtools/client/aboutdebugging-new/src/reducers/runtimes-state.js b/devtools/client/aboutdebugging-new/src/reducers/runtimes-state.js deleted file mode 100644 index 8a8dc0293ac3..000000000000 --- a/devtools/client/aboutdebugging-new/src/reducers/runtimes-state.js +++ /dev/null @@ -1,33 +0,0 @@ -/* 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 { - UPDATE_SELECTED_RUNTIME, -} = require("../constants"); - -function RuntimesState() { - return { - selectedRuntime: null, - }; -} - -function runtimesReducer(state = RuntimesState(), action) { - switch (action.type) { - case UPDATE_SELECTED_RUNTIME: { - return Object.assign({}, state, { - selectedRuntime: action.runtime, - }); - } - - default: - return state; - } -} - -module.exports = { - RuntimesState, - runtimesReducer, -}; diff --git a/devtools/client/aboutdebugging-new/src/runtimes/moz.build b/devtools/client/aboutdebugging-new/src/runtimes/moz.build deleted file mode 100644 index ea9c3c8c7648..000000000000 --- a/devtools/client/aboutdebugging-new/src/runtimes/moz.build +++ /dev/null @@ -1,8 +0,0 @@ -# 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/. - -DevToolsModules( - 'runtime.js', - 'this-firefox.js', -) diff --git a/devtools/client/aboutdebugging-new/src/runtimes/runtime.js b/devtools/client/aboutdebugging-new/src/runtimes/runtime.js deleted file mode 100644 index 7a6f0ca5ce55..000000000000 --- a/devtools/client/aboutdebugging-new/src/runtimes/runtime.js +++ /dev/null @@ -1,30 +0,0 @@ -/* 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"; - -/** - * This class represents a runtime, such as a remote Firefox. - */ -class Runtime { - /** - * Return icon of this runtime on sidebar. - * Subclass should override this method. - * @return {String} - */ - getIcon() { - throw new Error("Subclass of Runtime should override getIcon()"); - } - - /** - * Return name of this runtime on sidebar. - * Subclass should override this method. - * @return {String} - */ - getName() { - throw new Error("Subclass of Runtime should override getName()"); - } -} - -module.exports = Runtime; diff --git a/devtools/client/aboutdebugging-new/src/runtimes/this-firefox.js b/devtools/client/aboutdebugging-new/src/runtimes/this-firefox.js deleted file mode 100644 index 7aca871157a5..000000000000 --- a/devtools/client/aboutdebugging-new/src/runtimes/this-firefox.js +++ /dev/null @@ -1,23 +0,0 @@ -/* 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 Runtime = require("./runtime"); - -/** - * This class represents the Firefox instance which runs in the same environment that - * opened about:debugging. - */ -class ThisFirefox extends Runtime { - getIcon() { - return "chrome://devtools/skin/images/firefox-logo-glyph.svg"; - } - - getName() { - return "This Firefox"; - } -} - -module.exports = ThisFirefox;