Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Deprecate generator transforms?

Abierto
#32 0 comentarios 1 reacción 0 asignados Ver en GitHub

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
Refactorización
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
javascript
Área
tooling

Línea de trabajo

Start with the Generators.filter and Generators.map entries linked from the README, then inspect their iterator and promise behavior against the three concerns described. Done requires a maintainer decision on deprecation versus redesign and a clearly scoped follow-up, since the issue does not select an implementation path.

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

Descripción

question

We currently provide two utility methods for creating a new Generator from an iterator: Generators.filter and Generators.map. There are a few problems with these methods:

  1. If the input iterator is a Generator, the returned Generator does not wrap generator.return and generator.throw. Possibly, these methods should return an Iterator rather than a Generator, and be moved to Iterators.filter and Iterators.map. Or, these methods could “upgrade” an iterator to a generator, and wrap the return and throw methods as expected.

  2. If the input iterator iterates over promises, the generator doesn’t wait for the promise to resolve. Coming from Observable, we somewhat expect the test or transform functions to be passed resolved values rather than Promise objects. However, in the case of Generators.filter, it’s not clear how that should work, since the test function might return false for the last promise, but it’s too late because the generator has already yielded a promise!

  3. If the input iterator is an async iterator (i.e., iterator.next returns a Promise), these methods don’t work at all.

It’s possible that the simplest thing to do would be to deprecate these methods along with the deprecated DOM methods #31. I haven’t found them especially useful, and given the desire to keep the standard library small, it might be good to prune them.

Lenguaje dominante
JavaScript
Estrellas
1k
Forks
87
Métricas de merge de PR
Sin PR fusionados en 30 d

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 observablehq/stdlib

Todos los issues de observablehq/stdlib

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.