-
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
don't send plugin metadata over JSON-RPC #6233
Conversation
getDeployedFrontendMetadata(): Promise<PluginMetadata[]>; | ||
getDeployedBackendMetadata(): Promise<PluginMetadata[]>; | ||
getDeployedPlugins(): Promise<string[]>; | ||
getDeployedPlugin(id: string): Promise<PluginMetadata | undefined>; |
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.
IMHO it looks strange to have same method which is not returning the same object
should be getDeployedMetadata
for the second
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.
Could you elaborate please? Is it about undefined? Do you mean that a plugin cannot be undeployed in the meantime?
13212b0
to
699f8de
Compare
699f8de
to
83f7d52
Compare
83f7d52
to
b899158
Compare
Signed-off-by: Anton Kosiakov <anton.kosyakov@typefox.io>
So they are available eariler and not transfered twice to the frontend. Signed-off-by: Anton Kosiakov <anton.kosyakov@typefox.io>
b899158
to
c29d1ce
Compare
@eclipse-theia/plugin-system @svenefftinge Please have a look when you have time. With this PR, plugins loading should not block anymore. I did not have time to measure the startup time against previous state yet, will do later today or tomorrow. I did 3 important changes:
|
|
||
$init(pluginInit: PluginInitData, configStorage: ConfigStorage): PromiseLike<void>; | ||
/** initialize the manager, should be called only once */ | ||
$initiliaze(params: PluginManagerInitializeParams): Promise<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.
typo: initialize
@@ -619,11 +641,13 @@ export interface PluginDeployerHandler { | |||
} | |||
|
|||
export const HostedPluginServer = Symbol('HostedPluginServer'); | |||
/** | |||
* Don't expose plugin metadata via JSON-RPC. It is expensive to load and blocks the underlying connection. | |||
* Instead use `/plugins` http endpoint, it serves compressed metadata for the give set of plugins. |
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.
typo: .. the given set of
} | ||
|
||
reset(): void { | ||
this._initialized = new Deferred<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.
Should we also generate a new id here, just to avoid confusion with previous connections?
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 think it will be confusing if the same window will get different id on reconnect, e.g. you see that some plugin was disconnected for some client id, but then it gets immediately started for another client id without first loading it. I think it would be more consistent to see that a plugin was disconnected for such client and then started again for the same client.
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'm -1 about using separate connection for metadata.
AFAIK almost all metadata shouldn't be sent to the client. Changing the way on how to send them is not solving the root cause.
@benoitf please elaborate on your suggestion, do you mean that the plugin model should be redesigned? How? |
I will try to make an alternative version of a PR which relies on permessage-deflate or send compressed metadata over websocket. About permessage-deflate it seems that it is supported by Firefox and Chrome only, users of other browsers will have blocked UI. @benoitf please let me know what do you think about first point in #6228 (comment) I would be glad to throw away raw package.json from metadata, it is probably will reduce compressed size to less than 200kb. |
@akosyakov less than 200MB ? |
@benoitf sorry, typo 😬 it should be |
ok, better, thx |
What it does
How to test
plugins
folder:https://drive.google.com/file/d/1tuOsorMVOKi_twL9oAuZxgrD7-VUwNsj/view?usp=sharing
Review checklist
Reminder for reviewers