daniv-msft
daniv-msft

Reputation: 33

Is there a standard way to release preview features in VS Code extensions?

My team is developing a Visual Studio Code extension, and we're considering to release some of our new features as preview/beta only shown to a limited number of users.

We can think of ways to do it manually, but were wondering if Visual Studio Code provides any "standard" way to release such preview features, in a similar way as what is done for Visual Studio Code Insiders.

Is there a standard way to release preview features in VS Code extensions?

Upvotes: 3

Views: 1878

Answers (2)

Mark
Mark

Reputation: 181359

In vscode 1.63 an enhanced ability to preview pre-release extensions has been added, see release notes: pre-release extensions.

As VS Code now allows extensions to offer pre-releases, you can opt-in to install them and use the latest cutting edge features from extensions. VS Code shows an additional Install Pre-Release Version option in the extension Install drop-down menu for installing the pre-release version of the extension.

pre-release extension menu

Once installed, the following indicators make it clear if you are using the pre-release version of an extension:

pre-release extension identification

If there is a pre-release version of an extension that you have already installed you can easily switch to it:

switch to a pre-release version


To publish a pre-release version, see release notes: publish pre-release extension versions.

Publishing Pre-Release Extensions

VS Code now supports extension authors to publish pre-releases for their extensions through vsce by passing --pre-release flag. You can now make your latest features available to users who chose to install pre-releases and get early feedback before the official extension release.

vsce publish --pre-release

VS Code Marketplace only support major.minor.patch for extension versions and semver pre-release tags are not supported. Support for this will arrive in the future. Because of this we recommend that extensions use major.EVEN_NUMBER.patch for release versions and major.ODD_NUMBER.patch for pre-release versions. For example: 0.2.* for release and 0.3.* for pre-release. VS Code will auto update extensions to the highest version available, so even if a user opted into a pre-release version and there is an extension release with a higher version, that user will be updated to the released version.

More information about pre-release extensions can be found in the Pre-Release Extensions topic.

Upvotes: 2

Gama11
Gama11

Reputation: 34148

No, I don't think there's a standard way of doing this, which leads to different extensions taking different approaches:

  • The C# extension requires you to uninstall the marketplace / release version. Then you need to manually download the .vsix file for the beta release from GitHub and install the extension from that. It looks like the Go extension is taking the same approach.
  • Other extensions have two different versions published in the marketplace, such as PowerShell and PowerShell Preview. The latter has a preview badge in the marketplace by specifying "preview": true in package.json:

    This approach also requires manually uninstalling or disabling the original extension before you can use the preview version.

  • Finally, some extensions include experimental features in regular marketplace releases, but lock them behind a setting so users can opt-in. There's some risk of breaking non-experimental functionality this way if things aren't tested well.

There's also an open feature request with a pretty lengthy discussion on this topic, so there might be an official solution someday:

Upvotes: 1

Related Questions