Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Revert "Merge pull request #18916 from atom/electron-3.1"
Browse files Browse the repository at this point in the history
This reverts commit dc39210, reversing
changes made to e18559f.
  • Loading branch information
Nathan Sobo committed May 20, 2019
1 parent 55ddf0a commit 3da827b
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 44 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"url": "https://github.com/atom/atom/issues"
},
"license": "MIT",
"electronVersion": "3.1.9",
"electronVersion": "2.0.18",
"dependencies": {
"@atom/nsfw": "1.0.22",
"@atom/source-map-support": "^0.3.4",
Expand Down
12 changes: 6 additions & 6 deletions script/lib/check-chromedriver-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ const CONFIG = require('../config')
const semver = require('semver')

module.exports = function () {
// Chromedriver should be specified as ^n.x where n matches the Electron major version
// Chromedriver should be specified as ~x.y where x and y match Electron major/minor
const chromedriverVer = buildMetadata.dependencies['electron-chromedriver']
const mksnapshotVer = buildMetadata.dependencies['electron-mksnapshot']

// Always use caret on electron-chromedriver so that it can pick up the best minor/patch versions
if (!chromedriverVer.startsWith('^')) {
throw new Error(`electron-chromedriver version in script/package.json should start with a caret to match latest patch version.`)
// Always use tilde on electron-chromedriver so that it can pick up the best patch version
if (!chromedriverVer.startsWith('~')) {
throw new Error(`electron-chromedriver version in script/package.json should start with a tilde to match latest patch version.`)
}

if (!mksnapshotVer.startsWith('^')) {
throw new Error(`electron-mksnapshot version in script/package.json should start with a caret to match latest patch version.`)
if (!mksnapshotVer.startsWith('~')) {
throw new Error(`electron-mksnapshot version in script/package.json should start with a tilde to match latest patch version.`)
}

const electronVer = CONFIG.appMetadata.electronVersion
Expand Down
34 changes: 10 additions & 24 deletions script/lib/generate-startup-snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,36 +104,22 @@ module.exports = function (packagedAppPath) {
{env: Object.assign({}, process.env, {ELECTRON_RUN_AS_NODE: 1})}
)

console.log('Generating startup blob with mksnapshot')
childProcess.spawnSync(
process.execPath, [
path.join(CONFIG.repositoryRootPath, 'script', 'node_modules', 'electron-mksnapshot', 'mksnapshot.js'),
snapshotScriptPath,
'--output_dir',
CONFIG.buildOutputPath
]
const generatedStartupBlobPath = path.join(CONFIG.buildOutputPath, 'snapshot_blob.bin')
console.log(`Generating startup blob at "${generatedStartupBlobPath}"`)
childProcess.execFileSync(
path.join(CONFIG.repositoryRootPath, 'script', 'node_modules', 'electron-mksnapshot', 'bin', 'mksnapshot'),
['--no-use_ic', snapshotScriptPath, '--startup_blob', generatedStartupBlobPath]
)

let startupBlobDestinationPath
if (process.platform === 'darwin') {
startupBlobDestinationPath = `${packagedAppPath}/Contents/Frameworks/Electron Framework.framework/Resources`
startupBlobDestinationPath = `${packagedAppPath}/Contents/Frameworks/Electron Framework.framework/Resources/snapshot_blob.bin`
} else {
startupBlobDestinationPath = packagedAppPath
startupBlobDestinationPath = path.join(packagedAppPath, 'snapshot_blob.bin')
}

const snapshotBinaries = ['v8_context_snapshot.bin', 'snapshot_blob.bin']
for (let snapshotBinary of snapshotBinaries) {
const destinationPath = path.join(startupBlobDestinationPath, snapshotBinary)
console.log(`Moving generated startup blob into "${destinationPath}"`)
try {
fs.unlinkSync(destinationPath)
} catch (err) {
// Doesn't matter if the file doesn't exist already
if (!err.code || err.code !== 'ENOENT') {
throw err
}
}
fs.renameSync(path.join(CONFIG.buildOutputPath, snapshotBinary), destinationPath)
}
console.log(`Moving generated startup blob into "${startupBlobDestinationPath}"`)
fs.unlinkSync(startupBlobDestinationPath)
fs.renameSync(generatedStartupBlobPath, startupBlobDestinationPath)
})
}
15 changes: 7 additions & 8 deletions script/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions script/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"coffeelint": "1.15.7",
"colors": "1.1.2",
"donna": "1.0.16",
"electron-chromedriver": "^3.0.0",
"electron-chromedriver": "~2.0",
"electron-link": "0.4.0",
"electron-mksnapshot": "^3.0.10",
"electron-mksnapshot": "~2.0",
"electron-packager": "12.2.0",
"electron-winstaller": "2.6.4",
"eslint": "^5.16.0",
Expand Down
4 changes: 2 additions & 2 deletions spec/theme-manager-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ h2 {
it('returns a disposable allowing styles applied by the given path to be removed', function () {
const cssPath = require.resolve('./fixtures/css.css')

expect(getComputedStyle(document.body).fontWeight).not.toBe('700')
expect(getComputedStyle(document.body).fontWeight).not.toBe('bold')
const disposable = atom.themes.requireStylesheet(cssPath)
expect(getComputedStyle(document.body).fontWeight).toBe('700')
expect(getComputedStyle(document.body).fontWeight).toBe('bold')

let styleElementRemovedHandler
atom.styles.onDidRemoveStyleElement(
Expand Down
2 changes: 1 addition & 1 deletion src/text-editor-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -4449,7 +4449,7 @@ class NodePool {

if (element) {
element.className = className || ''
element.attributeStyleMap.forEach((value, key) => {
element.styleMap.forEach((value, key) => {
if (!style || style[key] == null) element.style[key] = ''
})
if (style) Object.assign(element.style, style)
Expand Down

0 comments on commit 3da827b

Please sign in to comment.