-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Flag Deprecation Plan #51000
Comments
While absolutely true, devil’s advocate argument is that there’s still a difference in JS today between a (non-module) file with a |
One reason I advocate for removing |
Considering the current release cycle of 3 months, I think two and a half years quite too long for this. But otherwise I'm all for deprecating stuff. 👍 |
This sounds great. Freedom to evolve is important and this plan increases it whilst decreasing tech debt (entropy). I recommend updating column 1 of the table to switch the order and say "Phase 1 (e.g. TypeScript 5.0)". Right now it looks like you are mandating 5 minors releases between each phase whereas the description that follows indicates it is only an example duration. 3.5 years (10 releases) to complete an entire deprecation cycle seems excessive. I'd suggest 2-4 releases for the full cycle would normally be fine. |
Summarizing decisions from the meeting: Queued for deprecation: Still alive: All Also still alive, for now: Possibly gone sooner?: I'm proposing that we just remove |
So instead, add a new type check error for non-module files:
|
Add a new --legacyDecorator flag and deprecates --experimentalDecorator |
This comment was marked as off-topic.
This comment was marked as off-topic.
Just my 2 cents: If it helps ship more features/bugfixes, I would vote for removement of already deprecated flags in 5.0. Additionally, I vote for faster removement of new deprecated flags. For example, not more than one year after deprecation. Or even in 2 ts releases. |
I'm still using module "amd" with requirejs in some of my old projects :/. Is that so old school ? |
* dependency update * @babel/core: 7.21.3 * @types/jest: 29.5.0 * dependency-cruiser: 12.10.1 * jsdom: 21.1.1 * rimraf: 4.4.0 * typedoc: 0.23.27 * typescript: 5.0.2 * Deprecated flag charset no longer used - see microsoft/TypeScript#51909 * deprecated attribute see: * https://www.typescriptlang.org/tsconfig#suppressImplicitAnyIndexErrors * microsoft/TypeScript#51000 * types to be explicitly considered while other types not included * new dev dependency to remove @types usage confusion during transpilation * current lock file
Yes. We have modules now so there's no reason why you would ever need this after 2015. It's just increased complexity and dead code to support something no one uses or should use. We should deprecate CJS too, it's only used in old code, doubt anyone is compiling any new code with it. |
cjs is the only one I actually learned when I studied javascript programming a couple years back. Nodejs at that time still had a few big debug frameworks that needed it. I think even they now have stable es model support. Separate tools like Babel can make the conversion if its still needed. |
WHY deprecate noImplicitUseStrict? Better question, why does TypeScript want to emit 'use strict' so badly? Pretty retarded if there's not going to be an option to turn it off. If I wanted 'use strict' in all my modules I would just add it myself. |
The setting that controls whether |
No...
I don't want to emit use strict in my files, why do you want to force it upon us so badly? |
Sorry, you're right (looks like something is wrong in the Playground wrt this) Without
We really want your code to work! |
I mean I get that part, but like, it's an option that some people use and it's been there for a very long time. I will just run another build step to strip it from all files afterwards I guess |
The stated reason was "non-strict-mode code is extremely rare in modern JS" and the longer reasoning outlined in #51909 was
|
* dependency update * @babel/core: 7.21.3 * @types/jest: 29.5.0 * dependency-cruiser: 12.10.1 * jsdom: 21.1.1 * rimraf: 4.4.0 * typedoc: 0.23.27 * typescript: 5.0.2 * Deprecated flag charset no longer used - see microsoft/TypeScript#51909 * deprecated attribute see: * https://www.typescriptlang.org/tsconfig#suppressImplicitAnyIndexErrors * microsoft/TypeScript#51000 * types to be explicitly considered while other types not included * new dev dependency to remove @types usage confusion during transpilation * current lock file
TypeScript Flag Deprecation Plan
As we think about the long-term future of TypeScript and its place in the JavaScript ecosystem, it's clear that many things TypeScript 0.8 users in 2012 needed aren't things that TypeScript users in 2024 are going to need. For example, in 2012, Internet Explorer 8 (which only supports ECMAScript 3) had enough marketshare to warrant serious compatibility concern. Today, thankfully, it doesn't.
While we still consider long-term language stability to be an absolutely paramount concern, having a well-defined deprecation policy in place also makes it easier for us to be slightly less risk-averse when adding new features to the language.
To that end, starting with TypeScript 5.0, we will begin the process of removing certain flags, features, and/or behaviors which we think the language or ecosystem have largely evolved past the need for.
Schedule
The deprecation schedule is based on our existing
version += 0.1
versioning cadence, aligned with ones-place-incrementing versions for clarity.The cycle repeats again with TypeScript 6.0 also introducing whatever new deprecation warnings deemed appropriate at that time.
Phase 1: ❔ Deprecation Warnings
In phase 1 (e.g. TypeScript 5.0), using a deprecated flags will produce a commandline error:
As hinted to in the error, you can supply a new flag value to silence this error:
All other behavior is unchanged.
This gives people an immediate warning of impending deprecation, but won't block them from upgrading to TypeScript 5.0.
Phase 2: ⚠ Flags Start Doing Nothing
In phase 2 (e.g. TypeScript 5.5), deprecated flags can still be specified in tsconfig / commandline settings, but no longer have any effect. This allows users to have
tsconfig.json
files that work on both sides of the deprecation cycle (as you might have in a monorepo with a "shared" tsconfig settings file).Phase 3: ❌ Flags Removed
In phase 3 (e.g. TypeScript 6.0), it is an error to specify a deprecated flag.
At this point, it also becomes illegal to have
ignoreDeprecations: "5.0
, since this setting doesn't do anything (it's illegal to specify those flags in the first place, and they've done nothing for 5 versions).In 6.0, the only legal value of
ignoreDeprecations
will then be"6.0"
, per its Phase 1.5.0 Deprecation Candidates
This list is provisional; please leave comments if you are depending on these in a serious way.
Removed entirely:
charset
- already deprecated since approximately the beginning of timenoImplicitUseStrict
- non-strict-mode code is extremely rare in modern JSnoStrictGenericChecks
- this flag is broadly a bad idea, and improvements to the type system have rendered its original use cases largely mootout
- already deprecated since approximately the beginning of time (useoutFile
instead)keyofStringsOnly
- according to a rumor, we only wanted to ship this for three releases (2.9, 3.0, 3.1) when we added this!suppressExcessPropertyErrors
- improvements in not performing subtype reduction have rendered its original use cases largely mootsuppressImplicitAnyIndexErrors
- the use cases here have been supplanted by better recognition of literal-typed keysnoFallthroughCasesInSwitch
- style concern; use a linter if this is not allowed in your coding styleRemoved possible values:
target
- removeES3
- no known extant software runs ES3 (this will be even more true in 2 years), and we don't havelib
support for it anywaymodule
- removeumd
,system
, andamd
- the ecosystem is rapidly converging, and better downlevelers exist for each of these should you still need them by 2024The text was updated successfully, but these errors were encountered: