Skip to content
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

Update notebook messaging APIs in webview #122944

Closed
connor4312 opened this issue May 4, 2021 · 2 comments
Closed

Update notebook messaging APIs in webview #122944

connor4312 opened this issue May 4, 2021 · 2 comments
Assignees
Labels
debt Code quality issues notebook
Milestone

Comments

@connor4312
Copy link
Member

connor4312 commented May 4, 2021

  • Remove messaging APIs from the renderer. These didn't work/didn't work well and we have directed authors to use kernel preloads for communication.
  • Add an event and an event available as globals in the kernel for them to communicate:
declare global {
    const onDidReceiveKernelMessage: VSCodeEvent<any>;
    function postKernelMessage(data: unknown): void;
}
  • Preloads can reference this by (update @types/vscode-notebook-renderer and then) adding "types": ["@types/vscode-notebook-renderer/preload"] to their tsconfig.json
  • Breaking: removed the generic postMessage handler -- extensions should use postKernelMessage instead.
@connor4312 connor4312 added debt Code quality issues notebook labels May 4, 2021
@connor4312 connor4312 added this to the May 2021 milestone May 4, 2021
@connor4312 connor4312 self-assigned this May 4, 2021
@connor4312 connor4312 changed the title Update notebook messaging APIs Update notebook messaging APIs in webview May 4, 2021
connor4312 added a commit to connor4312/DefinitelyTyped that referenced this issue May 4, 2021
@connor4312 connor4312 reopened this May 4, 2021
connor4312 added a commit that referenced this issue May 4, 2021
typescript-bot pushed a commit to DefinitelyTyped/DefinitelyTyped that referenced this issue May 4, 2021
…d type by @connor4312

* vscode-notebook-renderer: update to separate preload type

Fixes microsoft/vscode#122944

* rm unnecessary OTHER_FILES

* remove no-longer-necessary id pass to acquireNotebookRendererApi

* update test
@connor4312
Copy link
Member Author

Also, while I was there -- with our new way of dealing with preloads, we no longer need to have extensions pass their ID when calling the acquire API. We already know it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues notebook
Projects
None yet
Development

No branches or pull requests

2 participants
@connor4312 and others