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

Update to Electron 0.36 - #9627

Merged
maxbrunsfeld merged 59 commits into
masterfrom
wl-electron-35
Feb 16, 2016
Merged

maxbrunsfeld merged 59 commits into
masterfrom
wl-electron-35

Conversation

@winstliu

Copy link
Copy Markdown
Contributor

Figured I'd get this started and get some more experience with the core atom code, as I'm pretty sure lots of things will need to be changed this time.

https://github.com/atom/electron/releases/tag/v0.35.0
https://github.com/atom/electron/releases/tag/v0.36.0

Fixes #9534
Fixes #9616
Fixes #9901
Fixes atom/tree-view#666

TODO:

  • Fix core specs failing almost instantly with no output
  • Fix specs randomly hanging - at least, they didn't hang in the last build.
  • Use new way of requiring Electron modules tabs#238
  • Fix notifications specs that rely on executeJavaScriptInDevTools...kinda? Not sure if I actually fixed the underlying deprecation or not.
  • Attempt to update to Electron v0.36.0 - in progress
  • Test for and fix regressions

Regressions:

  • Opening a new tab no longer works
  • Adding a project folder does nothing through the context menu or file menu
  • Adding a project folder through the keyboard shortcut/command palette opens up the folder chooser but doesn't actually add the new folder
  • Open Your ... menu items are all broken, even when executed through the command palette
  • Open File does not actually open the chosen file
  • Help -> About Atom does nothing
  • Open Settings does not work through the file menu
  • Opening Settings or any other file that uses a URI will cause a fake folder to appear in the Tree View (eg config, init-script) and Settings - atom://config or similar to show up in the titlebar. Reproduce by using a new window. - also an issue on master (tested on f6da4a9)
  • On 0.36 - menu mousedown effect is not removed when switching menus by hovering over to a new one (Initial menu item remains focused when mousing over to a different one electron/electron#3964)
  • Closing the window when Atom is launched using atom --foreground yields an error:
Error: Object has been destroyed
    at Error (native)
    at AtomWindow.module.exports.AtomWindow.getLoadSettings (file:///C:/Users/user/Documents/GitHub/atom/src/browser/atom-window.coffee:91:8)
    at AtomApplication.module.exports.AtomApplication.saveState (file:///C:/Users/user/Documents/GitHub/atom/src/browser/atom-application.coffee:452:34)
    at EventEmitter.<anonymous> (file:///C:/Users/user/Documents/GitHub/atom/src/browser/atom-application.coffee:211:8)
    at emitOne (events.js:77:13)
    at EventEmitter.emit (events.js:169:7)
    at AtomApplication.module.exports.AtomApplication.removeWindow (file:///C:/Users/user/Documents/GitHub/atom/src/browser/atom-application.coffee:104:13)
    at BrowserWindow.<anonymous> (file:///C:/Users/user/Documents/GitHub/atom/src/browser/atom-window.coffee:126:30)
    at emitOne (events.js:82:20)
    at BrowserWindow.emit (events.js:169:7)

The error occurs on the following line:

getLoadSettings: ->
    if @browserWindow.webContents? and not @browserWindow.webContents.isLoading()
      hash = url.parse(@browserWindow.webContents.getURL()).hash.substr(1)  # Here!
      JSON.parse(decodeURIComponent(hash))

@winstliu

Copy link
Copy Markdown
Contributor Author

Is there any way to get more output from Travis? Core specs are (surprisingly) passing but I'm sure there's a bunch of deprecated Electron APIs being used.

The joy of Atom and Electron having identically-named functions
@winstliu

Copy link
Copy Markdown
Contributor Author

And...specs are failing to run. Not sure how to proceed from here, though I suspect I probably messed up the ipc renaming.

@winstliu

Copy link
Copy Markdown
Contributor Author

Ran the tests locally and it looks like we're hitting electron/electron#3484:

Insufficient number of arguments.
TypeError: Insufficient number of arguments.
    at TypeError (native)
    at parseCommandLine (C:\Program Files\Atom\resources\app.asar\src\browser\main.js:167:100)
    at start (C:\Program Files\Atom\resources\app.asar\src\browser\main.js:32:12)
    at Object.<anonymous> (C:\Program Files\Atom\resources\app.asar\src\browser\main.js:209:3)
    at Object.<anonymous> (C:\Program Files\Atom\resources\app.asar\src\browser\main.js:211:4)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Object.<anonymous> (C:\Program Files\Atom\resources\atom.asar\browser\lib\init.js:130:10)

The build then proceeds to hang. I'll see if I can figure out what got updated; if not it looks like we'll just have to wait for Electron 0.35.1.

Comment thread src/browser/atom-application.coffee Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this file uses ipc-main, but if someone could double-check, that would be great.

@winstliu

Copy link
Copy Markdown
Contributor Author

Specs are still timing out 😞. I can run them fine locally (albeit with a whole bunch of errors), so it might be a Mac/Linux-only issue.

All the deprecations in Atom core should be fixed though.

Comment thread src/browser/atom-portable.coffee Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm thoroughly confused by this right now. Tried both ipc-main and ipc-renderer, but both throw "Cannot find module" errors. Electron is telling me to use ipc-renderer if that means anything.

(It's probably also why core specs finish in 13 secs and fail)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

...switching it back to ipc-renderer makes it work again. Really hope there isn't a race condition of some sort going on here.

@winstliu

Copy link
Copy Markdown
Contributor Author

@zcbenz A few questions:

  1. Requiring either ipc-main or ipc-renderer in atom-application.coffee and atom-portable.coffee throws "Cannot find module" errors. Is there any way around that?
  2. webContents.executeJavaScriptInDevTools doesn't seem to be a method. In fact, looking at v0.34.x, I can't even find executeJavaScriptInDevTools, just executeJavaScript. The 0.35 upgrade appears to have broken executeJavaScriptInDevTools as well with multiple cannot read "apply" of undefined errors, though it's only supposed to be a deprecation.
  3. Not a question, but I'm pretty sure the deprecation message for getHomeDir() didn't tell me to use getPath('home'), just getPath().

@glangford

Copy link
Copy Markdown

The 0.35 upgrade appears to have broken executeJavaScriptInDevTools as well with multiple cannot read "apply" of undefined errors, though it's only supposed to be a deprecation.

Spelunking to learn...It looks like executeJavaScriptInDevTools may have broke here:
electron/electron@91c4ed2

# Conflicts:
#	package.json
#	src/application-delegate.coffee
@glangford

Copy link
Copy Markdown

@zcbenz From electron/electron@91c4ed2 it looks like the original code had

BrowserWindow::executeJavaScriptInDevTools = (code) -> @devToolsWebContents?.executeJavaScript code

then deprecated to

deprecate.member BrowserWindow, 'executeJavaScriptInDevTools', 'webContents'

which on the surface looks wrong, since deprecate.member forwards the method to webContents not devToolsWebContents, and the original code ran a different method executeJavaScript.

Another possible issue is:

BrowserWindow::getPageTitle = -> @webContents.getTitle()

was deprecated with

deprecate.member BrowserWindow, 'getPageTitle', 'webContents'

where I'm guessing that deprecate.rename is required.

@maxbrunsfeld

Copy link
Copy Markdown
Contributor

@zcbenz I usually see this in the console the first time the Atom window loses focus after startup:

[75796:0127/133819:WARNING:id_weak_map.cc(81)] Removing unexist object with ID 1

Is this something to worry about?

@zcbenz

zcbenz commented Jan 28, 2016

Copy link
Copy Markdown
Contributor

I'm guessing we need to switch to using an async send, and figure out our own way of waiting until the resize is finished. Do you have any suggestions for this?

I think we should probably pass the window size to the page as part of the url, instead of reading window size in the page, it can save us the resize, which is very expensive.

I've reverted the Electron version to 0.36.4 since 0.36.5 crashes Atom on startup for me. Dump file is attached... (/cc @paulcbetts, @raelyard)

I created an issue for the crash: electron/electron#4258.

I usually see this in the console the first time the Atom window loses focus after startup:

It is an warning message, there is no need to worry about it. It has been fixed in v0.36.5.

@winstliu

Copy link
Copy Markdown
Contributor Author

So the upgrade to 0.36.7 somehow broke Standard linting... Fatal error: TypeError: Cannot read property 'match' of undefined 😞. The error didn't happen in 0.36.5 so I'll see if 0.36.6 also breaks it.

@winstliu

Copy link
Copy Markdown
Contributor Author

So for what it's worth this script\grunt standard still works on my machine...

>script\grunt standard
Running "standard:src" (standard) task

Linting files...

✓ No Problems

Done, without errors.


Execution Time (2016-01-31 20:30:39 UTC)
loading tasks  4.1s  ████████████████████████████████ 67%
standard:src     2s  ████████████████ 33%
Total 6.1s

I'll try an entire script\cibuild next to see if that repros.

@winstliu

winstliu commented Feb 1, 2016

Copy link
Copy Markdown
Contributor Author

Still can't reproduce, even after a full script\cibuild. This isn't fun. Running Windows 10 x64.

@amytruong

Copy link
Copy Markdown

Windows (8.1)
Atom Smoke Test
(High level test to ensure basic functionality and there's no immediate showstoppers)

  • Run through Welcome Guide
  • Install and update Packages
  • Install and update Themes
  • Verify speed and response time (Windows is just not fast enough - ever)
  • Verify scrolling is fast (Windows just not fast enough - ever)
  • Verify File menu bars/navigation is functioning
  • Startup
    • Any brief visual oddities like the one @50Wliu captured above
    • The window should appear with the correct size, and with the correct background color based on the theme you were previously using. It shouldn't be initially white.
    • If the window was previously full-screen, it should still appear full-screen
      Note: There is an existing bug where if you are full screen and hit restore down, it doesn't restore the window back to the original smaller size.
  • Opening a new window - the window should be offset from the initial window, similarly to how new windows behave for other text editors on the platform (TextEdit on mac, Notepad on windows).
  • Overlays, like the autocomplete pop-up should appear in the right spot. After resizing the window in various ways, when typing a word near the edge of the screen, the pop-up should always appear in a reasonable spot.
  • Adding project folders (the Application: Add Project Folder command) should open the native file picker dialog correctly.

Mac Yosemite 10.10.5
Atom Smoke Test
(High level test to ensure basic functionality and there's no immediate showstoppers)

  • Run through Welcome Guide
  • Install and update Packages
  • Install and update Themes
  • Verify speed and response time (Windows is just not fast enough - ever)
  • Verify scrolling is fast (Windows just not fast enough - ever)
  • Verify File menu bars/navigation is functioning
  • Startup
    • Any brief visual oddities like the one @50Wliu captured above
    • The window should appear with the correct size, and with the correct background color based on the theme you were previously using. It shouldn't be initially white.
    • If the window was previously full-screen, it should still appear full-screen
  • Opening a new window - the window should be offset from the initial window, similarly to how new windows behave for other text editors on the platform (TextEdit on mac, Notepad on windows).
  • Overlays, like the autocomplete pop-up should appear in the right spot. After resizing the window in various ways, when typing a word near the edge of the screen, the pop-up should always appear in a reasonable spot.
  • Adding project folders (the Application: Add Project Folder command) should open the native file picker dialog correctly.

Linux (Ubuntu 15.00? whatever the latest is)
Atom Smoke Test
(High level test to ensure basic functionality and there's no immediate showstoppers)

  • Run through Welcome Guide
  • Install and update Packages
  • Install and update Themes
  • Verify speed and response time (Windows is just not fast enough - ever)
  • Verify scrolling is fast (Windows just not fast enough - ever)
  • Verify File menu bars/navigation is functioning
  • Create new file. Save. (Verify it's saved)

Notes:

  • Changing themes can sometimes gives a really quick white flicker in the background. Happens so little and sporadically that it might not be worth mentioning.
  • Resizing the window takes awhile and I'll see white or black space before the app displays again fully but it happens on the Beta too. /shrug
    screen shot 2016-02-12 at 1 38 19 pm
  • Did have an unusual crash opening up a simple window
  • Startup
    • Any brief visual oddities like the one @50Wliu captured above
    • The window should appear with the correct size, and with the correct background color based on the theme you were previously using. It shouldn't be initially white.
    • If the window was previously full-screen, it should still appear full-screen
  • Opening a new window - the window should be offset from the initial window, similarly to how new windows behave for other text editors on the platform (TextEdit on mac, Notepad on windows).
    Does NOT open offset from initial window but rather right on top of it
  • Overlays, like the autocomplete pop-up should appear in the right spot. After resizing the window in various ways, when typing a word near the edge of the screen, the pop-up should always appear in a reasonable spot.
  • Adding project folders (the Application: Add Project Folder command) should open the native file picker dialog correctly.

would like to do some more exploratory testing when I get back into town.

maxbrunsfeld pushed a commit that referenced this pull request Feb 16, 2016
@maxbrunsfeld
maxbrunsfeld merged commit 41161dd into master Feb 16, 2016
@maxbrunsfeld
maxbrunsfeld deleted the wl-electron-35 branch February 16, 2016 22:08
@maxbrunsfeld

Copy link
Copy Markdown
Contributor

Thanks for the update Amy! I merged this into master so that we can use it in some further PRs. There should be ample time to do exploratory testing on master once you get back from vacation!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

9 participants