-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
peerDependencies to optionalDependencies (package.json) #280
Conversation
optionalDependencies dont spill a bunch of warnings on the screen. I use ioredis and it's reminding me to always install redis and redis-mock. https://yarnpkg.com/lang/en/docs/dependency-types/ optionalDependencies Optional dependencies are just that: optional. If they fail to install, Yarn will still say the install process was successful. This is useful for dependencies that won’t necessarily work on every machine and you have a fallback plan in case they are not installed (e.g. Watchman).
Yep, that makes sense to me, I suppose this library technically doesn't require any dependencies, but won't do a whole lot with a Redis client 🤣 |
With
What fallback do you mean? Connect-redis will not work if I will not provide any client in init function. |
@silentroach - why a thumbs down?? Before this module would default to redis. Lets say I wanted to use ioredis instead. I would have to keep the redis package installed in my repository. Now, you can just keep the ioredis package installed and remove the redis package. Only one client required, no extra fat! |
I know, but I don't want them both to be installed |
Only install the redis client you're going to use. If another one is also installed, remove it. Basically, you should have redis or ioredis. |
@silentroach - wait, this just hit me, lol. ummm, dependencies should be completely removed. Is that what you meant? lol, time for another pull request! |
Crap! okay. What about removing dependencies altogether? @wavded - oopsy, looks like I made a booboo! |
I think |
Sure, right now that sounds like the better option. |
|
But at the same time, we're moving forward in time, who's still using super old dependencies? I think it's better those who do receive a console error. |
@wavded - seems that I completely misunderstood how optionalDependencies works. Currently, when users install connect-redis, all defined packages, in this case three (ioredis, redis, redis-mock) are included as well. :-( Even setting peerDependencies reminds the user of these three packages, every time they install or upgrade, which also appears to be incorrect, right? Would the best option be to simply remove dependencies? |
Thanks for the report @silentroach, yes @knoxcard seems the best course of action is to remove it from the dependencies all together. Of course it will exist in |
Yes, major thanks to @silentroach for reporting that! This repo is downloaded 130,000+ times per week, All of those unnecessary downloads would have continued, until someone else pointed that out. |
optionalDependencies dont spill a bunch of warnings on the screen. I use ioredis and it's reminding me to always install redis and redis-mock. https://yarnpkg.com/lang/en/docs/dependency-types/ optionalDependencies Optional dependencies are just that: optional. If they fail to install, Yarn will still say the install process was successful. This is useful for dependencies that won’t necessarily work on every machine and you have a fallback plan in case they are not installed (e.g. Watchman). PR: tj/connect-redis#280
optionalDependencies dont spill a bunch of warnings on the screen. I use ioredis and it's reminding me to always install redis and redis-mock. every time I run yarn upgrade --latest.
optionalDependencies
Optional dependencies are just that: optional. If they fail to install, Yarn will still say the install process was successful.This is useful for dependencies that won’t necessarily work on every machine and you have a fallback plan in case they are not installed (e.g. Watchman).
https://yarnpkg.com/lang/en/docs/dependency-types/