Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
add deprecation comments
Browse files Browse the repository at this point in the history
auditors @bbondy
  • Loading branch information
bridiver committed Jun 7, 2017
1 parent bc5af54 commit 6ec909c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) => {
Expand Down
3 changes: 3 additions & 0 deletions app/renderer/components/main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -454,6 +456,7 @@ class Main extends ImmutableComponent {
windowActions.setImportBrowserDataDetail(detail)
windowActions.setImportBrowserDataSelected({})
})
// DO NOT ADD TO THIS LIST - see above

this.loadSearchProviders()

Expand Down
5 changes: 5 additions & 0 deletions js/about/aboutActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions js/constants/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: _,
Expand Down Expand Up @@ -143,6 +148,7 @@ const messages = {
LOAD_URL_REQUESTED: _,
// Torrent
TORRENT_MESSAGE: _
// DO NOT ADD TO THIS LIST - see above
}

module.exports = mapValuesByKeys(messages)

0 comments on commit 6ec909c

Please sign in to comment.