hzdg / react-imageloader

A React component for wrangling image loading

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-loadermixin needs to be a regular dependency, not devDependency

Pomax opened this issue · comments

commented

react, react-loadermixin and xtend are required by the imageloader code, and should be normal dependencies, rather than devDependencies.

Hmm, well xtend is a dependency, while both react and react-loadermixin are peer dependencies. What specific problem have you run in to? I don't think we can make react a hard dependency, since multiple versions of react cannot co-exist (see this also) in the same app.

commented

For react, that's true, good point. But, for react-loadermixin, I don't think it is. By its very nature people are already going to have react installed, but loadermixin is super specific and none of the React projects I'm working on/with at the moment make use of it, only your mixin, so "npm install react-imageloader" yields a "broken" mixin without manually installing a mixin that serves no purpose other than to make yours work. I'd still recommend moving the loadermixin to the regular dependency list, instead.

Interesting. AFAIK npm should auto-install peer dependencies if they are missing (at least, until 3.x is released). Is it possible you're running an edge version of npm?

commented

hm, deleted node_modules, pruned package.json, reran it, and you're right: it installed just fine. I guess that means this can be closed, sorry to bother and thanks for the reponse!

👍 thanks for providing the sanity check! We may still have to do something when the next version of npm is released, since peer dependencies will stop auto-installing then…