-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
How renderers handle extension code activation #130499
Comments
Maybe have some sort of global event in the window that renderers can listen for? Like 'extension-loaded' or something? |
Summary of discussion (recommended solution is Problem:
Solution 1
Solution 2
Solution 3
|
The solution 3 is always needed since currently extensions always need to create a messaging object https://github.com/microsoft/vscode/blob/main/src/vs/vscode.d.ts#L12356 to communicate with the renderers loaded in the notebook webview, since the extension code and the renderers are loaded in different processes, there is no guarantee which piece of code finish evaluation and execution first. In other words, if one wants to build a renderer which can talk to the extension part, a handshake is always required as there is no guarantee which code is ready first. |
Summary of how one renderer extension would need to do to support communication between the renderer code in webview and extension code running in the extension host code. For example, a renderer extension contributes a renderer
There is no guarantee when 2.1 or 3.2 is executed or in what sequence. We can see them as two processes and the code on each side talk to each other through |
@DonJayamanne May I know if this needs to be verified (if so add verification-needed label) or tested via test plan (if so add on-testplan label)? |
@sandy081 Sorry, the documentation needs to be udpated. Will work on that today. |
Added |
I think the only change here is to docs, and so verification steps would be to read the change and see if it makes sense. Let me know @DonJayamanne if there was any code change that should be tested. |
@roblourens thanks |
Notebook renderers are usually contributed statically through contributions in
package.json
but we also allow communication between extension code and the renderers in the webview, through webview communication API. Having the ability to talk to the extension means that the renderer code might not be able to handle output rendering without some sort of setup in the extension host side, but this would degrade the file open experience as we don't want all renderers extensions to be activated prior to ipynb file opening.To ensure a smooth file opening experience, VS Code will only wait for the serializer to be activated. This means extensions which contribute renderers will need to handle the activation/evaluation of extension code and renderer code properly.
The text was updated successfully, but these errors were encountered: