Skip to content

update Electron to 1.6.11 - #1430

Merged
joshaber merged 25 commits into
masterfrom
bump-to-electron-1-6-9
Jun 20, 2017
Merged

joshaber merged 25 commits into
masterfrom
bump-to-electron-1-6-9

Conversation

@shiftkey

@shiftkey shiftkey commented May 11, 2017 •

Copy link
Copy Markdown
Member

So I was able to workaround much of the incompatibilities between the two type declarations, with some rough edges called out. It'd be nice to ensure the rough edges are sorted before merging, rather than letting it hang around.

@desktop/electron where's the best place to report these issues upstream - an open issue on electron-typescript-declarations walking through the samples and cross-referencing the API docs that need to be updated so it all flows through? Or something else?

Fixes #671

TODO:

  • y u no build
  • verify self-signed certificate flow on macOS
  • verify self-signed certificate flow on Windows

Comment thread app/src/lib/globals.d.ts Outdated

declare namespace NodeJS {
interface Process extends EventEmitter {
on(event: 'uncaughtException', listener: (error: Error) => void): this;

This comment was marked as spam.

Comment thread app/src/lib/globals.d.ts Outdated

declare namespace Electron {
interface MenuItem {
accelerator?: Electron.Accelerator;

This comment was marked as spam.

Comment thread app/src/lib/globals.d.ts Outdated

// these methods have been marked with optional parameters, where we hadn't assumed this before
interface App {
makeSingleInstance(callback: (argv: string[], workingDirectory: string) => void): void;

This comment was marked as spam.

@zeke

zeke commented May 11, 2017

Copy link
Copy Markdown
Contributor

where's the best place to report these issues upstream

https://github.com/electron/electron-typescript-definitions/issues

walking through the samples and cross-referencing the API docs that need to be updated

👍

@zeke

zeke commented May 11, 2017

Copy link
Copy Markdown
Contributor

Hey @shiftkey can you give this a try and let me know if you're still seeing any errors?

cd electron/electron
git checkout master
git pull
npm run create-typescript-definitions
cp out/electron.d.ts ~/desktop/destkop/node_modules/electron

@shiftkey

Copy link
Copy Markdown
Member Author

@zeke with that declaration the compilation here passes 🤘

@joshaber joshaber modified the milestone: M5: Post-Beta Bougie May 12, 2017
@zeke

zeke commented May 12, 2017

Copy link
Copy Markdown
Contributor

with that declaration the compilation here passes

Glad to hear it.

I want to reproduce the failures you're seeing in desktop, but when I yarn the only tsc errors I see are from @types/whatwg-fetch and typescript/lib/lib.es6.d.ts. Here's the full stack trace: https://gist.github.com/zeke/b950a02fb76f42a0248e7ce229c4dd7f

What steps can I take in desktop/desktop to repro?

@shiftkey

Copy link
Copy Markdown
Member Author

@zeke you might need to npm prune as @types/whatwg-fetch is no longer needed. I think that's the root cause of the clash.

@zeke

zeke commented May 16, 2017

Copy link
Copy Markdown
Contributor

electron/electron#9484 backports the electron.d.ts fixes to the 1.6 release line. This new version should be released today or tomorrow. Will keep you posted.

@kevinsawicki

Copy link
Copy Markdown
Contributor

This new version should be released today or tomorrow. Will keep you posted.

1.6.10 is now out and the only changes from 1.6.9 are doc fixes for the typescript definition file.

@shiftkey

Copy link
Copy Markdown
Member Author

@zeke @kevinsawicki I opened electron/typescript-definitions#54 to track a case that wasn't supported with the old definitions that I'd hoped was fixed. But we can workaround that for now rather than wait another week.

@shiftkey
shiftkey force-pushed the bump-to-electron-1-6-9 branch from 0e582ec to 83a2581 Compare May 17, 2017 02:24
@shiftkey shiftkey changed the title update Electron to 1.6.9 update Electron to 1.6.10 May 17, 2017
@shiftkey

shiftkey commented May 18, 2017 •

Copy link
Copy Markdown
Member Author

Looks like something affects the unit tests task (this happens after the tests have all passed, blocking the unit tests from completing and thus the integration tests):

And of course the stack trace isn't helpful at all:

Uncaught Exception:
Error: EBUSY: resource busy or locked, unlink 'C:\Users\shiftkey\AppData\Local\Temp\electron-mocha-sAm1bh\databases\Databases.db'
    at Object.fs.unlinkSync (fs.js:1007:18)
    at rimrafSync (C:\Users\shiftkey\Documents\GitHub\desktop\node_modules\electron-mocha\node_modules\fs-extra\lib\remove\rimraf.js:256:15)
    at C:\Users\shiftkey\Documents\GitHub\desktop\node_modules\electron-mocha\node_modules\fs-extra\lib\remove\rimraf.js:298:5
    at Array.forEach (native)
    at rmkidsSync (C:\Users\shiftkey\Documents\GitHub\desktop\node_modules\electron-mocha\node_modules\fs-extra\lib\remove\rimraf.js:297:26)
    at rmdirSync (C:\Users\shiftkey\Documents\GitHub\desktop\node_modules\electron-mocha\node_modules\fs-extra\lib\remove\rimraf.js:289:7)
    at rimrafSync (C:\Users\shiftkey\Documents\GitHub\desktop\node_modules\electron-mocha\node_modules\fs-extra\lib\remove\rimraf.js:254:7)
    at C:\Users\shiftkey\Documents\GitHub\desktop\node_modules\electron-mocha\node_modules\fs-extra\lib\remove\rimraf.js:298:5
    at Array.forEach (native)
    at rmkidsSync (C:\Users\shiftkey\Documents\GitHub\desktop\node_modules\electron-mocha\node_modules\fs-extra\lib\remove\rimraf.js:297:26)

@joshaber

Copy link
Copy Markdown
Contributor

I opened a PR on electron-mocha that should fix this: jprichardson/electron-mocha#105

@joshaber

Copy link
Copy Markdown
Contributor

After updating electron-mocha, CI is passing on Appveyor: #1996

@shiftkey shiftkey changed the title update Electron to 1.6.10 update Electron to 1.6.11 Jun 14, 2017
@shiftkey

Copy link
Copy Markdown
Member Author

So close to passing CI for both platforms, this issue has returned and I'm trying to remember how we fixed this last time:

@shiftkey shiftkey mentioned this pull request Jun 19, 2017
3 tasks done
@shiftkey shiftkey added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jun 20, 2017
function getAccelerator(menuItem: Electron.MenuItem): string | null {
if (menuItem.accelerator) {
return menuItem.accelerator
return menuItem.accelerator as string

This comment was marked as spam.

@shiftkey

Copy link
Copy Markdown
Member Author

Ready for review 🔴

@joshaber joshaber self-assigned this Jun 20, 2017

@joshaber joshaber left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for slogging through this @shiftkey 💖

@joshaber
joshaber merged commit ea919dd into master Jun 20, 2017
@joshaber
joshaber deleted the bump-to-electron-1-6-9 branch June 20, 2017 17:19
@zeke

zeke commented Jun 20, 2017

Copy link
Copy Markdown
Contributor

🎉

@zeke

zeke commented Jun 20, 2017

Copy link
Copy Markdown
Contributor

@shiftkey can you distill this upgrade experience into a few words? Wondering if there's anything the Electron team can do to make these migrations easier for others.

@shiftkey

Copy link
Copy Markdown
Member Author

@zeke most of the pain was around the differences in type declarations. A resource for migrating from the existing @types/electron would probably help, even though the list of breaking changes is small currently:

  • IpcRendererEvent and IpcMainEvent -> IpcMessageEvent
  • MenuItemOptions -> MenuItemConstructorOptions

There's still these customizations that should live upstream somewhere (whether in electron or in @types/node), as you shouldn't need to carry these around between projects.

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

Labels

ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants