diff --git a/app/index.js b/app/index.js index bc07a738668..cb3f9ea24ec 100644 --- a/app/index.js +++ b/app/index.js @@ -371,6 +371,8 @@ app.on('ready', () => { })) } + // DO NOT TO THIS LIST + // using ipcMain.on is deprecated and should be replaced by actions/reducers ipcMain.on(messages.PREFS_RESTART, (e, config, value) => { var message = locale.translation('prefsRestart') if (prefsRestartLastValue[config] !== undefined && prefsRestartLastValue[config] !== value) { @@ -457,6 +459,7 @@ app.on('ready', () => { ipcMain.on(messages.EXPORT_BOOKMARKS, () => { BookmarksExporter.showDialog(AppStore.getState().get('sites')) }) + // DO NOT TO THIS LIST - see above // We need the initial state to read the UPDATE_TO_PREVIEW_RELEASES preference loadAppStatePromise.then((initialState) => { diff --git a/app/renderer/components/main/main.js b/app/renderer/components/main/main.js index d165cd13a5e..350c4accb90 100644 --- a/app/renderer/components/main/main.js +++ b/app/renderer/components/main/main.js @@ -337,6 +337,8 @@ class Main extends ImmutableComponent { this.registerWindowLevelShortcuts() this.registerCustomTitlebarHandlers() + // DO NOT ADD TO THIS LIST + // ipc.on is deprecated and should be replaced by actions/reducers ipc.on(messages.LEAVE_FULL_SCREEN, this.exitFullScreen.bind(this)) ipc.on(messages.DEBUG_REACT_PROFILE, (e, args) => { @@ -454,6 +456,7 @@ class Main extends ImmutableComponent { windowActions.setImportBrowserDataDetail(detail) windowActions.setImportBrowserDataSelected({}) }) + // DO NOT ADD TO THIS LIST - see above this.loadSearchProviders() diff --git a/js/about/aboutActions.js b/js/about/aboutActions.js index 288c3bde92e..746fe3f5b21 100644 --- a/js/about/aboutActions.js +++ b/js/about/aboutActions.js @@ -9,6 +9,11 @@ const appConstants = require('../constants/appConstants') const ExtensionConstants = require('../../app/common/constants/extensionConstants') const ipc = window.chrome.ipcRenderer +// aboutActions should only contain actions that are relevant to about pages, +// it should not contain duplicates of actions from appActions, etc... because +// you can just require and call those directly +// using ipc.send for actions is also deprecated and dispatchAction should +// be used along with an appropriate reducer for handling the action const aboutActions = { /** * Dispatches a window action diff --git a/js/constants/messages.js b/js/constants/messages.js index e8eb61d9984..b5eb7321de5 100644 --- a/js/constants/messages.js +++ b/js/constants/messages.js @@ -5,6 +5,11 @@ const mapValuesByKeys = require('../lib/functional').mapValuesByKeys const _ = null + +// DO NOT ADD TO THIS LIST +// If you are adding an ipc message you should probably be using an action instead +// If you think you have a really good reason for adding something please check +// with @bbondy or @bridiver first to see if there is an alternative const messages = { // URL bar shortcuts SHORTCUT_FOCUS_URL: _, @@ -143,6 +148,7 @@ const messages = { LOAD_URL_REQUESTED: _, // Torrent TORRENT_MESSAGE: _ + // DO NOT ADD TO THIS LIST - see above } module.exports = mapValuesByKeys(messages)