Deprecate generator transforms?
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 重构
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript
- 领域
- tooling
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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:
-
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.
-
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!
-
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.
- 主要语言
- JavaScript
- 星标
- 1k
- 派生
- 87
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
observablehq/stdlib 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 48/100
observablehq/stdlib#397 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 20/100
observablehq/stdlib#384 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
observablehq/stdlib#379 · 1 条评论 ·
-
enhancement
难度 3/5 1-2 天 新手友好度 35/100
observablehq/stdlib#378 · 2 条评论 · 2 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 35/100
observablehq/stdlib#371 ·
查看 observablehq/stdlib 的全部 Issue
相似的 Issue
-
🔧 in development
难度 2/5 1-3 小时 新手友好度 72/100
-
enhancement good first issue help wanted
难度 2/5 1-3 小时 新手友好度 85/100
-
p5.js 2.0+
难度 2/5 1-3 小时 新手友好度 62/100
processing/p5.js#9295 · 1 条评论 ·
维护者通常 3 天内回复
-
status: needs triage
难度 2/5 1-3 小时 新手友好度 78/100
mastra-ai/mastra#27210 · 1 条评论 ·
维护者通常 1 天内回复
-
content html
难度 2/5 1-3 小时 新手友好度 82/100