Skip to content

Commit

Permalink
Revert "chore: update to electron 9-x-y (#102011)"
Browse files Browse the repository at this point in the history
This reverts commit 3d0d50c.
  • Loading branch information
deepak1556 committed Jul 30, 2020
1 parent 179b834 commit c77491f
Show file tree
Hide file tree
Showing 47 changed files with 242 additions and 257 deletions.
2 changes: 1 addition & 1 deletion .yarnrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
disturl "https://atom.io/download/electron"
target "9.1.0"
target "7.3.2"
runtime "electron"
2 changes: 1 addition & 1 deletion build/azure-pipelines/darwin/continuous-build-darwin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "12.14.1"
versionSpec: "12.13.0"

- 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
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ steps:

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

- 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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pr:
steps:
- task: NodeTool@0
inputs:
versionSpec: "12.14.1"
versionSpec: "12.13.0"

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

- 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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ steps:
- task: NodeTool@0
inputs:
versionSpec: "12.14.1"
versionSpec: "12.13.0"

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ steps:

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

- 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
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ steps:

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

- 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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "12.14.1"
versionSpec: "12.13.0"

- 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
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ steps:

- task: NodeTool@0
inputs:
versionSpec: "12.14.1"
versionSpec: "12.13.0"
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pr: none
steps:
- task: NodeTool@0
inputs:
versionSpec: "12.14.1"
versionSpec: "12.13.0"

- 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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "12.14.1"
versionSpec: "12.13.0"

- 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
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ steps:

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

- 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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "12.14.1"
versionSpec: "12.13.0"

- 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
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ steps:

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

- 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
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ steps:

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

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
Expand Down
4 changes: 4 additions & 0 deletions build/lib/i18n.resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@
"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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"git": {
"name": "chromium",
"repositoryUrl": "https://chromium.googlesource.com/chromium/src",
"commitHash": "894fb9eb56c6cbda65e3c3ae9ada6d4cb5850cc9"
"commitHash": "e4745133a1d3745f066e068b8033c6a269b59caf"
}
},
"licenseDetail": [
Expand Down Expand Up @@ -40,32 +40,32 @@
"SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
],
"isOnlyProductionDependency": true,
"version": "83.0.4103.122"
"version": "78.0.3904.130"
},
{
"component": {
"type": "git",
"git": {
"name": "nodejs",
"repositoryUrl": "https://github.com/nodejs/node",
"commitHash": "9622fed3fb2cffcea9efff6c8cb4cc2def99d75d"
"commitHash": "787378879acfb212ed4ff824bf9f767a24a5cb43a"
}
},
"isOnlyProductionDependency": true,
"version": "12.14.1"
"version": "12.8.1"
},
{
"component": {
"type": "git",
"git": {
"name": "electron",
"repositoryUrl": "https://github.com/electron/electron",
"commitHash": "a822d2639a9c9c2c670e91d73f78e921865ce38e"
"commitHash": "5f93e889020d279d5a9cd1ecab080ab467312447"
}
},
"isOnlyProductionDependency": true,
"license": "MIT",
"version": "9.1.0"
"version": "7.3.2"
},
{
"component": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"css-loader": "^3.2.0",
"debounce": "^1.0.0",
"deemon": "^1.4.0",
"electron": "9.1.0",
"electron": "7.3.2",
"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
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
disturl "http://nodejs.org/dist"
target "12.14.1"
target "12.4.0"
runtime "node"
68 changes: 26 additions & 42 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ const bootstrap = require('./bootstrap');
const paths = require('./paths');
/** @type {any} */
const product = require('../product.json');
const { app, protocol, crashReporter } = require('electron');

// Disable render process reuse, we still have
// non-context aware native modules in the renderer.
app.allowRendererProcessReuse = false;
const { app, protocol } = require('electron');

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

// Configure static command line arguments
const argvConfig = configureCommandlineSwitchesSync(args);
// 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.

// 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.
// If a crash-reporter-directory is specified we setup the crash reporter
// right from the beginning as early as possible to monitor all processes.
let crashReporterDirectory = args['crash-reporter-directory'];
let submitURL = '';
if (crashReporterDirectory) {
crashReporterDirectory = path.normalize(crashReporterDirectory);

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

// Crashes are stored in the crashDumps directory by default, so we
// Crashes are stored in the temp directory by default, so we
// need to change that directory to the provided one
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'];
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);
}
}
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
});
}

// 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({
companyName: companyName,
productName: process.env['VSCODE_DEV'] ? `${productName} Dev` : productName,
submitURL,
uploadToServer: !crashReporterDirectory
});

// 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 @@ -132,6 +110,9 @@ 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 @@ -273,6 +254,9 @@ 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
3 changes: 1 addition & 2 deletions src/vs/base/parts/contextmenu/electron-main/contextmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@

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);

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

0 comments on commit c77491f

Please sign in to comment.