Update electron to 15.3.0
This commit is contained in:
parent
7de340a104
commit
519ca05911
16 changed files with 525 additions and 2393 deletions
6
.github/workflows/benchmark.yml
vendored
6
.github/workflows/benchmark.yml
vendored
|
@ -25,13 +25,13 @@ jobs:
|
|||
with:
|
||||
repository: 'signalapp/Mock-Signal-Server-Private'
|
||||
path: 'Mock-Server'
|
||||
ref: 'alpha'
|
||||
ref: 'beta'
|
||||
token: ${{ secrets.AUTOMATED_GITHUB_PAT }}
|
||||
|
||||
- name: Setup node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14.16.0'
|
||||
node-version: '16.5.0'
|
||||
- name: Install global dependencies
|
||||
run: npm install -g yarn@1.22.10 typescript@4.4.2 ts-node@10.2.1
|
||||
|
||||
|
@ -52,6 +52,8 @@ jobs:
|
|||
- name: Install Mock-Server node_modules
|
||||
run: yarn install --frozen-lockfile
|
||||
working-directory: Mock-Server
|
||||
env:
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||
|
||||
- name: Build typescript
|
||||
run: yarn grunt
|
||||
|
|
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
|
@ -14,7 +14,7 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14.16.0'
|
||||
node-version: '16.5.0'
|
||||
- run: npm install -g yarn@1.22.10
|
||||
|
||||
- name: Cache Desktop node_modules
|
||||
|
@ -43,7 +43,7 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14.16.0'
|
||||
node-version: '16.5.0'
|
||||
- run: npm install -g yarn@1.22.10
|
||||
|
||||
- name: Cache Desktop node_modules
|
||||
|
@ -75,7 +75,7 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14.16.0'
|
||||
node-version: '16.5.0'
|
||||
- run: sudo apt-get install xvfb
|
||||
- run: npm install -g yarn@1.22.10
|
||||
|
||||
|
@ -112,7 +112,7 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14.16.0'
|
||||
node-version: '16.5.0'
|
||||
- run: npm install -g yarn@1.22.10
|
||||
|
||||
- name: Cache Desktop node_modules
|
||||
|
|
2
.github/workflows/snyk.yml
vendored
2
.github/workflows/snyk.yml
vendored
|
@ -17,7 +17,7 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14.16.0'
|
||||
node-version: '16.5.0'
|
||||
- run: npm install -g yarn@1.22.10
|
||||
- run: npm install -g snyk@1.316.1
|
||||
|
||||
|
|
2
.nvmrc
2
.nvmrc
|
@ -1 +1 @@
|
|||
14.16.0
|
||||
16.5.0
|
||||
|
|
|
@ -453,7 +453,6 @@ async function createWindow() {
|
|||
nodeIntegration: false,
|
||||
nodeIntegrationInWorker: false,
|
||||
contextIsolation: false,
|
||||
enableRemoteModule: true,
|
||||
preload: join(
|
||||
__dirname,
|
||||
enableCI || getEnvironment() === Environment.Production
|
||||
|
@ -1027,7 +1026,6 @@ function showSettingsWindow() {
|
|||
nodeIntegration: false,
|
||||
nodeIntegrationInWorker: false,
|
||||
contextIsolation: true,
|
||||
enableRemoteModule: true,
|
||||
preload: join(__dirname, '../ts/windows/settings/preload.js'),
|
||||
nativeWindowOpen: true,
|
||||
},
|
||||
|
@ -1098,7 +1096,6 @@ async function showStickerCreator() {
|
|||
nodeIntegration: false,
|
||||
nodeIntegrationInWorker: false,
|
||||
contextIsolation: false,
|
||||
enableRemoteModule: true,
|
||||
preload: join(__dirname, '../sticker-creator/preload.js'),
|
||||
nativeWindowOpen: true,
|
||||
spellcheck: await getSpellCheckSetting(),
|
||||
|
@ -1216,7 +1213,6 @@ function showPermissionsPopupWindow(forCalling: boolean, forCamera: boolean) {
|
|||
nodeIntegration: false,
|
||||
nodeIntegrationInWorker: false,
|
||||
contextIsolation: true,
|
||||
enableRemoteModule: true,
|
||||
preload: join(__dirname, '../ts/windows/permissions/preload.js'),
|
||||
nativeWindowOpen: true,
|
||||
},
|
||||
|
|
|
@ -17,8 +17,3 @@ console.log('Set Windows Application User Model ID (AUMID)', {
|
|||
appUserModelId,
|
||||
});
|
||||
app.setAppUserModelId(appUserModelId);
|
||||
|
||||
// We don't navigate, but this is the way of the future
|
||||
// https://github.com/electron/electron/issues/18397
|
||||
// TODO: Make ringrtc-node context-aware and change this to true.
|
||||
app.allowRendererProcessReuse = false;
|
||||
|
|
14
package.json
14
package.json
|
@ -80,7 +80,7 @@
|
|||
"array-move": "2.1.0",
|
||||
"axe-core": "4.1.4",
|
||||
"backbone": "1.4.0",
|
||||
"better-sqlite3": "https://github.com/signalapp/better-sqlite3#9de3488f68d7429133dd859b7308fdcbd64f02f6",
|
||||
"better-sqlite3": "https://github.com/signalapp/better-sqlite3#92ed9e36351577fe007d139fbd7b4f3e797a8454",
|
||||
"bezier-easing": "2.1.0",
|
||||
"blob-util": "2.0.2",
|
||||
"blueimp-load-image": "5.14.0",
|
||||
|
@ -246,7 +246,7 @@
|
|||
"core-js": "2.6.9",
|
||||
"cross-env": "5.2.0",
|
||||
"css-loader": "3.2.0",
|
||||
"electron": "13.5.0",
|
||||
"electron": "15.3.0",
|
||||
"electron-builder": "22.11.7",
|
||||
"electron-mocha": "10.1.0",
|
||||
"electron-notarize": "0.1.1",
|
||||
|
@ -270,15 +270,15 @@
|
|||
"jsdoc": "3.6.2",
|
||||
"mocha": "4.1.0",
|
||||
"mocha-testcheck": "1.0.0-rc.0",
|
||||
"node-gyp": "^6.1.0",
|
||||
"node-sass": "4.14.1",
|
||||
"node-gyp": "7.1.2",
|
||||
"node-sass": "6.0.1",
|
||||
"node-sass-import-once": "1.2.0",
|
||||
"npm-run-all": "4.1.5",
|
||||
"nyc": "11.4.1",
|
||||
"patch-package": "6.4.7",
|
||||
"prettier": "^2.2.1",
|
||||
"react-docgen-typescript": "1.2.6",
|
||||
"sass-loader": "7.2.0",
|
||||
"sass-loader": "12.3.0",
|
||||
"sinon": "11.1.1",
|
||||
"snyk": "1.316.1",
|
||||
"spectron": "5.0.0",
|
||||
|
@ -286,7 +286,7 @@
|
|||
"terser-webpack-plugin": "5.1.1",
|
||||
"ts-loader": "4.1.0",
|
||||
"ts-node": "8.3.0",
|
||||
"typed-scss-modules": "0.0.11",
|
||||
"typed-scss-modules": "4.1.1",
|
||||
"typescript": "4.4.2",
|
||||
"webpack": "5.30.0",
|
||||
"webpack-cli": "4.6.0",
|
||||
|
@ -299,7 +299,7 @@
|
|||
"sharp/color/color-string": "1.5.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": "14.16.0"
|
||||
"node": "16.5.0"
|
||||
},
|
||||
"build": {
|
||||
"appId": "org.whispersystems.signal-desktop",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
diff --git a/node_modules/electron-util/index.d.ts b/node_modules/electron-util/index.d.ts
|
||||
index 8d493d5..3408e21 100644
|
||||
index 8d493d5..fc522af 100644
|
||||
--- a/node_modules/electron-util/index.d.ts
|
||||
+++ b/node_modules/electron-util/index.d.ts
|
||||
@@ -1,7 +1,7 @@
|
||||
|
@ -7,7 +7,7 @@ index 8d493d5..3408e21 100644
|
|||
/// <reference types="electron"/>
|
||||
/// <reference types="node"/>
|
||||
-import {AllElectron, Remote, BrowserWindow, Size, Rectangle, Session, MenuItemConstructorOptions, MenuItem} from 'electron';
|
||||
+import {RemoteMainInterface, BrowserWindow, Size, Rectangle, Session, MenuItemConstructorOptions, MenuItem} from 'electron';
|
||||
+import { BrowserWindow, Size, Rectangle, Session, MenuItemConstructorOptions, MenuItem} from 'electron';
|
||||
import {Options as NewGithubIssueUrlOptions} from 'new-github-issue-url';
|
||||
import {RequireAtLeastOne} from 'type-fest';
|
||||
|
||||
|
@ -16,7 +16,31 @@ index 8d493d5..3408e21 100644
|
|||
```
|
||||
*/
|
||||
-export const api: AllElectron | Remote;
|
||||
+export const api: RemoteMainInterface;
|
||||
+export const api: never;
|
||||
|
||||
/**
|
||||
Check for various things.
|
||||
diff --git a/node_modules/electron-util/source/is.js b/node_modules/electron-util/source/is.js
|
||||
index 9a7622f..9530a9c 100644
|
||||
--- a/node_modules/electron-util/source/is.js
|
||||
+++ b/node_modules/electron-util/source/is.js
|
||||
@@ -1,5 +1,4 @@
|
||||
'use strict';
|
||||
-const isDev = require('electron-is-dev');
|
||||
const isUsingAsar = require('./is-using-asar');
|
||||
|
||||
module.exports = {
|
||||
@@ -9,7 +8,12 @@ module.exports = {
|
||||
main: process.type === 'browser',
|
||||
renderer: process.type === 'renderer',
|
||||
usingAsar: isUsingAsar,
|
||||
- development: isDev,
|
||||
macAppStore: process.mas === true,
|
||||
windowsStore: process.windowsStore === true
|
||||
};
|
||||
+
|
||||
+Object.defineProperty(module.exports, 'isDev', {
|
||||
+ get() {
|
||||
+ throw new Error('Not supported in electron 15');
|
||||
+ }
|
||||
+});
|
||||
|
|
11
preload.js
11
preload.js
|
@ -118,8 +118,12 @@ try {
|
|||
|
||||
// We never do these in our code, so we'll prevent it everywhere
|
||||
window.open = () => null;
|
||||
// eslint-disable-next-line no-eval, no-multi-assign
|
||||
window.eval = global.eval = () => null;
|
||||
|
||||
// Playwright uses `eval` for `.evaluate()` API
|
||||
if (!config.enableCI) {
|
||||
// eslint-disable-next-line no-eval, no-multi-assign
|
||||
window.eval = global.eval = () => null;
|
||||
}
|
||||
|
||||
window.drawAttention = () => {
|
||||
log.info('draw attention');
|
||||
|
@ -436,9 +440,8 @@ try {
|
|||
});
|
||||
|
||||
if (config.enableCI) {
|
||||
const { CI, electronRequire } = require('./ts/CI');
|
||||
const { CI } = require('./ts/CI');
|
||||
window.CI = new CI(title);
|
||||
window.electronRequire = electronRequire;
|
||||
}
|
||||
|
||||
// these need access to window.Signal:
|
||||
|
|
19
ts/CI.ts
19
ts/CI.ts
|
@ -4,12 +4,11 @@
|
|||
import { ipcRenderer } from 'electron';
|
||||
|
||||
import { explodePromise } from './util/explodePromise';
|
||||
import { SECOND } from './util/durations';
|
||||
import * as log from './logging/log';
|
||||
|
||||
type ResolveType = (data: unknown) => void;
|
||||
|
||||
export const electronRequire = require;
|
||||
|
||||
export class CI {
|
||||
private readonly eventListeners = new Map<string, Array<ResolveType>>();
|
||||
|
||||
|
@ -21,7 +20,10 @@ export class CI {
|
|||
});
|
||||
}
|
||||
|
||||
public async waitForEvent(event: string): Promise<unknown> {
|
||||
public async waitForEvent(
|
||||
event: string,
|
||||
timeout = 60 * SECOND
|
||||
): Promise<unknown> {
|
||||
const pendingCompleted = this.completedEvents.get(event) || [];
|
||||
const pending = pendingCompleted.shift();
|
||||
if (pending) {
|
||||
|
@ -35,7 +37,11 @@ export class CI {
|
|||
}
|
||||
|
||||
log.info(`CI: waiting for event ${event}`);
|
||||
const { resolve, promise } = explodePromise();
|
||||
const { resolve, reject, promise } = explodePromise();
|
||||
|
||||
const timer = setTimeout(() => {
|
||||
reject(new Error('Timed out'));
|
||||
}, timeout);
|
||||
|
||||
let list = this.eventListeners.get(event);
|
||||
if (!list) {
|
||||
|
@ -43,7 +49,10 @@ export class CI {
|
|||
this.eventListeners.set(event, list);
|
||||
}
|
||||
|
||||
list.push(resolve);
|
||||
list.push((value: unknown) => {
|
||||
clearTimeout(timer);
|
||||
resolve(value);
|
||||
});
|
||||
|
||||
return promise;
|
||||
}
|
||||
|
|
|
@ -400,8 +400,8 @@ function doRecordsConflict(
|
|||
}
|
||||
|
||||
// If both types are Long we can use Long's equals to compare them
|
||||
if (localValue instanceof Long || typeof localValue === 'number') {
|
||||
if (!(remoteValue instanceof Long) || typeof remoteValue !== 'number') {
|
||||
if (Long.isLong(localValue) || typeof localValue === 'number') {
|
||||
if (!Long.isLong(remoteValue) || typeof remoteValue !== 'number') {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ describe('WebSocket-Resource', () => {
|
|||
assert.strictEqual(message.response?.status, 200);
|
||||
const id = message.response?.id;
|
||||
|
||||
if (id instanceof Long) {
|
||||
if (Long.isLong(id)) {
|
||||
assert(id.equals(requestId));
|
||||
} else {
|
||||
assert(false, `id should be Long, got ${id}`);
|
||||
|
|
|
@ -43,7 +43,7 @@ export function processAttachment(
|
|||
}
|
||||
|
||||
const { cdnId } = attachment;
|
||||
const hasCdnId = cdnId instanceof Long ? !cdnId.isZero() : Boolean(cdnId);
|
||||
const hasCdnId = Long.isLong(cdnId) ? !cdnId.isZero() : Boolean(cdnId);
|
||||
|
||||
return {
|
||||
...shallowDropNull(attachment),
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -110,7 +110,9 @@ const excludedFilesRegexp = RegExp(
|
|||
'^node_modules/@webassemblyjs/.+',
|
||||
'^node_modules/@electron/.+',
|
||||
'^node_modules/ajv/.+',
|
||||
'^node_modules/ajv-keywords/.+',
|
||||
'^node_modules/amdefine/.+',
|
||||
'^node_modules/ansi-styles/.+',
|
||||
'^node_modules/ansi-colors/.+',
|
||||
'^node_modules/anymatch/.+',
|
||||
'^node_modules/app-builder-lib/.+',
|
||||
|
@ -122,6 +124,7 @@ const excludedFilesRegexp = RegExp(
|
|||
'^node_modules/bluebird/.+',
|
||||
'^node_modules/body-parser/.+',
|
||||
'^node_modules/bower/.+',
|
||||
'^node_modules/braces/.+',
|
||||
'^node_modules/buble/.+',
|
||||
'^node_modules/builder-util-runtime/.+',
|
||||
'^node_modules/builder-util/.+',
|
||||
|
@ -138,6 +141,7 @@ const excludedFilesRegexp = RegExp(
|
|||
'^node_modules/css-selector-tokenizer/.+',
|
||||
'^node_modules/css-tree/.+',
|
||||
'^node_modules/csso/.+',
|
||||
'^node_modules/default-gateway/.+',
|
||||
'^node_modules/degenerator/.+',
|
||||
'^node_modules/detect-port-alt/.+',
|
||||
'^node_modules/dmg-builder/.+',
|
||||
|
@ -160,6 +164,7 @@ const excludedFilesRegexp = RegExp(
|
|||
'^node_modules/file-system-cache/.+', // Currently only used in storybook
|
||||
'^node_modules/finalhandler/.+',
|
||||
'^node_modules/fsevents/.+',
|
||||
'^node_modules/global-agent/.+',
|
||||
'^node_modules/globule/.+',
|
||||
'^node_modules/grunt-cli/.+',
|
||||
'^node_modules/grunt-contrib-concat/.+',
|
||||
|
@ -183,13 +188,17 @@ const excludedFilesRegexp = RegExp(
|
|||
'^node_modules/jsdoc/.+',
|
||||
'^node_modules/jss-global/.+',
|
||||
'^node_modules/jss/.+',
|
||||
'^node_modules/liftup/.+',
|
||||
'^node_modules/livereload-js/.+',
|
||||
'^node_modules/lolex/.+',
|
||||
'^node_modules/log-symbols/.+',
|
||||
'^node_modules/magic-string/.+',
|
||||
'^node_modules/markdown-it/.+',
|
||||
'^node_modules/meow/.+',
|
||||
'^node_modules/minimatch/.+',
|
||||
'^node_modules/mocha/.+',
|
||||
'^node_modules/nise/.+',
|
||||
'^node_modules/node-gyp/.+',
|
||||
'^node_modules/node-sass-import-once/.+',
|
||||
'^node_modules/node-sass/.+',
|
||||
'^node_modules/npm-run-all/.+',
|
||||
|
@ -214,6 +223,7 @@ const excludedFilesRegexp = RegExp(
|
|||
'^node_modules/resolve/.+',
|
||||
'^node_modules/sass-graph/.+',
|
||||
'^node_modules/sass-loader/.+',
|
||||
'^node_modules/schema-utils/.+',
|
||||
'^node_modules/scss-tokenizer/.+',
|
||||
'^node_modules/send/.+',
|
||||
'^node_modules/serve-index/.+',
|
||||
|
@ -251,6 +261,7 @@ const excludedFilesRegexp = RegExp(
|
|||
'^node_modules/yargs/.+',
|
||||
'^node_modules/find-yarn-workspace-root/.+',
|
||||
'^node_modules/update-notifier/.+',
|
||||
'^node_modules/windows-release/.+',
|
||||
|
||||
// Used by Storybook
|
||||
'^node_modules/@emotion/.+',
|
||||
|
|
Loading…
Reference in a new issue