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
Add support for node-redis v4.0.0 and newer #8425
Conversation
I'm realizing approach that could be done here is to force |
What are the downsides of this aggressive approach? Does it bring any user-facing issues? If no, we can simplify user experience. |
@pleerock I see there being at least four possible ways to fix this:
I'm happy to adjust this PR to move from implementation approach 1 to approach 2 if you believe that approach to be superior. I don't believe it would impact users directly and would remove the need for them to pass |
3a4474b
to
09122aa
Compare
I've updated the code to obviate the need for a client to pass |
09122aa
to
d06571f
Compare
- Fixes typeorm#8420 - v4.0.0 and newer of node-redis will no longer auto-connect, so we need to add that step - For backwards compatibility, we check for the existence of a "v4" property so we don't try to call `connect` on older versions of the client - A `legacyMode` flag exists in the new v4.0.0 of node-redis to keep a similar calling style without having to change any code - Note that the legacyMode flag is **required** to be passed if the calling code isn't going to be changed
d06571f
to
887776a
Compare
@pleerock I've done my local testing and checked that:
Please let me know if there's anything else you need in regard to this PR. |
Thank you for contribution! 🎉 |
@pleerock I need to update |
connect
on older versions of the clientlegacyMode
flag exists in the new v4.0.0 of node-redis to keep a similar calling style without having to change any codeDescription of change
Pull-Request Checklist
master
branchnpm run lint
passes with this changenpm run test
passes with this changeFixes #0000