Skip to content

Commit d4f5ee8

Browse files
author
Orta Therox
authored
Merge pull request #2008 from microsoft/note_use_define_change
Adds a note in the 4.3 release notes for the useDefineForClassFields default change
2 parents 5704587 + ede3cf4 commit d4f5ee8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/documentation/copy/en/release-notes/TypeScript 4.3.md

+6
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,12 @@ This is discussed [in some detail here](https://github.com/microsoft/TypeScript-
774774
775775
https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/991
776776
777+
### `useDefineForClassFields` now defaults to true on `esnext` and eventually on `es2022`
778+
779+
In 2021 the class fields feature was added into the JavaScript specification with behavior which differed from how TypeScript had implemented it. In preparation for this, in TypeScript 3.7, a flag was added ([`useDefineForClassFields`](https://www.typescriptlang.org/tsconfig#useDefineForClassFields)) to migrate to emitted JavaScript to match the JavaScript standard behavior.
780+
781+
Now that the feature is in JavaScript we are changing the default to `true` for ES2022 and above, including ESNext.
782+
777783
### Errors on Always-Truthy Promise Checks
778784
779785
Under `strictNullChecks`, using a `Promise` that always appears to be defined within a condition check is now considered an error.

0 commit comments

Comments
 (0)