-
Notifications
You must be signed in to change notification settings - Fork 441
Add BuiltinIteratorReturn to IterableIterator and AsyncIterableIterator return types #1713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
b7df2ac
Add BuiltinIteratorReturn to IterableIterator and AsyncIterableIterat…
rbuckton f4cb461
Update to use BuiltinIterator
rbuckton 13ee015
Revert package.json
rbuckton b3feaf7
Merge branch 'main' into builtiniteratorreturn
rbuckton faa9be8
Update TS to nightly
jakebailey 8245db1
Use 'BuiltinAsyncIterator' spelling
rbuckton fe02922
Temporarily use pr build for testing
rbuckton 5b83895
Bump nightly
jakebailey 80cb992
Update to match microsoft/TypeScript#59506
rbuckton 76c181c
Formatting
rbuckton b6a6718
Bump typescript
rbuckton 1864a71
Support typesVersions in @types/web et al
rbuckton b010afb
Update baseline tests to support legacy folder
rbuckton 0c19a29
Merge branch 'main' into builtiniteratorreturn
rbuckton 101623e
Accept baselines
rbuckton ee46158
Accept baselines
rbuckton f66fea8
Accept baselines
rbuckton 91e30ab
Fix autoImport
rbuckton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this, is FooAsyncIterator basically same as BarAsyncIterator, because I don't see a difference between this and ReadableStreamAsyncIterator below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They have independent prototypes on the web, so you could theoretically augment
ReadbleStreamAsyncIterator
independently via its prototype:As with
ArrayIterator
,MapIterator
,SetIterator
, etc., we've opted to use interface names that more closely align with the underlying prototype.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They have independent prototypes because the underlying iterator algorithms are different, but I wouldn't expect any independent members on them that would require separate declarations, at least not in the foreseeable future, because Web IDL simply doesn't have syntax for that and I don't see why IDL would want that.
@MattiasBuelens may have some opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but the general principle we've agreed on in microsoft/TypeScript#58243 and in design meeting is to try to give these things a relevant name.
BuiltinIterator
was too broad and confusing, andIteratorObject<T, BuiltinIteratorReturn, unknown>
was too unwieldy and verbose. Since we must give these names, we've opted to give them names that reflect the actual runtime reality.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmmm. I guess it would be fine as we don't have too many iterable interfaces here, and also matching with TS principle makes sense. I still worry that this would encourage people do weird things that doesn't fit the spec intention though.