bayleeadamoss / zazu

:rocket: A fully extensible and open source launcher for hackers, creators and dabblers.
http://zazuapp.org
MIT License
2.09k stars 169 forks source link

Zazu 0.6.0 #341

Closed linonetwo closed 5 years ago

linonetwo commented 5 years ago

Latest electron contains Node version > 6, which can better supports some plugin (for example plugin that uses Wasm from sql.js)

Tested locally, functional properly, but seems lagging in dev build.

linonetwo commented 5 years ago

After this is merged, I'm going to fix some other issues.

But it becomes very slow after upgrade electron that many tests failed, I have to look into it.

linonetwo commented 5 years ago
屏幕快照 2019-05-13 下午9 11 12 屏幕快照 2019-05-13 下午9 32 31

Logging is very slow in electron5, even before I upgrade winston.

And it's all on globalEmitter.emit('pluginLog'

屏幕快照 2019-05-13 下午9 34 50
linonetwo commented 5 years ago

It's blazing fast because I only log when the debugger is opened.

But tests still failed, I'm confused.

linonetwo commented 5 years ago

Good, seems only some plugin regression remains.

I will look into it next weekend. It's hard to debug, since I can't run tests locally due to https://github.com/octalmage/robotjs/issues/483 . Considering replace robotjs with something actively maintained.

linonetwo commented 5 years ago

After upgrading cucumber, all test passed in Windows and Linux.

Reason for OSX failed maybe that spectron is still on electron 3 https://github.com/electron/spectron/issues/358

And the reason of slow maybe https://github.com/catdad/raw-viewer/issues/142 May need to change the usage of fs to adapt sandbox https://electronjs.org/blog/electron-5-0#automatic-modules-with-sandboxed-webcontents

linonetwo commented 5 years ago

The reason why mac test fail is here https://github.com/garimpeiro-it/node-key-sender/issues/25

win.blur() triggered by key-sender.

linonetwo commented 5 years ago

Now it pass all the test locally:

> cucumber-js --format ./features/support/custom_formattor.js

..................................................................................................................................................

17 scenarios (17 passed)
112 steps (112 passed)
5m30.139s
linonetwo commented 5 years ago

Fixing some plugin related regressions:

  1. some plugin on the first install will error: required('zazu.json') returns undefine, since that file doesn't exist yet
  2. some plugin with depDependendies and optionalDependies are slow to install
  3. can't active browser https://github.com/electron/electron/issues/18293

And dev dependencies:

  1. gulp doesn't support node 12
  2. babel latest is 7
linonetwo commented 5 years ago

After upgrading babel, seems can't directly require js files outside of app in the renderer process.

So I've changed all require('/user/xxx/pluginpath') to electron.remote.require('/user/xxx/pluginpath'). This fixes all the failing tests.

And I did not properly ignore node_modules in @babel/register, but it just worked in mac, but not in windows, so took me a lot of time to debug, until I use a virtual machine to see what actually happened.

leejoramo-d51 commented 5 years ago

@linonetwo so glad you picked this project up!

linonetwo commented 5 years ago

Reviewers don't have enough bandwidth for this recently, so I upload an upgraded version to baiducloud, only MacOS version:

https://pan.baidu.com/s/1aoScfago0PuGKJQtKYZEHQ password: krdd

And many plugins won't get an update recently, due to the lack of reviewer for PR. So I forked some of them and made them compatible for v0.6.0, here is my config file:

https://gist.github.com/linonetwo/c67997a192fd32df1211be5756c563e6