Repository navigation
feat: add iterator methods to esnext - #64095
Daniel Rosenwasser (DanielRosenwasser) merged 36 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds ESNext declarations for recent iterator proposals and integrates the new library into compiler resolution and bundling.
Changes:
- Adds
chunks,join,includes,zip, andzipKeyeddeclarations. - Registers and embeds
lib.esnext.iterator.d.ts. - Adds compiler tests and updates generated baselines.
Reviewed changes
Copilot reviewed 35 out of 40 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tsc/internal/bundled/embed_generated.go |
Embeds the new iterator library. |
tsc/internal/bundled/libs/lib.esnext.d.ts |
References the iterator library. |
tsc/internal/bundled/libs/lib.esnext.iterator.d.ts |
Declares the new iterator APIs. |
tsc/internal/bundled/libs_generated.go |
Registers the bundled library name. |
tsc/internal/compiler/program_test.go |
Adds the library to ESNext test expectations. |
tsc/internal/tsoptions/enummaps.go |
Maps esnext.iterator to the new library. |
tsc/testdata/tests/cases/compiler/iteratorChunks.ts |
Tests Iterator.prototype.chunks. |
tsc/testdata/tests/cases/compiler/iteratorIncludes.ts |
Tests Iterator.prototype.includes. |
tsc/testdata/tests/cases/compiler/iteratorJoin.ts |
Tests Iterator.prototype.join. |
tsc/testdata/tests/cases/compiler/iteratorZip.ts |
Tests Iterator.zip and zipKeyed. |
tsc/testdata/baselines/reference/compiler/iteratorChunks.js |
Records chunks emit. |
tsc/testdata/baselines/reference/compiler/iteratorChunks.symbols |
Records chunks symbols. |
tsc/testdata/baselines/reference/compiler/iteratorChunks.types |
Records chunks types. |
tsc/testdata/baselines/reference/compiler/iteratorIncludes.js |
Records includes emit. |
tsc/testdata/baselines/reference/compiler/iteratorIncludes.symbols |
Records includes symbols. |
tsc/testdata/baselines/reference/compiler/iteratorIncludes.types |
Records includes types. |
tsc/testdata/baselines/reference/compiler/iteratorJoin.js |
Records join emit. |
tsc/testdata/baselines/reference/compiler/iteratorJoin.symbols |
Records join symbols. |
tsc/testdata/baselines/reference/compiler/iteratorJoin.types |
Records join types. |
tsc/testdata/baselines/reference/compiler/iteratorZip.js |
Records zip emit. |
tsc/testdata/baselines/reference/compiler/iteratorZip.symbols |
Records zip symbols. |
tsc/testdata/baselines/reference/compiler/iteratorZip.types |
Records zip types. |
tsc/testdata/baselines/reference/compiler/builtinIterator.symbols |
Updates merged iterator symbols. |
tsc/testdata/baselines/reference/compiler/builtinIterator.types |
Updates displayed iterator signatures. |
tsc/testdata/baselines/reference/compiler/libReplacement(libreplacement=true).trace.json |
Records replacement lookup for the new library. |
tsc/testdata/baselines/reference/conformance/awaitUsingDeclarationsWithIteratorObject.symbols |
Updates merged iterator symbols. |
tsc/testdata/baselines/reference/conformance/awaitUsingDeclarationsWithIteratorObject.types |
Updates displayed iterator signatures. |
tsc/testdata/baselines/reference/conformance/usingDeclarationsWithIteratorObject.symbols |
Updates merged iterator symbols. |
tsc/testdata/baselines/reference/conformance/usingDeclarationsWithIteratorObject.types |
Updates displayed iterator signatures. |
tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option-value.js |
Updates valid-library diagnostics. |
tsc/testdata/baselines/reference/tsc/commandLine/help-all.js |
Updates library help output. |
tsc/testdata/baselines/reference/tsc/commandLine/help.js |
Updates library help output. |
tsc/testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-cannot-provide-terminal-width.js |
Updates library help output. |
tsc/testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js |
Updates wrapped library help output. |
tsc/testdata/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent-with---ignoreConfig.js |
Updates library help output. |
tsc/testdata/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent.js |
Updates library help output. |
tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-incorrect-compiler-option-value.js |
Updates valid-library diagnostics. |
tsc/testdata/baselines/reference/tscWatch/commandLine/Parse-watch-interval-option-without-tsconfig.json.js |
Updates library help output. |
tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-handles-tsconfig-deleted.js |
Updates watched help output. |
tsc/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js |
Updates valid-library diagnostics. |
Files not reviewed (3)
- tsc/internal/bundled/embed_generated.go: Generated file
- tsc/internal/bundled/libs_generated.go: Generated file
- tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option-value.js: Generated file
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Daniel Rosenwasser (DanielRosenwasser)
left a comment
There was a problem hiding this comment.
I don't know if you need to add a bunch more overloads yet, but I think there are a few places that can be simplified for now.
There was a problem hiding this comment.
🟡 Changes recommended
The empty-object zipKeyed case has an incorrect element type and lacks coverage.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Files not reviewed (3)
- tsc/internal/bundled/embed_generated.go: Generated file
- tsc/internal/bundled/libs_generated.go: Generated file
- tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option-value.js: Generated file
- Files reviewed: 38/44 changed files
- Comments generated: 0 new
- Review effort level: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
The declarations accept guaranteed-throw primitive inputs, reject valid undefined-valued keyed inputs, and incompletely validate union inputs.
Review details
Files not reviewed (3)
- tsc/internal/bundled/embed_generated.go: Generated file
- tsc/internal/bundled/libs_generated.go: Generated file
- tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option-value.js: Generated file
- Files reviewed: 38/44 changed files
- Comments generated: 0 new
- Review effort level: Balanced
…into feat/63700
Fixes #63700