Skip to content

Commit

Permalink
feat(core): upgrade to electron 16
Browse files Browse the repository at this point in the history
  • Loading branch information
DEgITx committed Jan 1, 2022
1 parent 60f1ddf commit edfc925
Show file tree
Hide file tree
Showing 8 changed files with 7,103 additions and 6,817 deletions.
13,841 changes: 7,060 additions & 6,781 deletions package-lock.json

Large diffs are not rendered by default.

65 changes: 33 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,34 +105,35 @@
"buildweb": "node src/background/webpack.js"
},
"dependencies": {
"@electron/remote": "^2.0.1",
"ansi-256-colors": "^1.1.0",
"bencode": "^2.0.1",
"bencode": "^2.0.2",
"bitfield": "^3.0.0",
"cheerio": "^1.0.0-rc.10",
"compare-versions": "^3.6.0",
"compare-versions": "^4.1.2",
"create-torrent": "3.33.0",
"debug": "^4.3.1",
"debug": "^4.3.3",
"detect-onebyte-encoding": "^1.0.3",
"electron-context-menu": "^3.1.1",
"electron-log": "^4.3.5",
"electron-updater": "^4.3.9",
"fs-jetpack": "^4.1.0",
"glob": "^7.1.7",
"electron-log": "^4.4.4",
"electron-updater": "^4.6.1",
"fs-jetpack": "^4.3.0",
"glob": "^7.2.0",
"google": "^2.1.0",
"iconv-lite": "^0.6.3",
"ipaddr.js": "^2.0.0",
"ipaddr.js": "^2.0.1",
"is-running": "^2.1.0",
"json-socket": "github:DEgITx/node-json-socket",
"lodash": "^4.17.21",
"material-ui": "^0.20.2",
"mime": "^2.5.2",
"mime": "^3.0.0",
"mkdirp": "^1.0.4",
"moment": "^2.29.1",
"mysql": "^2.18.1",
"nat-upnp": "^1.1.1",
"node-fetch": "^2.6.1",
"object-hash": "^2.2.0",
"parse-torrent": "^9.1.3",
"parse-torrent": "^9.1.4",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-input-range": "^1.3.0",
Expand All @@ -144,35 +145,35 @@
"webtorrent": "github:DEgITx/webtorrent"
},
"devDependencies": {
"@babel/core": "^7.14.3",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/preset-env": "^7.14.4",
"@babel/preset-react": "^7.13.13",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/exec": "^5.0.0",
"@semantic-release/git": "^9.0.0",
"@semantic-release/npm": "^7.1.3",
"@babel/core": "^7.16.7",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/preset-env": "^7.16.7",
"@babel/preset-react": "^7.16.7",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/npm": "^8.0.3",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.2",
"babel-loader": "^8.2.3",
"chai": "^4.3.4",
"copy-webpack-plugin": "^9.0.0",
"css-loader": "^5.2.6",
"electron": "13.1.6",
"electron-builder": "22.11.7",
"eslint": "^7.28.0",
"eslint-plugin-react": "^7.24.0",
"express": "^4.17.1",
"html-webpack-plugin": "^5.3.1",
"copy-webpack-plugin": "^10.2.0",
"css-loader": "^6.5.1",
"electron": "16.0.5",
"electron-builder": "22.14.5",
"eslint": "^8.6.0",
"eslint-plugin-react": "^7.28.0",
"express": "^4.17.2",
"html-webpack-plugin": "^5.5.0",
"md5-file": "^5.0.0",
"mocha": "^8.2.1",
"mocha": "^9.1.3",
"socket.io": "^2.4.0",
"source-map-support": "^0.5.19",
"source-map-support": "^0.5.21",
"spectron": "15.0.0",
"style-loader": "^2.0.0",
"style-loader": "^3.3.1",
"sw-precache-webpack-plugin": "^1.0.0",
"url-loader": "^4.1.1",
"webpack": "^5.38.1",
"webpack-cli": "^4.7.2",
"webpack": "^5.65.0",
"webpack-cli": "^4.9.1",
"webpack-merge": "^5.8.0",
"webpack-node-externals": "^3.0.0"
}
Expand Down
3 changes: 2 additions & 1 deletion src/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ if(typeof WEB !== 'undefined')
}
else
{
const { ipcRenderer, remote } = require('electron');
const { ipcRenderer } = require('electron');
const remote = require('@electron/remote')
window.currentWindow = remote.getCurrentWindow()

window.torrentSocket = {}
Expand Down
2 changes: 1 addition & 1 deletion src/app/config-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import SvgIcon from 'material-ui/SvgIcon';
import fs from 'fs'
let dialog
if(typeof WEB === 'undefined')
dialog = require('electron').remote.dialog
dialog = require('@electron/remote').dialog

export default class ConfigPage extends Page {
constructor(props) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/download-torrent-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ContextMenu from './context-menu'

let dialog
if(typeof WEB === 'undefined')
dialog = require('electron').remote.dialog
dialog = require('@electron/remote').dialog

export default (props) => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/app/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if(typeof WEB === 'undefined')
import fs from 'fs'
let dialog
if(typeof WEB === 'undefined')
dialog = require('electron').remote.dialog
dialog = require('@electron/remote').dialog
class Header extends React.Component {
constructor(props)
{
Expand Down
4 changes: 4 additions & 0 deletions src/background/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ autoUpdater.on('update-downloaded', () => {

let tray = undefined

require('@electron/remote/main').initialize();

app.on("ready", async () => {
let rootPath;
({ sphinx, rootPath } = await startSphinx(() => {
Expand Down Expand Up @@ -224,6 +226,8 @@ app.on("ready", async () => {
tray.setContextMenu(contextMenu)
tray.setToolTip('Rats on The Boat search')

require("@electron/remote/main").enable(mainWindow.webContents);

mainWindow.webContents.on('will-navigate', (e, url) => {
e.preventDefault()
shell.openExternal(url)
Expand Down
1 change: 1 addition & 0 deletions src/background/menu/about_menu_template.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const aboutMenuTemplateFunc = () => ({
protocol: "file:",
slashes: true
}))
require("@electron/remote/main").enable(win.webContents);
win.webContents.on('did-finish-load', () => {
logT('changelog', "finish load page, open changlog")
setTimeout(() => win.send('url', '/changelog'), 0)
Expand Down

0 comments on commit edfc925

Please sign in to comment.