Skip to content

Support Platform Specific Extensions #23251

Closed

Description

@windyGex

I can't find answer from stack overflow, so I open a issue.

Activity

  1. changed the title [-]Any hooks can be executed after VSIX package installed?[/-] [+]Extension post-install hooks[/+] on Mar 27, 2017
  2. auchenberg commented on Jul 18, 2018

    @auchenberg
    Contributor

    In your extension activation callback, you are free to check and download extensions as soon as the extension get's activated. This is how Live Share is downloading their dependencies after installation

    export async function activate(context: vscode.ExtensionContext) {
      /// 1 Check if deps are installed
     await downloadDependencies()
     // Update status bar or output channel to give an indicator of status
    }
    
  3. windyGex commented on Jul 19, 2018

    @windyGex
    Author

    If install dependencies when extension activate, I think it' too later and it maybe cost a long time.

  4. sandy081 commented on Nov 20, 2018

    @sandy081
    Member

    Idea is to provide a post install hook similar to uninstall hook. This will be executed after an extension is installed or updated.

    "scripts": {
        "vscode:prepublish": "tsc -p ./",
    	"vscode:install": "node ./out/src/extensionInstall"
        "vscode:uninstall": "node ./out/src/extensionUninstall"
    },

    An extension can install necessary libraries and stuff using this post install script. An unique location per extension is provided through an env variable for the extension to maintain any state. The same location will also be passed with post uninstall script.

  5. DonJayamanne commented on Nov 20, 2018

    @DonJayamanne
    Contributor

    Idea is to provide a post install hook similar to uninstall hook. This will be executed after an extension is installed or updated.

    I would prefer a better name. Today vscode:prepublish applies to developer of the extension, i.e. to extension authors. Having vscode: install would indicate it's related to extension authors again and not in end user machines.

  6. rchande commented on Nov 20, 2018

    @rchande

    Sandeep Somavarapu (@sandy081) Thanks for pointing this feature out to us on the C# extension. Our dependency downloading story is actually a little complicated. Each version of the extension ships with built in URLs to specific versions of binary dependencies, and, if the user has no options set, we'll download them on first run. However, we allow users to control what version of our dependencies they download. You can see this in action by playing with the option "omnisharp.path". If you:

    • Set it to latest: When the extension starts, it will check online to determine the latest version of OmniSharp, download it if we haven't downloaded it before, and start that version. Each new version gets downloaded to its own folder.
    • Set it to a specific version number: When starting OmniSharp, the extension will attempt to start it from a directory based on the version you specified. If it's not available, it will try to download it using a well known version -> url mapping.

    Basically, we need to be able to access our "unique location per extension" after install-time to read and write values. Would the new API support that?

  7. gregg-miskelly commented on Nov 21, 2018

    @gregg-miskelly
    Member

    Sandeep Somavarapu (@sandy081) In addition to what Ravi said, I would first off like to say a thanks. I have been wanting this feature for so long. So I am very excited to see it happening!

    Two other notes --

    1. I am not sure what kind of UI interactions you are expecting to allow between the post install script and VS Code, but we would need to somehow inform the user of progress since downloads can be somewhat large, at least for users with very slow internet connections.
    2. I would expect the most common action that an extension to want to do would be to install dependencies. However, with proxy servers, downloading files is not that easy of a task to get right. It would be great if there was some sort of 'DownloadFile' API or 'vscode-DownloadFile' npm package that was provided to extensions that would handle this task in the same way that VS Code does. In case it matters, as Ravi said, I think we would want some of our downloads to continue to go to the per-extension-version directory (because they change with essentially every version), while some of our downloads are stable enough that we might want to share them. So we would need to be able to specify the destination directory in such a way that either place could be targeted.

    Here is the C# extension "download dependencies" code as a reference:

  8. 89 remaining items

  9. jakebailey commented on Sep 16, 2021

    @jakebailey
    Member

    I would also think it would be a good idea to offer up a "generic" platform that's a fallback if you haven't published the right one. I don't think it's good for extensions to have to keep track of every platform VS Code could support (present and future) and ensure they publish versions for each of them. There's always the case that a new platform (say, darwin arm64) appears, then some older extension can no longer be used because it won't be installed unless you have the platform available.

    But, I know this (and the insiders versioning) is sort of limited by what the marketplace can do.

  10. isidorn commented on Sep 16, 2021

    @isidorn

    Jake Bailey (@jakebailey) this is a good suggestion, however we are a bit limited due to marketplace support.
    We should keep this in mind and potentially improve later, but this is not in the cards for the near future.

  11. gregg-miskelly commented on Sep 16, 2021

    @gregg-miskelly
    Member
    1. Current limit per platform package is 200mb. This is not set in stone, we can increase if we hear from you it is needed.

    Thanks. For the C# extension, have one platform (darwin-arm64) where we are fairly close to the limit -- 198425276 bytes (189.2 MB) in my quick test. I can do some experiments to see if we can reduce this a bit. But we have have an ask to raise this slightly.

  12. isidorn commented on Sep 17, 2021

    @isidorn

    Gregg Miskelly (@gregg-miskelly) ok, so it seems like we are good for now but I have notified the Marketplace that we would like to increase the size limit. Once they do that I will let you know.

  13. isidorn commented on Sep 24, 2021

    @isidorn

    As I mentioned above
    We now support the full flow for platform specific extensions 🚀
    This document has all the details:
    https://code.visualstudio.com/api/working-with-extensions/publishing-extension#platformspecific-extensions

    Thus I am closing this issue. If there are questions feel free to ask, we will continue monitoring this issue even though it is closed. Thank you very much 👏

  14. felipecrs commented on Oct 12, 2021

    @felipecrs
    Contributor

    Just a question, because I didn't understand, was the thing about having to release different versions for non-platform specific and platform specific extensions solved?

    I.e. can I release a amd64 and a non-platform specific .vsix targetting the same version?

  15. isidorn commented on Oct 12, 2021

    @isidorn

    Felipe Santos (@felipecrs) yes you can, but you need to publish your amd64 vsix for amd64, and your general one for each other platform. This is an issue to help make this flow smoother microsoft/vscode-vsce#625

  16. felipecrs commented on Oct 12, 2021

    @felipecrs
    Contributor
  17. valentjn commented on Oct 14, 2021

    @valentjn

    Isidor Nikolic (@isidorn) When Marketplace increases the size limit, is this announced in this issue or in another? Or is this documented somewhere? I can't find the info about the 200MB anywhere else than here (the previous limit of 100MB is also hard to find, it's buried in some old release notes of VS Code).

    Whether it's 200MB or say 250MB or 300MB makes a big difference for my extension with respect to migrating to platform-specific extensions, but I don't know a way of finding out the current limit other than trying to publish and see what happens. Obviously, at that point, a lot of effort has been invested, in vain if the limit is lower than expected.

  18. prashantvc commented on Oct 14, 2021

    @prashantvc
    Contributor

    Julian Valentin (@valentjn) The size limit is not documented anywhere. Right now, we have 200MB limit, however we allow larger extension on need bases.

  19. felipecrs commented on Oct 22, 2021

    @felipecrs
    Contributor

    PS: I opened an issue to VS Marketplace to support generic platform, so that extension authors would not need to manage their own list of all platforms.

    microsoft/vsmarketplace#219

  20. locked and limited conversation to collaborators on Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

extensionsIssues concerning extensionsfeature-requestRequest for new features or functionalitymarketplaceMicrosoft VS Code Marketplace issueson-release-notesIssue/pull request mentioned in release noteson-testplan

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions