Skip to content

Deprecating previewHtml #62630

@mjbvz

Description

@mjbvz

Problem

The vscode.previewHtml command has been deprecated since the introduction of the webview API. The webview API is significantly easier to work with, correctly supports different filesystem setups, and webviews also offer many security benefits over htmlPreviews. For these reasons, we would like all extensions to switch over the using the webview API and eventually remove the vscode.previewHtml command entirely.

Plan

There are a number of consumers of this API currently, including many extensions that have not been updated in some time. Our goal is to:

  • Prevent new extensions from using previewHtml.
  • Alert existing extension authors to the need to upgrade.
  • Eventually remove previewHtml after the impact on end users has been minimized.

Actions for November 2018:

  • Add notification in VS Code that alerts developers that are using previewHtml. This error would show up when a user is running a development version of an extension in vscode and the previewHtml command is invoked

  • Open issues against existing users of previewHtml (by scanning repos of popular extensions)

  • (Maybe) Update vscode.d.ts to treat vscode.commands.executeCommand('vscode.previewHtml', ....) as a compile warning / error?

Longer term actions

Aggressively targeting March/April for removal. Quick sketch of deprecation process after November:

  1. Start showing users messages if they are using an extension that uses htmlPreview (Jan/Feb update?)

  2. Remove the ability to call vscode.previewHtml for recently published extensions. (Jan / Feb update)

  3. Then remove vscode.previewHtml entirely. ( March / April)

Metadata

Metadata

Assignees

Labels

apiengineeringVS Code - Build / issue tracking / etc.verification-neededVerification of issue is requestedverifiedVerification succeededwebviewWebview issues

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions