Back out Electron 7.1.1/7.1.2 upgrades

Summary:
Original commit changeset: eddfbb3571c7
Original commit changeset: f7300f527b65

Pains me to do this, but probably our best chance right now to get a release out.

Reviewed By: cekkaewnumchai

Differential Revision: D18687890

fbshipit-source-id: 05d13aca71457ca6dd19f5b45d58158ae223e66f
This commit is contained in:
Pascal Hartig
2019-11-25 10:48:59 -08:00
committed by realpassy
parent adb1cb163b
commit a75a52a25b
10 changed files with 546 additions and 446 deletions

View File

@@ -41,7 +41,7 @@
] ]
}, },
"resolutions": { "resolutions": {
"@jest-runner/electron/electron": "7.1.2", "@jest-runner/electron/electron": "5.0.11",
"adbkit/adbkit-logcat": "2", "adbkit/adbkit-logcat": "2",
"@types/react": "16.9.11", "@types/react": "16.9.11",
"@types/react-dom": "16.9.2" "@types/react-dom": "16.9.2"
@@ -60,7 +60,7 @@
"clearMocks": true "clearMocks": true
}, },
"devDependencies": { "devDependencies": {
"@jest-runner/electron": "^2.0.2", "@jest-runner/electron": "^2.0.1",
"@testing-library/react": "^9.3.0", "@testing-library/react": "^9.3.0",
"@types/algoliasearch": "^3.30.19", "@types/algoliasearch": "^3.30.19",
"@types/deep-equal": "^1.0.1", "@types/deep-equal": "^1.0.1",
@@ -85,8 +85,8 @@
"@typescript-eslint/parser": "^2.1.1-alpha.4", "@typescript-eslint/parser": "^2.1.1-alpha.4",
"babel-code-frame": "^6.26.0", "babel-code-frame": "^6.26.0",
"babel-eslint": "^10.0.1", "babel-eslint": "^10.0.1",
"electron": "7.1.2", "electron": "^5.0.11",
"electron-builder": "22.1.0", "electron-builder": "^20.38.5",
"eslint": "^6.5.1", "eslint": "^6.5.1",
"eslint-config-fbjs": "^3.1.1", "eslint-config-fbjs": "^3.1.1",
"eslint-plugin-babel": "^5.3.0", "eslint-plugin-babel": "^5.3.0",
@@ -185,6 +185,8 @@
}, },
"greenkeeper": { "greenkeeper": {
"ignore": [ "ignore": [
"electron",
"electron-builder",
"emotion", "emotion",
"react-emotion", "react-emotion",
"tmp" "tmp"

View File

@@ -108,7 +108,7 @@ export function setupMenuBar(
const menu = applicationMenu.items.find( const menu = applicationMenu.items.find(
menuItem => menuItem.label === topLevelMenu, menuItem => menuItem.label === topLevelMenu,
); );
if (menu && menu.submenu) { if (menu) {
const menuItem = menu.submenu.items.find( const menuItem = menu.submenu.items.find(
menuItem => menuItem.label === label, menuItem => menuItem.label === label,
); );
@@ -270,7 +270,7 @@ function getTemplate(
{ {
label: 'Select All', label: 'Select All',
accelerator: 'CmdOrCtrl+A', accelerator: 'CmdOrCtrl+A',
role: 'selectAll', role: 'selectall',
}, },
], ],
}, },
@@ -384,7 +384,7 @@ function getTemplate(
]; ];
if (process.platform === 'darwin') { if (process.platform === 'darwin') {
const name = app.name; const name = app.getName();
template.unshift({ template.unshift({
label: name, label: name,
submenu: [ submenu: [
@@ -411,7 +411,7 @@ function getTemplate(
{ {
label: 'Hide Others', label: 'Hide Others',
accelerator: 'Command+Shift+H', accelerator: 'Command+Shift+H',
role: 'hideOthers', role: 'hideothers',
}, },
{ {
label: 'Show All', label: 'Show All',

View File

@@ -7,7 +7,6 @@
* @format * @format
*/ */
import electron from 'electron';
import {FlexColumn, styled, Text, FlexRow, Input, colors, Glyph} from 'flipper'; import {FlexColumn, styled, Text, FlexRow, Input, colors, Glyph} from 'flipper';
import React, {useState} from 'react'; import React, {useState} from 'react';
import {promises as fs} from 'fs'; import {promises as fs} from 'fs';
@@ -88,18 +87,16 @@ export function FilePathConfigField(props: {
/> />
<FlexColumn <FlexColumn
onClick={() => onClick={() =>
remote.dialog remote.dialog.showOpenDialog(
.showOpenDialog({ {
properties: ['openDirectory', 'showHiddenFiles'], properties: ['openDirectory', 'showHiddenFiles'],
defaultPath: path.resolve('/'), defaultPath: path.resolve('/'),
}) },
.then((result: electron.SaveDialogReturnValue) => { (paths: Array<string> | undefined) => {
if (result.filePath) { paths && setValue(paths[0]);
const path: string = result.filePath.toString(); paths && props.onChange(paths[0]);
setValue(path); },
props.onChange(path); )
}
})
}> }>
<CenteredGlyph name="dots-3-circle" variant="outline" /> <CenteredGlyph name="dots-3-circle" variant="outline" />
</FlexColumn> </FlexColumn>

View File

@@ -7,7 +7,7 @@
* @format * @format
*/ */
import {remote, ipcRenderer, IpcRendererEvent} from 'electron'; import {remote, ipcRenderer} from 'electron';
import {toggleAction} from '../reducers/application'; import {toggleAction} from '../reducers/application';
import {setStaticView} from '../reducers/connections'; import {setStaticView} from '../reducers/connections';
import {Store} from '../reducers/index.js'; import {Store} from '../reducers/index.js';
@@ -57,7 +57,7 @@ export default (store: Store, logger: Logger) => {
ipcRenderer.on( ipcRenderer.on(
'flipper-protocol-handler', 'flipper-protocol-handler',
(_event: IpcRendererEvent, query: string) => { (_event: string, query: string) => {
const uri = new URL(query); const uri = new URL(query);
if (query.startsWith('flipper://import')) { if (query.startsWith('flipper://import')) {
const {search} = new URL(query); const {search} = new URL(query);
@@ -102,14 +102,11 @@ export default (store: Store, logger: Logger) => {
}, },
); );
ipcRenderer.on( ipcRenderer.on('open-flipper-file', (_event: string, url: string) => {
'open-flipper-file', tryCatchReportPlatformFailures(() => {
(_event: IpcRendererEvent, url: string) => { return importFileToStore(url, store);
tryCatchReportPlatformFailures(() => { }, `${IMPORT_FLIPPER_TRACE_EVENT}:Deeplink`);
return importFileToStore(url, store); });
}, `${IMPORT_FLIPPER_TRACE_EVENT}:Deeplink`);
},
);
if (process.env.FLIPPER_PORTS) { if (process.env.FLIPPER_PORTS) {
const portOverrides = parseFlipperPorts(process.env.FLIPPER_PORTS); const portOverrides = parseFlipperPorts(process.env.FLIPPER_PORTS);

View File

@@ -12,7 +12,7 @@ import {Logger} from '../fb-interfaces/Logger';
import {PluginNotification} from '../reducers/notifications'; import {PluginNotification} from '../reducers/notifications';
import {FlipperPlugin, FlipperDevicePlugin} from '../plugin'; import {FlipperPlugin, FlipperDevicePlugin} from '../plugin';
import isHeadless from '../utils/isHeadless'; import isHeadless from '../utils/isHeadless';
import {ipcRenderer, IpcRendererEvent} from 'electron'; import {ipcRenderer} from 'electron';
import {selectPlugin} from '../reducers/connections'; import {selectPlugin} from '../reducers/connections';
import { import {
setActiveNotifications, setActiveNotifications,
@@ -37,7 +37,6 @@ export default (store: Store, logger: Logger) => {
ipcRenderer.on( ipcRenderer.on(
'notificationEvent', 'notificationEvent',
( (
_event: IpcRendererEvent,
_e: Error, _e: Error,
eventName: NotificationEvents, eventName: NotificationEvents,
pluginNotification: PluginNotification, pluginNotification: PluginNotification,

View File

@@ -690,9 +690,8 @@ export function showOpenDialog(store: Store) {
properties: ['openFile'], properties: ['openFile'],
filters: [{extensions: ['flipper', 'json', 'txt'], name: 'Flipper files'}], filters: [{extensions: ['flipper', 'json', 'txt'], name: 'Flipper files'}],
}; };
remote.dialog.showOpenDialog(options).then(result => { remote.dialog.showOpenDialog(options, (filePaths?: Array<string>) => {
const filePaths = result.filePaths; if (filePaths !== undefined && filePaths.length > 0) {
if (filePaths.length > 0) {
tryCatchReportPlatformFailures(() => { tryCatchReportPlatformFailures(() => {
importFileToStore(filePaths[0], store); importFileToStore(filePaths[0], store);
}, `${IMPORT_FLIPPER_TRACE_EVENT}:UI`); }, `${IMPORT_FLIPPER_TRACE_EVENT}:UI`);
@@ -701,17 +700,14 @@ export function showOpenDialog(store: Store) {
} }
export function startFileExport(dispatch: Store['dispatch']) { export function startFileExport(dispatch: Store['dispatch']) {
electron.remote.dialog electron.remote.dialog.showSaveDialog(
.showSaveDialog( // @ts-ignore This appears to work but isn't allowed by the types
// @ts-ignore This appears to work but isn't allowed by the types null,
null, {
{ title: 'FlipperExport',
title: 'FlipperExport', defaultPath: path.join(os.homedir(), 'FlipperExport.flipper'),
defaultPath: path.join(os.homedir(), 'FlipperExport.flipper'), },
}, async (file: string) => {
)
.then(async (result: electron.SaveDialogReturnValue) => {
const file = result.filePath;
if (!file) { if (!file) {
return; return;
} }
@@ -722,7 +718,8 @@ export function startFileExport(dispatch: Store['dispatch']) {
closeOnFinish: false, closeOnFinish: false,
}), }),
); );
}); },
);
} }
export function startLinkExport(dispatch: Store['dispatch']) { export function startLinkExport(dispatch: Store['dispatch']) {

908
yarn.lock

File diff suppressed because it is too large Load Diff