mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 09:08:53 +01:00
This removes the initial notebook renderer API and keeps the 'pure' renderer API described in #102644 and hacked-in previously. Remaining work in this area, in no particular order: - Add messaging context to postMessage as requested by Don (API proposal TBA) - Cleanups around how state is managed internally in the backLayerWebView - Deprecate the renderer `viewType` in favor of calling it the `id` or `rendererId` Q: I kept around some of the "transform" functions since the mime type picking happens there, not sure if there's a better place for this to happen now, or whether these methods should simply be renamed.
22 lines
732 B
JavaScript
22 lines
732 B
JavaScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
const vscode = acquireVsCodeApi();
|
|
|
|
vscode.postMessage({
|
|
type: 'custom_renderer_initialize',
|
|
payload: {
|
|
firstMessage: true
|
|
}
|
|
});
|
|
|
|
const notebook = acquireNotebookRendererApi('notebookCoreTestRenderer');
|
|
|
|
notebook.onDidCreateOutput(({ element, mimeType }) => {
|
|
const div = document.createElement('div');
|
|
div.innerText = `Hello ${mimeType}!`;
|
|
element.appendChild(div);
|
|
});
|