-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugins relying on module hijacking won't load. #2866
Conversation
Add missing reference to `onUnload` invocation during [plugin updates](https://github.com/zeit/hyper/blob/2.0.4/app/plugins.js#L111).
This reverts commit 57166a5.
* Replaced timestamp server * Added different server
so that plugins can load.
Thank you so much to have analyzed this issue. I have no problem to have some copy/paste and some duplicate code. But 2 things should be improved:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some improvements are needed
Ok, I will work on it, when I have some free time. I did base this PR against master, since it felt more like a hotfix to me, but I can still base it against canary, if you want to. |
Yes please, every PR should target canary wand will be eventually cherry-picked to master if it can't wait for a normal release cicle: canary -> master |
15c44fe
to
35d50eb
Compare
@chabou please review again |
Or maybe @Stanzilla ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Sorry for the delay |
I'll test it ASAP |
Nice work @tjwelde! |
Hi @tjwelde , Commenting the code for |
Hmm, yes you're right. React is placed in the root So, we either add What do you say @chabou ? |
I can't imagine a case where a plugin needs Any case, splitting plugins is not an option, imo. |
I tried that before, but unfortunately it breaks the plugin at the loading stage. |
Ok, I reproduced, and this is due to I think that we don't have to hijack |
I tried your proposed solution, but it doesn't work after running |
Regression was introduced by vercel#2866. Release version of Hyper failed to start. Requiring react(-dom) in main process makes no sense.
Regression was introduced by #2866. Release version of Hyper failed to start.
Fixes some plugin loading (like hyperline)
Regression was introduced by #2866. Release version of Hyper failed to start.
While investigating, why hyperline doesn't work in hyper2, I found out, that the main process requires the plugin too. Unfortunately it doesn't hijack common modules, as the renderer does, so it fails.
So, with this PR modules loading is also hijacked on the main process, so that plugins can load.
Problems I see:
all return just Object here, because they can not just be required, since they work differently on the main process, than on the renderer. I don't really know, how to solve this, or even if solving that would be needed.
Also the
app/plugins.js
file is required from the renderer process, but returns a cached copy, so the code doesn't get executed again, but it is still smelly. Especially having the module hijacking twice in the code. Any ideas here?