jquery-date-range-picker icon indicating copy to clipboard operation
jquery-date-range-picker copied to clipboard

Add dependencies as peer-dependencies

Open derwaldgeist opened this issue 8 years ago • 3 comments

I am using the date range picker in combination with MeteorJS and other packages that are incompatible with jQuery 3.x. In older versions of Meteor, I was able to suppress that the date-range-picker includes its own jQuery version, using bower, and this just worked fine. But as Meteor has moved to full npm compatibility, the dependency on jQuery 3 causes Meteor to overwrite its standard jQuery version 1.1 with jQuery 3, which breaks my other packages. Would it be possible to define the dependency as a peer dependency instead?

derwaldgeist avatar Jul 12 '17 15:07 derwaldgeist

How would you suggest to do that? Personally I am not very familiar with "peer dependencies"...

holtkamp avatar Jul 29 '17 09:07 holtkamp

AFAIK, it is enough if you define the dependency in the "peerDependencies" section. In this case, npm will not install jquery automatically along with your plugin, but instead require the user to do so. And in some circumstances, like the scenario mentioned above, this will avoid that jquery will be installed twice. As it is now, the only chance I had was to copy your code to a private repository to avoid duplicate jquery installations.

Here's a description with more details: https://nodejs.org/en/blog/npm/peer-dependencies/

derwaldgeist avatar Jul 29 '17 09:07 derwaldgeist

Aah, ok, that seems ok to me, please provide a Pull Request with this suggestion 👍

holtkamp avatar Jul 30 '17 16:07 holtkamp