mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Merge pull request #12300 from atom/tj-upgrade-electron
Upgrade Electron
This commit is contained in:
@@ -37,7 +37,7 @@ if (process.platform === 'win32') {
|
||||
|
||||
// The following classes can't be used from a Task handler and should therefore
|
||||
// only be exported when not running as a child node process
|
||||
if (!process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE) {
|
||||
if (process.type === 'renderer') {
|
||||
atomExport.Task = require('../src/task')
|
||||
|
||||
const TextEditor = (params) => {
|
||||
|
||||
7
exports/clipboard.js
Normal file
7
exports/clipboard.js
Normal file
@@ -0,0 +1,7 @@
|
||||
module.exports = require('electron').clipboard
|
||||
|
||||
const Grim = require('grim')
|
||||
Grim.deprecate('Use `require("electron").clipboard` instead of `require("clipboard")`')
|
||||
|
||||
// Ensure each package that requires this shim causes a deprecation warning
|
||||
delete require.cache[__filename]
|
||||
7
exports/ipc.js
Normal file
7
exports/ipc.js
Normal file
@@ -0,0 +1,7 @@
|
||||
module.exports = require('electron').ipcRenderer
|
||||
|
||||
const Grim = require('grim')
|
||||
Grim.deprecate('Use `require("electron").ipcRenderer` instead of `require("ipc")`')
|
||||
|
||||
// Ensure each package that requires this shim causes a deprecation warning
|
||||
delete require.cache[__filename]
|
||||
7
exports/remote.js
Normal file
7
exports/remote.js
Normal file
@@ -0,0 +1,7 @@
|
||||
module.exports = require('electron').remote
|
||||
|
||||
const Grim = require('grim')
|
||||
Grim.deprecate('Use `require("electron").remote` instead of `require("remote")`')
|
||||
|
||||
// Ensure each package that requires this shim causes a deprecation warning
|
||||
delete require.cache[__filename]
|
||||
7
exports/shell.js
Normal file
7
exports/shell.js
Normal file
@@ -0,0 +1,7 @@
|
||||
module.exports = require('electron').shell
|
||||
|
||||
const Grim = require('grim')
|
||||
Grim.deprecate('Use `require("electron").shell` instead of `require("shell")`')
|
||||
|
||||
// Ensure each package that requires this shim causes a deprecation warning
|
||||
delete require.cache[__filename]
|
||||
7
exports/web-frame.js
Normal file
7
exports/web-frame.js
Normal file
@@ -0,0 +1,7 @@
|
||||
module.exports = require('electron').webFrame
|
||||
|
||||
const Grim = require('grim')
|
||||
Grim.deprecate('Use `require("electron").webFrame` instead of `require("web-frame")`')
|
||||
|
||||
// Ensure each package that requires this shim causes a deprecation warning
|
||||
delete require.cache[__filename]
|
||||
14
package.json
14
package.json
@@ -12,7 +12,7 @@
|
||||
"url": "https://github.com/atom/atom/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"electronVersion": "0.37.8",
|
||||
"electronVersion": "1.3.5",
|
||||
"dependencies": {
|
||||
"async": "0.2.6",
|
||||
"atom-keymap": "6.3.2",
|
||||
@@ -27,7 +27,7 @@
|
||||
"devtron": "1.1.0",
|
||||
"event-kit": "^2.1.0",
|
||||
"find-parent-dir": "^0.3.0",
|
||||
"first-mate": "^5.1.1",
|
||||
"first-mate": "6.0.0",
|
||||
"fs-plus": "2.9.1",
|
||||
"fstream": "0.1.24",
|
||||
"fuzzaldrin": "^2.1",
|
||||
@@ -43,7 +43,7 @@
|
||||
"mocha": "2.5.1",
|
||||
"normalize-package-data": "^2.0.0",
|
||||
"nslog": "^3",
|
||||
"oniguruma": "^5",
|
||||
"oniguruma": "6.1.0",
|
||||
"pathwatcher": "~6.5",
|
||||
"property-accessors": "^1.1.3",
|
||||
"random-words": "0.0.1",
|
||||
@@ -82,13 +82,13 @@
|
||||
"autocomplete-atom-api": "0.10.0",
|
||||
"autocomplete-css": "0.11.2",
|
||||
"autocomplete-html": "0.7.2",
|
||||
"autocomplete-plus": "2.31.1",
|
||||
"autocomplete-plus": "2.31.2",
|
||||
"autocomplete-snippets": "1.11.0",
|
||||
"autoflow": "0.27.0",
|
||||
"autosave": "0.23.1",
|
||||
"background-tips": "0.26.1",
|
||||
"bookmarks": "0.42.0",
|
||||
"bracket-matcher": "0.82.1",
|
||||
"bracket-matcher": "0.82.2",
|
||||
"command-palette": "0.38.0",
|
||||
"deprecation-cop": "0.54.1",
|
||||
"dev-live-reload": "0.47.0",
|
||||
@@ -103,7 +103,7 @@
|
||||
"incompatible-packages": "0.26.1",
|
||||
"keybinding-resolver": "0.35.0",
|
||||
"line-ending-selector": "0.5.0",
|
||||
"link": "0.31.1",
|
||||
"link": "0.31.2",
|
||||
"markdown-preview": "0.158.3",
|
||||
"metrics": "1.0.0",
|
||||
"notifications": "0.65.1",
|
||||
@@ -113,7 +113,7 @@
|
||||
"snippets": "1.0.2",
|
||||
"spell-check": "0.68.2",
|
||||
"status-bar": "1.4.1",
|
||||
"styleguide": "0.47.0",
|
||||
"styleguide": "0.47.2",
|
||||
"symbols-view": "0.113.1",
|
||||
"tabs": "0.101.0",
|
||||
"timecop": "0.33.2",
|
||||
|
||||
@@ -407,7 +407,7 @@ describe "AtomEnvironment", ->
|
||||
updateAvailableHandler = jasmine.createSpy("update-available-handler")
|
||||
subscription = atom.onUpdateAvailable updateAvailableHandler
|
||||
|
||||
autoUpdater = require('electron').remote.require('auto-updater')
|
||||
autoUpdater = require('electron').remote.autoUpdater
|
||||
autoUpdater.emit 'update-downloaded', null, "notes", "version"
|
||||
|
||||
waitsFor ->
|
||||
|
||||
@@ -223,9 +223,7 @@ describe('AtomApplication', function () {
|
||||
const window1 = atomApplication.launch(parseCommandLine([dirAPath, dirBPath]))
|
||||
await focusWindow(window1)
|
||||
|
||||
await new Promise(function (resolve) {
|
||||
setTimeout(resolve, 1000)
|
||||
})
|
||||
await timeoutPromise(1000)
|
||||
|
||||
let treeViewPaths = await evalInWebContents(window1.browserWindow.webContents, function (sendBackToMainProcess) {
|
||||
sendBackToMainProcess(
|
||||
|
||||
@@ -48,12 +48,12 @@ describe "WorkspaceElement", ->
|
||||
it "updates the font-family based on the 'editor.fontFamily' config value", ->
|
||||
initialCharWidth = editor.getDefaultCharWidth()
|
||||
fontFamily = atom.config.get('editor.fontFamily')
|
||||
fontFamily += ", 'Apple Color Emoji'" if process.platform is 'darwin'
|
||||
fontFamily += ', "Apple Color Emoji"' if process.platform is 'darwin'
|
||||
expect(getComputedStyle(editorElement).fontFamily).toBe fontFamily
|
||||
|
||||
atom.config.set('editor.fontFamily', 'sans-serif')
|
||||
fontFamily = atom.config.get('editor.fontFamily')
|
||||
fontFamily += ", 'Apple Color Emoji'" if process.platform is 'darwin'
|
||||
fontFamily += ', "Apple Color Emoji"' if process.platform is 'darwin'
|
||||
expect(getComputedStyle(editorElement).fontFamily).toBe fontFamily
|
||||
expect(editor.getDefaultCharWidth()).not.toBe initialCharWidth
|
||||
|
||||
|
||||
80
src/electron-shims.js
Normal file
80
src/electron-shims.js
Normal file
@@ -0,0 +1,80 @@
|
||||
const path = require('path')
|
||||
const electron = require('electron')
|
||||
|
||||
const dirname = path.dirname
|
||||
path.dirname = function (path) {
|
||||
if (typeof path !== 'string') {
|
||||
path = '' + path
|
||||
const Grim = require('grim')
|
||||
Grim.deprecate('Argument to `path.dirname` must be a string')
|
||||
}
|
||||
|
||||
return dirname(path)
|
||||
}
|
||||
|
||||
const extname = path.extname
|
||||
path.extname = function (path) {
|
||||
if (typeof path !== 'string') {
|
||||
path = '' + path
|
||||
const Grim = require('grim')
|
||||
Grim.deprecate('Argument to `path.extname` must be a string')
|
||||
}
|
||||
|
||||
return extname(path)
|
||||
}
|
||||
|
||||
const basename = path.basename
|
||||
path.basename = function (path, ext) {
|
||||
if (typeof path !== 'string' || (ext !== undefined && typeof ext !== 'string')) {
|
||||
path = '' + path
|
||||
const Grim = require('grim')
|
||||
Grim.deprecate('Arguments to `path.basename` must be strings')
|
||||
}
|
||||
|
||||
return basename(path, ext)
|
||||
}
|
||||
|
||||
electron.ipcRenderer.sendChannel = function () {
|
||||
const Grim = require('grim')
|
||||
Grim.deprecate('Use `ipcRenderer.send` instead of `ipcRenderer.sendChannel`')
|
||||
return this.send.apply(this, arguments)
|
||||
}
|
||||
|
||||
const remoteRequire = electron.remote.require
|
||||
electron.remote.require = function (moduleName) {
|
||||
const Grim = require('grim')
|
||||
switch (moduleName) {
|
||||
case 'menu':
|
||||
Grim.deprecate('Use `remote.Menu` instead of `remote.require("menu")`')
|
||||
return this.Menu
|
||||
case 'menu-item':
|
||||
Grim.deprecate('Use `remote.MenuItem` instead of `remote.require("menu-item")`')
|
||||
return this.MenuItem
|
||||
case 'browser-window':
|
||||
Grim.deprecate('Use `remote.BrowserWindow` instead of `remote.require("browser-window")`')
|
||||
return this.BrowserWindow
|
||||
case 'dialog':
|
||||
Grim.deprecate('Use `remote.Dialog` instead of `remote.require("dialog")`')
|
||||
return this.Dialog
|
||||
case 'app':
|
||||
Grim.deprecate('Use `remote.app` instead of `remote.require("app")`')
|
||||
return this.app
|
||||
case 'crash-reporter':
|
||||
Grim.deprecate('Use `remote.crashReporter` instead of `remote.require("crashReporter")`')
|
||||
return this.crashReporter
|
||||
case 'global-shortcut':
|
||||
Grim.deprecate('Use `remote.globalShortcut` instead of `remote.require("global-shortcut")`')
|
||||
return this.globalShortcut
|
||||
case 'clipboard':
|
||||
Grim.deprecate('Use `remote.clipboard` instead of `remote.require("clipboard")`')
|
||||
return this.clipboard
|
||||
case 'native-image':
|
||||
Grim.deprecate('Use `remote.nativeImage` instead of `remote.require("native-image")`')
|
||||
return this.nativeImage
|
||||
case 'tray':
|
||||
Grim.deprecate('Use `remote.Tray` instead of `remote.require("tray")`')
|
||||
return this.Tray
|
||||
default:
|
||||
return remoteRequire.call(this, moduleName)
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ module.exports = ({blobStore}) ->
|
||||
{getWindowLoadSettings} = require './window-load-settings-helpers'
|
||||
{ipcRenderer} = require 'electron'
|
||||
{resourcePath, isSpec, devMode, env} = getWindowLoadSettings()
|
||||
require '../src/electron-shims'
|
||||
|
||||
updateProcessEnv(env)
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ module.exports = ({blobStore}) ->
|
||||
{getWindowLoadSettings} = require './window-load-settings-helpers'
|
||||
AtomEnvironment = require '../src/atom-environment'
|
||||
ApplicationDelegate = require '../src/application-delegate'
|
||||
require '../src/electron-shims'
|
||||
|
||||
{testRunnerPath, legacyTestRunnerPath, headless, logFile, testPaths} = getWindowLoadSettings()
|
||||
|
||||
|
||||
@@ -164,7 +164,8 @@ class WindowEventHandler
|
||||
else
|
||||
@applicationDelegate.didCancelWindowUnload()
|
||||
|
||||
confirmed
|
||||
# Returning any non-void value stops the window from unloading
|
||||
return true unless confirmed
|
||||
|
||||
handleWindowUnload: =>
|
||||
@atomEnvironment.destroy()
|
||||
|
||||
@@ -16,8 +16,12 @@ atom-pane-container {
|
||||
min-width: 0;
|
||||
|
||||
& > atom-pane-resize-handle {
|
||||
position: absolute;
|
||||
z-index: 3;
|
||||
position: relative;
|
||||
&:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
z-index: 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,11 +29,14 @@ atom-pane-container {
|
||||
flex-direction: column;
|
||||
|
||||
& > atom-pane-resize-handle {
|
||||
width: 100%;
|
||||
height: 8px;
|
||||
margin-top: -4px;
|
||||
cursor: row-resize;
|
||||
border-bottom: none;
|
||||
&:before {
|
||||
height: 8px;
|
||||
top: -4px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
cursor: row-resize;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,11 +44,14 @@ atom-pane-container {
|
||||
flex-direction: row;
|
||||
|
||||
& > atom-pane-resize-handle {
|
||||
width: 8px;
|
||||
height: 100%;
|
||||
margin-left: -4px;
|
||||
cursor: col-resize;
|
||||
border-right: none;
|
||||
&:before {
|
||||
width: 8px;
|
||||
left: -4px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
cursor: col-resize;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user