Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update to electron 9-x-y #102011

Merged
merged 28 commits into from Jul 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f12a333
chore: bump electron@9.0.5
deepak1556 Jun 24, 2020
2bda050
remove exploration config
deepak1556 Jul 9, 2020
9f20666
fix compile error
bpasero Jul 1, 2020
8f5344f
fix compile error
bpasero Jun 29, 2020
2f8be47
crashReporter has to be called only once before app ready
deepak1556 Jun 24, 2020
79689ec
chore: bump electron@9.1.0
deepak1556 Jul 9, 2020
e69f860
enable LayoutNG
deepak1556 Jul 9, 2020
8ed32e5
fix cron schedule
deepak1556 Jul 10, 2020
5d0cc4a
allow disabling appcenter crash reporting
deepak1556 Jul 10, 2020
ac54b9f
set additional crash reporting parameters
deepak1556 Jul 10, 2020
b04b02a
start crashreporter for child process on linux
deepak1556 Jul 10, 2020
be16fbc
setup crash parameters only once
deepak1556 Jul 11, 2020
b4abe45
remove unused crashReporter.guid
deepak1556 Jul 11, 2020
1731499
address review feedback
deepak1556 Jul 12, 2020
5fe0c62
reuse argv.json for storing crash reporter id
deepak1556 Jul 12, 2020
5318e66
remove trailing commas
deepak1556 Jul 12, 2020
0bbc904
update localized name
deepak1556 Jul 12, 2020
b35b4a4
update argv based on telemetry optout
deepak1556 Jul 13, 2020
f7dc3e8
update initial config based on setting
deepak1556 Jul 13, 2020
a4a9c80
fix conditional errors
deepak1556 Jul 13, 2020
e9e9c6d
remove telemetry.enableCrashReporter
deepak1556 Jul 13, 2020
a12d098
move default crash reporter config to electron-main
deepak1556 Jul 13, 2020
c6350ac
update comment for ext host crash reporting
deepak1556 Jul 13, 2020
089291a
set default value for configuration
deepak1556 Jul 14, 2020
76c1c15
some :lipstick: changes
bpasero Jul 14, 2020
2978594
address review feedback
deepak1556 Jul 14, 2020
7bce18e
do not use ES7 features in JS yet
bpasero Jul 16, 2020
70b38e5
add app.focus({ steal: true }) usage
bpasero Jul 21, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .yarnrc
@@ -1,3 +1,3 @@
disturl "https://atom.io/download/electron"
target "8.4.0"
target "9.1.0"
runtime "electron"
2 changes: 1 addition & 1 deletion build/azure-pipelines/darwin/continuous-build-darwin.yml
@@ -1,7 +1,7 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "12.13.0"
versionSpec: "12.14.1"

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/darwin/product-build-darwin.yml
Expand Up @@ -21,7 +21,7 @@ steps:

- task: NodeTool@0
inputs:
versionSpec: "12.13.0"
versionSpec: "12.14.1"

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/distro-build.yml
Expand Up @@ -8,7 +8,7 @@ pr:
steps:
- task: NodeTool@0
inputs:
versionSpec: "12.13.0"
versionSpec: "12.14.1"

- task: AzureKeyVault@1
displayName: 'Azure Key Vault: Get Secrets'
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/exploration-build.yml
Expand Up @@ -11,7 +11,7 @@ pr:
steps:
- task: NodeTool@0
inputs:
versionSpec: "12.13.0"
versionSpec: "12.14.1"

- task: AzureKeyVault@1
displayName: 'Azure Key Vault: Get Secrets'
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/linux/continuous-build-linux.yml
Expand Up @@ -10,7 +10,7 @@ steps:

- task: NodeTool@0
inputs:
versionSpec: "12.13.0"
versionSpec: "12.14.1"

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
Expand Down
Expand Up @@ -21,7 +21,7 @@ steps:

- task: NodeTool@0
inputs:
versionSpec: "12.13.0"
versionSpec: "12.14.1"

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/linux/product-build-linux.yml
Expand Up @@ -21,7 +21,7 @@ steps:

- task: NodeTool@0
inputs:
versionSpec: "12.13.0"
versionSpec: "12.14.1"

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/linux/snap-build-linux.yml
@@ -1,7 +1,7 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "12.13.0"
versionSpec: "12.14.1"

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/product-compile.yml
Expand Up @@ -16,7 +16,7 @@ steps:

- task: NodeTool@0
inputs:
versionSpec: "12.13.0"
versionSpec: "12.14.1"
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'))

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/publish-types/publish-types.yml
Expand Up @@ -9,7 +9,7 @@ pr: none
steps:
- task: NodeTool@0
inputs:
versionSpec: "12.13.0"
versionSpec: "12.14.1"

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/sync-mooncake.yml
@@ -1,7 +1,7 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "12.13.0"
versionSpec: "12.14.1"

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/web/product-build-web.yml
Expand Up @@ -21,7 +21,7 @@ steps:

