cssho / vscode-svgviewer

SVG Viewer for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=cssho.vscode-svgviewer
MIT License
67 stars 20 forks source link

Feedback on VS Code's proposed webview API #39

Closed mjbvz closed 5 years ago

mjbvz commented 6 years ago

I'm on the VS Code team and am investigating adding a new API for managing webviews. As your extension already is using webviews through the html preview, I'd like your feedback on our proposal.

You can find the first cut of new api here. It supersedes TextDocumentContentProvider and will hopefully make creating and working with webviews easier. It also adds a few important security improvements that will better protect users even if a webview accidentally allows untrusted content injection.

To try the new API:

  1. Add "enableProposedApi": true to your package.json
  2. Manually download vscode.proposed.d.ts and add it to your project: https://raw.githubusercontent.com/Microsoft/vscode/master/src/vs/vscode.proposed.d.ts
  3. Run your extension with the latest VS Code insiders build

VS Code's markdown preview is already using this new API. We're still iterating on the API so the specifics may change. https://github.com/Microsoft/vscode/issues/43713 tracks this work on our side

Please take a look at the new webview API and let me know if you have any questions or suggestions.