-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Deprecate downlevelIteration #63071
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
base: main
Are you sure you want to change the base?
Deprecate downlevelIteration #63071
Conversation
|
@typescript-bot test top400 |
|
Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page. Also, please make sure @DanielRosenwasser and @RyanCavanaugh are aware of the changes, just as a heads up. |
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.
Pull request overview
Deprecates the --downlevelIteration compiler option for TypeScript 6.0 (planned to stop functioning in 7.0), emitting a deprecation diagnostic unless silenced via ignoreDeprecations.
Changes:
- Emit a deprecation diagnostic when
downlevelIterationis enabled. - Mark
downlevelIterationas@deprecatedin the publicCompilerOptionsAPI surface. - Update test harness + baselines to account for the new deprecation error output.
Reviewed changes
Copilot reviewed 59 out of 60 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/compiler/program.ts | Adds a deprecation diagnostic when downlevelIteration is enabled. |
| src/compiler/types.ts | Marks downlevelIteration as @deprecated in CompilerOptions. |
| src/harness/evaluatorImpl.ts | Sets ignoreDeprecations: "6.0" by default to prevent evaluator-based unit tests from failing on new deprecation errors. |
| tests/baselines/reference/api/typescript.d.ts | Updates API baseline to include /** @deprecated */ on downlevelIteration. |
| tests/baselines/reference/sourceMapValidationVarInDownLevelGenerator.types | Updates type baseline output impacted by new option diagnostics. |
| tests/baselines/reference/sourceMapValidationVarInDownLevelGenerator.errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/restParameterInDownlevelGenerator(target=es5).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/restParameterInDownlevelGenerator(target=es2015).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/forAwaitPerIterationBindingDownlevel(target=es5).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/forAwaitPerIterationBindingDownlevel(target=es2015).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es5).errors.txt | Updates baseline to include new TS5101 deprecation diagnostic. |
| tests/baselines/reference/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt | Updates baseline to include new TS5101 deprecation diagnostic. |
| tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es5).types | Updates type baseline output impacted by new option diagnostics. |
| tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es5).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).types | Updates type baseline output impacted by new option diagnostics. |
| tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/emptyAssignmentPatterns04_ES5iterable(target=es5).types | Updates type baseline output impacted by new option diagnostics. |
| tests/baselines/reference/emptyAssignmentPatterns04_ES5iterable(target=es5).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/emptyAssignmentPatterns04_ES5iterable(target=es2015).types | Updates type baseline output impacted by new option diagnostics. |
| tests/baselines/reference/emptyAssignmentPatterns04_ES5iterable(target=es2015).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/emptyAssignmentPatterns03_ES5iterable(target=es5).types | Updates type baseline output impacted by new option diagnostics. |
| tests/baselines/reference/emptyAssignmentPatterns03_ES5iterable(target=es5).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/emptyAssignmentPatterns03_ES5iterable(target=es2015).types | Updates type baseline output impacted by new option diagnostics. |
| tests/baselines/reference/emptyAssignmentPatterns03_ES5iterable(target=es2015).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/emptyAssignmentPatterns02_ES5iterable(target=es5).types | Updates type baseline output impacted by new option diagnostics. |
| tests/baselines/reference/emptyAssignmentPatterns02_ES5iterable(target=es5).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/emptyAssignmentPatterns02_ES5iterable(target=es2015).types | Updates type baseline output impacted by new option diagnostics. |
| tests/baselines/reference/emptyAssignmentPatterns02_ES5iterable(target=es2015).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/emptyAssignmentPatterns01_ES5iterable(target=es5).types | Updates type baseline output impacted by new option diagnostics. |
| tests/baselines/reference/emptyAssignmentPatterns01_ES5iterable(target=es5).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/emptyAssignmentPatterns01_ES5iterable(target=es2015).types | Updates type baseline output impacted by new option diagnostics. |
| tests/baselines/reference/emptyAssignmentPatterns01_ES5iterable(target=es2015).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/destructuringParameterDeclaration7ES5iterable(target=es5).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/destructuringParameterDeclaration7ES5iterable(target=es2015).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/destructuringParameterDeclaration3ES5iterable(target=es5).errors.txt | Updates baseline to include new TS5101 deprecation diagnostic. |
| tests/baselines/reference/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt | Updates baseline to include new TS5101 deprecation diagnostic. |
| tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.errors.txt | Updates baseline to include new TS5101 deprecation diagnostic. |
| tests/baselines/reference/destructuringArrayBindingPatternAndAssignment4(target=es5).errors.txt | Updates baseline to include new TS5101 deprecation diagnostic. |
| tests/baselines/reference/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt | Updates baseline to include new TS5101 deprecation diagnostic. |
| tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt | Updates baseline to include new TS5101 deprecation diagnostic. |
| tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es5).types | Updates type baseline output impacted by new option diagnostics. |
| tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es5).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es2015).types | Updates type baseline output impacted by new option diagnostics. |
| tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es2015).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/asyncArrowFunction11_es5(target=es5).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/asyncArrowFunction11_es5(target=es2015).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/arrayLiteralSpreadES5iterable.errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/ES5For-of37(target=es5).types | Updates type baseline output impacted by new option diagnostics. |
| tests/baselines/reference/ES5For-of37(target=es5).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/ES5For-of37(target=es2015).types | Updates type baseline output impacted by new option diagnostics. |
| tests/baselines/reference/ES5For-of37(target=es2015).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/ES5For-of36(target=es5).errors.txt | Updates baseline to include new TS5101 deprecation diagnostic. |
| tests/baselines/reference/ES5For-of36(target=es2015).errors.txt | Updates baseline to include new TS5101 deprecation diagnostic. |
| tests/baselines/reference/ES5For-of35(target=es5).errors.txt | Updates baseline to include new TS5101 deprecation diagnostic. |
| tests/baselines/reference/ES5For-of35(target=es2015).errors.txt | Updates baseline to include new TS5101 deprecation diagnostic. |
| tests/baselines/reference/ES5For-of34(target=es5).errors.txt | Updates baseline to include new TS5101 deprecation diagnostic. |
| tests/baselines/reference/ES5For-of34(target=es2015).errors.txt | Updates baseline to include new TS5101 deprecation diagnostic. |
| tests/baselines/reference/ES5For-of33(target=es5).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
| tests/baselines/reference/ES5For-of33(target=es2015).errors.txt | Adds baseline for new TS5101 deprecation diagnostic. |
|
@jakebailey Here are the results of running the top 400 repos with tsc comparing Something interesting changed - please have a look. Details
|
|
I wonder if it's worth deprecating specifically. If you're extending from a common tsconfig (e.g. Zod here), then the problem is more about any package that compiles with ES5, not with the current project. |
|
Ryan and I talked about this just now, and this is already true about any and all deprecated options, even more used ones. You can do This option just feels bad because it technically does nothing. |
1e31acc to
af91582
Compare
For #62196
This flag does nothing if your target is ES2015+
TS 7.0 shouldn't have this flag because we won't support target below ES2015. Deprecate it now, though it is a shame we never had an error that said "don't set this, it doesn't do anything for you".