Need Migration Notices When v3 Code Detected

Abierto
#1,762 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
node.js, typescript
Área
api, backend

Línea de trabajo

Comienza revisando el punto de entrada createClient() y los métodos dependientes de la conexión tratados en el issue, comparando el comportamiento de v3 y v4 descrito allí. Identifica qué llamadas con estilo v3 se pueden detectar de forma fiable y define el comportamiento de advertencia o error; se considerará terminado cuando las notificaciones de migración cubran los casos comunes acordados y se hayan verificado con respecto al uso de v3 indicado.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
TypeScript
Estrellas
17.6k
Forks
2k
Merge medio
1 d 22 h
PR fusionados (30 d)
62

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de redis/node-redis

Todos los issues de redis/node-redis

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.