0

With jquery very slowly being phased out you get into more and more situations where library X will run with either jquery or zepto.js (but at least one is required).

No package managers that I can think of however allow you to express dependencies like this. If I was to propose this feature to - say - bower, is there precedent for how it might look?

closed as off-topic by gnat, user40980, Kilian Foth, Dan Pichelman, Doc Brown Jan 10 '15 at 9:25

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – gnat, Community, Kilian Foth, Dan Pichelman, Doc Brown
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Seems like it would be off topic on SO as there isn't really a correct answer and its more of a general question about programming. Why do you think its off topic? – George Mauer Feb 19 '14 at 16:11
  • Better try to ask such questions on softwarerecs.stackexchange.com – Doc Brown Jan 10 '15 at 9:25
4

dpkg / APT has supported this for ages.

There are two mechanisms for this. One is alternate dependencies by simply declaring the dependency like this:

Depends: jquery | zeptojs

You will declare that the package depends on either jquery or zepto.js.

The other mechanism is Virtual Packages. A package can declare that it Provides a virtual package and then other packages can depend on that virtual package.

For example, both the jquery package and the zeptojs package can declare that they provide the jquery-api virtual package, and then your app can depend on jquery-api. This has the added advantage that if in the future a third new JQuery-compatible library appears in the market, only the author of that package has to put a Provides: jquery-api line in his package description. You don't have to change your app and it will just work with the new library.

In your app:

Depends: jquery-api

In JQuery:

Provides: jquery-api

In Zepto.JS:

Provides: jquery-api

In the brand-new yet-to-be-written awesome new JQuery replacement:

Provides: jquery-api
  • oh awesome. Thanks, glad to know the terminology for this as well. – George Mauer Feb 19 '14 at 20:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.