4 ms·
From the installation: Note: Using npm to install the Standards will include jQuery version 2.2.0. Please make sure that you’re not including any other version
by pfooti 10y ago
From the installation: Note: Using npm to install the Standards will include jQuery version 2.2.0. Please make sure that you’re not including any other version of jQuery on your page.
Isn't that pretty much precisely what peer dependencies are for?
- bjacobel 10y agopeerDependencies were deprecated as of NPM 3.
- pfooti 10y agoThey're not exactly deprecated, they just don't install automatically anymore. As I read it (and use them in npm 3), they're a way to specify "you need this other library installed also" without actually installing it. In a lot of cases ("we just need some flavor of jQuery 2"), of which I am not sure that this us-web thing is an example, it's handy. The thing you're distributing isn't standalone, it's a thing people will use in an environment that has some installed jquery already, so you're fine. The way I see it, if you're using a library that you can specify very permissively, peer dependencies are quite handy, and in this particular case seem useful - I'm building some webapp, I need to know that my UI library wants jquery to work, but I have a choice of not necessarily using that part (probably used for DOM manipulation, so if I'm just npm installing it for the CSS, wev), or making sure I meet the dependency with the other stuff I'm using. If not installed by default is a problem, there's an npm-install-peers package that does that.