types 3.0: breaking change for event payloads

Abierto
#1,904 0 comentarios 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
20/100
Tipo de issue
Refactorización
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
typescript

Línea de trabajo

Comienza revisando las definiciones actuales de MessageEvent en el paquete @slack/types y las issues vinculadas de Bolt y node-slack-sdk. Compara cómo se usan estos tipos en Bolt y en otros lugares; después, documenta los puntos problemáticos para los desarrolladores y acuerda el alcance de los breaking changes para la versión 3.0.

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

Descripción

area:typescript enhancement pkg:types semver:major

This would be a follow-up issue to tackle once slackapi/bolt-js#1395 is addressed; slackapi/bolt-js#1395 simply adds the existing, likely lacking, types for Events API payloads to the types package. This issue would be about breaking those payloads and include that in a new 3.0 release of @slack/types.

Summary

Improvements to MessageEvent

Today, MessageEvent is a big union of different events Slack may send to apps, presumably that include some message information. Because it is a union, when using it as a type both in applications as well as frameworks (like bolt), only the common properties across all types in this union can be used. Some properties that would be expected to be present on messages are not common in this union today: text and blocks, for instance. We should study how this type is used in bolt and elsewhere, and consider a different approach to modeling message events. For example, perhaps a generics-based approach could better serve?

Another problem when working with MessageEvent in TypeScript is the fact that one member of the union, the GenericMessageEvent, has subtype: undefined. This causes major problems when trying to match against the union of all different kinds of messages, since many message subtype events have a defined string literal subtype. subtype: undefined needs to get the 🔪 .

TODO

Review Issues to Identify Pain Points

The following should be studied to determine the scope of what these breaking changes should include, in order to address developer pain points, and folded into the Summary section above in order to plan the changes:

Lenguaje dominante
TypeScript
Estrellas
3.4k
Forks
693
Merge medio
1 d 1 h
PR fusionados (30 d)
67

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 slackapi/node-slack-sdk

Todos los issues de slackapi/node-slack-sdk

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.