Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension Pack - Optionally loading extension dependencies #48873

Closed
akaroml opened this issue Apr 28, 2018 · 11 comments
Closed

Extension Pack - Optionally loading extension dependencies #48873

akaroml opened this issue Apr 28, 2018 · 11 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) extensions Issues concerning extensions under-discussion Issue is under discussion for relevance, priority, approach

Comments

@akaroml
Copy link
Member

akaroml commented Apr 28, 2018

An extension pack itself is also an extension which can have some code logic. When a pack is activated as an extension, all the extensions listed in the extensionDependencies are automatically activated. This behavior may not be ideal because the pack's role is to install several extensions together but not necessarily load them all at the same time when the pack is loaded.

The documentation also echos that:
https://code.visualstudio.com/docs/extensionAPI/extension-manifest#_extension-packs
The extensions listed in extensionDependencies will be installed. But there is no clear statement of lifecycle, e.g. extension dependencies being activated whenever the pack extension is activated.

Here to request that vscode provide a mechanism of optionally activating these dependencies. Here's one scenario to consider:

  1. The pack extension tries to show a welcome page of the packed extensions.
  2. The pack extension needs to be loaded to show the welcome page, WITHOUT loading the dependency extensions.
  3. When some logic on the welcome page is triggerred, e.g. creating a new project, the pack then call a command from a specific extension, and this is when the extension is activated.
@vscodebot
Copy link

vscodebot bot commented Apr 28, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@sandy081
Copy link
Member

sandy081 commented May 2, 2018

@akaroml What is the activation event for the pack?

@akaroml
Copy link
Member Author

akaroml commented May 10, 2018

@sandy081 the pack is activated when a command is triggered.

@sandy081
Copy link
Member

@alexandrudima May I know if activating an extension also activates its dependencies?

@alexdima
Copy link
Member

If an extension A mentions extension B as an extensionDependency, then it is guaranteed that extension B is installed and activated (correctly) before activating A.

If B is not installed or if B fails to activate, then A will not be activated.

I understand extension packs make use of extensionDependency, but the guarantee above is in our system since before we had extension packs and we cannot remove or relax it. I suggest extension packs use a different mechanism than extensionDependency if the intent is just to install another extension.

@sandy081 sandy081 added the under-discussion Issue is under discussion for relevance, priority, approach label May 15, 2018
@akaroml
Copy link
Member Author

akaroml commented May 22, 2018

@alexandrudima thanks for the info. So does vscode have a mechanism to achieve what you described? That behavior is exactly what we want. I see lots of extension packs use extensionDependency as the underlying mechanism and I'm not aware of other choices.

@sandy081
Copy link
Member

@akaroml Only supported mechanism to define extensions in an extension pack is by extensionDependency

@akaroml
Copy link
Member Author

akaroml commented May 24, 2018

@sandy081 thanks for the confirmation.

Then I would like to ask for a mechanism to allow installation-only extension dependency. This will be super useful for the extension pack scenario. Most packs' purpose is to recommend extension combinations and they do not necessarily need to have runtime dependency on those extensions.

I'd like to borrow the concept of peer dependency from npm but give it a new name peerExtensions. An extension would only work when all the peer extensions are installed.

@chrisdias
Copy link
Member

isn't this then a dupe of #48430?

@sandy081
Copy link
Member

Yes. it is.

@sandy081 sandy081 added the *duplicate Issue identified as a duplicate of another issue(s) label Jun 20, 2018
@vscodebot
Copy link

vscodebot bot commented Jun 20, 2018

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Jun 20, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) extensions Issues concerning extensions under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

4 participants