- task: NodeTool@0
inputs:
versionSpec: "12.13.0"
versionSpec: "12.14.1"

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/win32/continuous-build-win32.yml
@@ -1,7 +1,7 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "12.13.0"
versionSpec: "12.14.1"

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/win32/product-build-win32-arm64.yml
Expand Up @@ -21,7 +21,7 @@ steps:

- task: NodeTool@0
inputs:
versionSpec: "12.13.0"
versionSpec: "12.14.1"

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/win32/product-build-win32.yml
Expand Up @@ -21,7 +21,7 @@ steps:

- task: NodeTool@0
inputs:
versionSpec: "12.13.0"
versionSpec: "12.14.1"

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
Expand Down
4 changes: 0 additions & 4 deletions build/lib/i18n.resources.json
Expand Up @@ -246,10 +246,6 @@
"name": "vs/workbench/services/configurationResolver",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/services/crashReporter",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/services/dialogs",
"project": "vscode-workbench"
Expand Down
12 changes: 6 additions & 6 deletions cgmanifest.json
Expand Up @@ -6,7 +6,7 @@
"git": {
"name": "chromium",
"repositoryUrl": "https://chromium.googlesource.com/chromium/src",
"commitHash": "052d3b44972e6d94ef40054d46c150b7cdd7a5d8"
"commitHash": "894fb9eb56c6cbda65e3c3ae9ada6d4cb5850cc9"
}
},
"licenseDetail": [
Expand Down Expand Up @@ -40,32 +40,32 @@
"SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
],
"isOnlyProductionDependency": true,
"version": "80.0.3987.165"
"version": "83.0.4103.122"
},
{
"component": {
"type": "git",
"git": {
"name": "nodejs",
"repositoryUrl": "https://github.com/nodejs/node",
"commitHash": "42cce5a9d0fd905bf4ad7a2528c36572dfb8b5ad"
"commitHash": "9622fed3fb2cffcea9efff6c8cb4cc2def99d75d"
}
},
"isOnlyProductionDependency": true,
"version": "12.13.0"
"version": "12.14.1"
},
{
"component": {
"type": "git",
"git": {
"name": "electron",
"repositoryUrl": "https://github.com/electron/electron",
"commitHash": "94a5b304d0ce738ad036c8e359241b4acba330b2"
"commitHash": "a822d2639a9c9c2c670e91d73f78e921865ce38e"
}
},
"isOnlyProductionDependency": true,
"license": "MIT",
"version": "8.4.0"
"version": "9.1.0"
},
{
"component": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -108,7 +108,7 @@
"css-loader": "^3.2.0",
"debounce": "^1.0.0",
"deemon": "^1.4.0",
"electron": "8.4.0",
"electron": "9.1.0",
"eslint": "6.8.0",
"eslint-plugin-jsdoc": "^19.1.0",
"event-stream": "3.3.4",
Expand Down
2 changes: 1 addition & 1 deletion remote/.yarnrc
@@ -1,3 +1,3 @@
disturl "http://nodejs.org/dist"
target "12.4.0"
target "12.14.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexdima fyi not sure why remote locked the dependency to 12.4.0 but it would now advance to the same as Electron 9

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Maybe there was no node release with the same version number as the one used in Electron?

runtime "node"
68 changes: 42 additions & 26 deletions src/main.js
Expand Up @@ -18,7 +18,11 @@ const bootstrap = require('./bootstrap');
const paths = require('./paths');
/** @type {any} */
const product = require('../product.json');
const { app, protocol } = require('electron');
const { app, protocol, crashReporter } = require('electron');

// Disable render process reuse, we still have
// non-context aware native modules in the renderer.
app.allowRendererProcessReuse = false;

// Enable portable support
const portable = bootstrap.configurePortable(product);
Expand All @@ -31,13 +35,13 @@ const args = parseCLIArgs();
const userDataPath = getUserDataPath(args);
app.setPath('userData', userDataPath);

// Set temp directory based on crash-reporter-directory CLI argument
// The crash reporter will store crashes in temp folder so we need
// to change that location accordingly.
// Configure static command line arguments
const argvConfig = configureCommandlineSwitchesSync(args);

// If a crash-reporter-directory is specified we setup the crash reporter
// right from the beginning as early as possible to monitor all processes.
// If a crash-reporter-directory is specified we store the crash reports
// in the specified directory and don't upload them to the crash server.
let crashReporterDirectory = args['crash-reporter-directory'];
let submitURL = '';
if (crashReporterDirectory) {
deepak1556 marked this conversation as resolved.
Show resolved Hide resolved
crashReporterDirectory = path.normalize(crashReporterDirectory);

Expand All @@ -55,23 +59,41 @@ if (crashReporterDirectory) {
}
}

// Crashes are stored in the temp directory by default, so we
// Crashes are stored in the crashDumps directory by default, so we
// need to change that directory to the provided one
console.log(`Found --crash-reporter-directory argument. Setting temp directory to be '${crashReporterDirectory}'`);
app.setPath('temp', crashReporterDirectory);

// Start crash reporter
const { crashReporter } = require('electron');
const productName = (product.crashReporter && product.crashReporter.productName) || product.nameShort;
const companyName = (product.crashReporter && product.crashReporter.companyName) || 'Microsoft';
crashReporter.start({
companyName: companyName,
productName: process.env['VSCODE_DEV'] ? `${productName} Dev` : productName,
submitURL: '',
uploadToServer: false
});
console.log(`Found --crash-reporter-directory argument. Setting crashDumps directory to be '${crashReporterDirectory}'`);
app.setPath('crashDumps', crashReporterDirectory);
} else {
const appCenter = product.appCenter;
// Disable Appcenter crash reporting if
// * --crash-reporter-directory is specified
// * enable-crash-reporter runtime argument is set to 'false'
// * --disable-crash-reporter command line parameter is set
if (appCenter && argvConfig['enable-crash-reporter'] && !args['disable-crash-reporter']) {
const isWindows = (process.platform === 'win32');
const isLinux = (process.platform === 'linux');
const crashReporterId = argvConfig['crash-reporter-id'];
deepak1556 marked this conversation as resolved.
Show resolved Hide resolved
const uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
if (uuidPattern.test(crashReporterId)) {
submitURL = isWindows ? appCenter[process.arch === 'ia32' ? 'win32-ia32' : 'win32-x64'] : isLinux ? appCenter[`linux-x64`] : appCenter.darwin;
submitURL = submitURL.concat('&uid=', crashReporterId, '&iid=', crashReporterId, '&sid=', crashReporterId);
// Send the id for child node process that are explicitly starting crash reporter.
// For vscode this is ExtensionHost process currently.
process.argv.push('--crash-reporter-id', crashReporterId);
}
}
}

// Start crash reporter for all processes
const productName = (product.crashReporter ? product.crashReporter.productName : undefined) || product.nameShort;
const companyName = (product.crashReporter ? product.crashReporter.companyName : undefined) || 'Microsoft';
crashReporter.start({
deepak1556 marked this conversation as resolved.
Show resolved Hide resolved
bpasero marked this conversation as resolved.
Show resolved Hide resolved
companyName: companyName,
productName: process.env['VSCODE_DEV'] ? `${productName} Dev` : productName,
submitURL,
uploadToServer: !crashReporterDirectory
bpasero marked this conversation as resolved.
Show resolved Hide resolved
});

// Set logs path before app 'ready' event if running portable
// to ensure that no 'logs' folder is created on disk at a
// location outside of the portable directory
Expand Down Expand Up @@ -110,9 +132,6 @@ registerListeners();
// Cached data
const nodeCachedDataDir = getNodeCachedDir();

// Configure static command line arguments
const argvConfig = configureCommandlineSwitchesSync(args);

// Remove env set by snap https://github.com/microsoft/vscode/issues/85344
if (process.env['SNAP']) {
delete process.env['GDK_PIXBUF_MODULE_FILE'];
Expand Down Expand Up @@ -254,9 +273,6 @@ function configureCommandlineSwitchesSync(cliArgs) {
app.commandLine.appendSwitch('js-flags', jsFlags);
}

// TODO@Deepak Electron 7 workaround for https://github.com/microsoft/vscode/issues/88873
app.commandLine.appendSwitch('disable-features', 'LayoutNG');

return argvConfig;
}

Expand Down
4 changes: 2 additions & 2 deletions src/vs/base/parts/contextmenu/electron-main/contextmenu.ts
Expand Up @@ -5,14 +5,14 @@

import { Menu, MenuItem, BrowserWindow, ipcMain, IpcMainEvent } from 'electron';
import { ISerializableContextMenuItem, CONTEXT_MENU_CLOSE_CHANNEL, CONTEXT_MENU_CHANNEL, IPopupOptions } from 'vs/base/parts/contextmenu/common/contextmenu';
import { withNullAsUndefined } from 'vs/base/common/types';

export function registerContextMenuListener(): void {
ipcMain.on(CONTEXT_MENU_CHANNEL, (event: IpcMainEvent, contextMenuId: number, items: ISerializableContextMenuItem[], onClickChannel: string, options?: IPopupOptions) => {
const menu = createMenu(event, onClickChannel, items);
const window = BrowserWindow.fromWebContents(event.sender);

menu.popup({
window: window ? window : undefined,
window: withNullAsUndefined(BrowserWindow.fromWebContents(event.sender)),
x: options ? options.x : undefined,
y: options ? options.y : undefined,
positioningItem: options ? options.positioningItem : undefined,
Expand Down