Need Migration Notices When v3 Code Detected

オープン
#1,762 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
node.js, typescript
領域
api, backend

調査の方向性

まず createClient() のエントリポイントと、issue で議論されている接続依存のメソッドを確認し、そこで説明されている v3 と v4 の動作を比較します。v3 スタイルの呼び出しのうち、確実に検出できるものを特定し、警告またはエラーの動作を定義します。合意した一般的なケースを移行通知がカバーし、報告された v3 の使用状況に対して検証できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Bug stale

New user of node-redis, I was following the abundant documentation and examples across the 'net, including https://docs.redis.com/latest/rs/references/client_references/client_nodejs/ Unfortunately, nearly all documentation is for v3, which caused hours of lost time. Of particular note to me, the fact that clientConnect() no longer automatically connects made the code fail invisibly.

I finally found this repo, and realized that the problem was that I was using a very-new version of node-redis. I'm excited to explore this version in the future - at this time, it looks like an improvement on the previous design! (I'm especially excited to able to use await.)

However, we need clear messages which will warn users that they are using deprecated code. One simple example would be the host parameter, which can be passed to createClient(); if a user is passing that parameter, then it almost certainly means that they are using code that expects v3. An explicit error message would be very useful, and save your potential users hours of frustration. (It also lowers a barrier to entry for people just exploring the library, and thus prevents driving away potential future users.)

I know that many of the examples online (and thus, I presume many of your users) pass no parameters to createClient(), so the host parameter, while useful, is incomplete. Unfortunately, I'm too much of a newbie at this library to suggest where other warnings might be useful, but hopefully you can suggest some. Are there any commonly-used methods which are not sensible to call until the client has called connect()? That might be a good way to detect v3-expectant code.

Environment:

  • Node.js Version: v10.19.0
  • Node Redis Version: 4.0.0, reverted to 3.1.2
  • Platform: Ubuntu Docker Container
主要言語
TypeScript
スター
17.6k
フォーク
2k
平均マージ
1日 22時間
マージ済み PR(30日)
62

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

redis/node-redis のほかの issue

redis/node-redis の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。