With transitive dependencies, it would be nice to have dependencies be optional. Consider: https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html
CC @davidfowl @lodejard
I don't think this is high priority (possibly not even needed). Moving to backlog for now, if you feel differently please let me know
I'm not sure it's quite the same thing, but here it goes anyway;
Pulling in Microsoft.Framework.Configuration, as an example, doesn't provide much value by itself.
In order to add configuration sources, you need at least _one_ of the following packages:
Currently, there's nothing telling the user that this is the case, and you have to either figure it out through trial and error, or consult documentation/code.
In this case, it's pretty easy to see that these packages are closely related and they'd most likely end up in the same search result, but there is a _huge_ discoverability problem for 3rd party NuGet packages today; If I had made an awesome package called AwesomeConfiguration.Toml, it'd be pretty hard to discover it and know that it would add TOML support to your ASP.NET 5 apps. Is the solution to "mimic" the Microsoft packages and name it Microsoft.Framework.Configuration.Toml?
It would be super nice if NuGet had either
The NuGet UI/command line could then simply list the optional dependencies and prompt the user if they wanted to install them together with the main package.
I can think of lots and lots of use cases for this and I think it would open up some awesome discoverability scenarios and benefit the community as a whole.
Does this make sense?
And speaking of discoverability, are there plans to introduce search by dependencies? That would also make it easier to discover packages, i.e. search for packages that depends on Microsoft.Framework.Configuration.
:+1: for @khellang's suggestion.
I second the notion put forward by @khellang
@khellang his does seem unrelated, but also very interesting. Not sure a package could/would declare optional dependencies for this purpose this seems opposite. It still seems like a valuable discovery mechanism. Could you please file a separate issue with this suggestion? Also an issue for search separately.
On the server side we are currently focused on scalability and stability when this push is over we plan to work on search improvements again, so this is a good time to hash this idea.
:+1:
Trying to bring back the discussion from OP @csharpfritz, it would be nice to have a way to declare optional dependencies, limiting optional dependency version ranges. There are many use cases that justify having optional dependencies.
Its present in other build and package managers like maven and npm. Would it be possible to bump the priority on this one?
Any info on why this was closed @rohit21agrawal ?
@jorgebay Couple of reasons - we are closing bugs that have not been active for over a year, and two, this doesn鈥檛 fit in with the plans we have for NuGet in the near future.
You can open a new issue if you have a strong case for this feature and we would consider it.
Debian calls those Suggests
(or maybe Recommends
?) and Enhances
, FWIW: https://www.debian.org/doc/debian-policy/ch-relationships.html#binary-dependencies-depends-recommends-suggests-enhances-pre-depends
Most helpful comment
I'm not sure it's quite the same thing, but here it goes anyway;
Pulling in Microsoft.Framework.Configuration, as an example, doesn't provide much value by itself.
In order to add configuration sources, you need at least _one_ of the following packages:
Currently, there's nothing telling the user that this is the case, and you have to either figure it out through trial and error, or consult documentation/code.
In this case, it's pretty easy to see that these packages are closely related and they'd most likely end up in the same search result, but there is a _huge_ discoverability problem for 3rd party NuGet packages today; If I had made an awesome package called AwesomeConfiguration.Toml, it'd be pretty hard to discover it and know that it would add TOML support to your ASP.NET 5 apps. Is the solution to "mimic" the Microsoft packages and name it Microsoft.Framework.Configuration.Toml?
It would be super nice if NuGet had either
The NuGet UI/command line could then simply list the optional dependencies and prompt the user if they wanted to install them together with the main package.
I can think of lots and lots of use cases for this and I think it would open up some awesome discoverability scenarios and benefit the community as a whole.
Does this make sense?