-
Notifications
You must be signed in to change notification settings - Fork 2.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
reload plugins on reconnect #6159
Conversation
10f41f1
to
2a653b5
Compare
9ef894e
to
e8d8233
Compare
@akosyakov do you think custom APIs should also be treated to allow unload? |
ce9e771
to
85be868
Compare
@amiramw Custom main services should implement |
@eclipse-theia/eclipse-theia I'm still trying different extensions to check reload of all contributions, but the code should be in final state and help with testing is welcomed! |
0f57270
to
bfe4bb5
Compare
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.
The code looks great. Will now test.
} | ||
this.locals.set(identifier.id, instance); | ||
if (Disposable.is(instance)) { | ||
this.toDispose.push(instance); |
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.
It is a little strange that the dispose lifecycle of the passed in arguments get associated with this object. I see that the usages always pass fresh objects here. So maybe not a real problem.
In general we should follow the pattern 'who creates is responsible for disposing'
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.
i actually thought that set
should be replaced by a contribution point, something like PluginRPCService
, then contributions will be created by RPCProtocol
and installed, but first we need to refactor the plugin system to use DI.
Works great as well! I noticed that after disconnecting and reconnecting again, there is an additional reconnection.
but I think you mentioned that once to me and it is also unrelated to this PR as it happens without the change, too. With this PR this at least doesn't have such a bad side effect anymore. 🎉 |
bfe4bb5
to
c980100
Compare
c980100
to
50beaee
Compare
merging if the build is green |
@@ -163,7 +163,7 @@ export const emptyPlugin: Plugin = { | |||
}; | |||
|
|||
export interface PluginManagerExt { | |||
$stopPlugin(contextPath: string): PromiseLike<void>; | |||
$stop(pluginId?: string): PromiseLike<void>; |
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.
why break the name of this method ?
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.
Because it does not do what it means: It does not stop one plugin but all plugins. contextPath
is unused, changing contextPath
to optional pluginId
to stop either one plugin or all was already a breaking change. I could introduce another method, but then stopPlugin
won't be used anywhere in the Theia repo. I did not see a reason why to keep an unused method.
@@ -80,16 +80,6 @@ export class PluginHostRPC { | |||
} | |||
} | |||
|
|||
/* |
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.
Hello, why stopContext has been removed ? it's also not referenced in changelog ?
plugin-host-rpc is quite sensitive as it's used downstream like Eclipse Che.
Also I don't see it related to the changes of this PR
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.
There were a clean up of plugin unloading that they can be uninstalled and unused clients of refactored code were removed. Code which should be used in a downstream project should be moved to a corresponding project, not kept in the Theia repo without any internal clients and ability to test by any committer.
There is a record that this PR breaks the plugin system. So far we were not listing individual changes only notified that some part will be broken in next release by some PRs, since we did not really document anything as APIs. Please raise it at the dev meeting if you suggest that each a change to each function should be listed.
Please review a PR while it is not merged, not afterwards. It was 9 days while it was in draft mode for the design review. Committers are not expected to review and test PRs against downstream projects or wait when someone does it.
Please also opened follow-up issues to already merged PRs. Not many committers read comments on them and it can get lost.
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.
If you're considering that removing code or changing structural behavior is only requiring one approval from a committer of the same company, I think something is wrong.
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.
Please add to discuss to the dev meeting.
Regarding to
Code which should be used in a downstream project should be moved to a corresponding project, not kept in the Theia repo without any internal clients and ability to test by any committer.
I remembered that we don't have something like DI in the plugin host process yet, not sure whether you can actually extend it. If not please let me know, the new issue will be the best.
What it does
Out of scope:
How to test
Hints:
Tested with following VS Code extensions:
asWebviewUri
apiReconnecting tree views
Review checklist
Reminder for reviewers