You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Track upstream: async_sequence parameters are emitted as invalid never<any> (e.g. ReadableStream.from) #34
Upstream added async_sequence support (whatwg/streams#1372) in src/build/emitter.ts. convertBaseType() returns "never" for an async_sequence type, with the comment "Use 'never' to signal omission in type generation". But nothing actually omits the members that use it. The emitter goes on to print the type with its subtype, which produces a declaration that doesn't parse:
We hit this when merging upstream into the fork with BCD 8 (merge commit 2931264). BCD 8 keeps ReadableStream.from, the method whose only overload takes an async_sequence.
src/build/emitter.ts drops the method overloads whose parameters use async_sequence. If no overload is left, it drops the whole method (typeUsesAsyncSequence, signatureUsesAsyncSequence, isOmittedForAsyncSequence, and the extra .filter(...) calls in emitMethod / emitMethods). The build logs Skipping generation for from since it uses async_sequence type for each skipped method.
This fix isn't specific to Baseline. It's a plain upstream bug fix and could be sent upstream as is.
Upstream status (checked 2026-11-07, upstream main @ 51e2d51)
Not fixed yet. Upstream's emitter.ts still returns "never" without omitting anything. Upstream's output doesn't show the bug yet because it's on BCD 8.0.4, which doesn't keep ReadableStream.from. It should show up when upstream updates BCD.
How to check
Does upstream src/build/emitter.ts omit members that use async_sequence, or emit them properly (for example as AsyncIterable<T> in the asynciterable variant)?
Or: on upstream main with the latest BCD, does the generated output have never< anywhere, and does ReadableStream.from come out valid?
When upstream fixes it
Take upstream's emitter.ts changes when merging, and remove our async_sequence filtering so it doesn't run twice or conflict.
If upstream emitsReadableStream.from instead of omitting it, the generated types change. Check baselines/ and every Baseline cut (npm run baseline-years), and expect a package republish.
Close this issue once the fork's async_sequence handling in emitter.ts matches upstream again.
Upstream status (checked 2026-11-30, upstream main @ f7effdf)
Fixed upstream. In 2511236 (microsoft#2557, "Bump mdn BCD to 8.0.5"), upstream replaced the "never" placeholder with real emission. convertBaseType() now returns ["AsyncIterable", "Iterable"] when includeIterable is set and ["Iterable"] otherwise. emitAsyncIterator now emits the methods that take async_sequence arguments in the asynciterable variant (hasAsyncSequenceArgument / filterMethodsBySignature). Later emitter commits (a3f7c80, ddef56e, f95b644, f7effdf) don't touch this.
Upstream's baselines/dom.generated.d.ts now contains:
Take upstream's emitter.ts changes when merging, and remove our async_sequence filtering (typeUsesAsyncSequence, signatureUsesAsyncSequence, isOmittedForAsyncSequence, and the extra .filter(...) calls) so it doesn't run twice or conflict.
Upstream emitsReadableStream.from instead of omitting it, so the generated types will change. Check baselines/ and every Baseline cut (npm run baseline-years), and expect a package republish.
Resolved by #40, which merged upstream main @ f7effdf into baseline-filter and dropped the fork's version of this fix in favour of upstream's. Closing.
Activity
uhyo commentedon Nov 30, 2026
Upstream status (checked 2026-11-30, upstream
main@ f7effdf)Fixed upstream. In 2511236 (microsoft#2557, "Bump mdn BCD to 8.0.5"), upstream replaced the
"never"placeholder with real emission.convertBaseType()now returns["AsyncIterable", "Iterable"]whenincludeIterableis set and["Iterable"]otherwise.emitAsyncIteratornow emits the methods that takeasync_sequencearguments in the asynciterable variant (hasAsyncSequenceArgument/filterMethodsBySignature). Later emitter commits (a3f7c80, ddef56e, f95b644, f7effdf) don't touch this.Upstream's
baselines/dom.generated.d.tsnow contains:and no
never<.Next steps (from "When upstream fixes it")
emitter.tschanges when merging, and remove ourasync_sequencefiltering (typeUsesAsyncSequence,signatureUsesAsyncSequence,isOmittedForAsyncSequence, and the extra.filter(...)calls) so it doesn't run twice or conflict.ReadableStream.frominstead of omitting it, so the generated types will change. Checkbaselines/and every Baseline cut (npm run baseline-years), and expect a package republish.Generated by Claude Code
uhyo commentedon Dec 1, 2026
Resolved by #40, which merged upstream
main@ f7effdf intobaseline-filterand dropped the fork's version of this fix in favour of upstream's. Closing.Generated by Claude Code