From ae7fc7db0f3e58da21c0d14792f3c95ab01a2b0b Mon Sep 17 00:00:00 2001 From: Yevgeny Iliyn Date: Sun, 18 Feb 2024 12:40:20 +0400 Subject: [PATCH 01/17] Fix typo in TypeScript 2.2.md --- packages/documentation/copy/en/release-notes/TypeScript 2.2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/documentation/copy/en/release-notes/TypeScript 2.2.md b/packages/documentation/copy/en/release-notes/TypeScript 2.2.md index a12689f4910a..e7961ae3b0ef 100644 --- a/packages/documentation/copy/en/release-notes/TypeScript 2.2.md +++ b/packages/documentation/copy/en/release-notes/TypeScript 2.2.md @@ -162,7 +162,7 @@ TypeScript 2.2 improves checking of nullable operands in expressions. Specifical - If the operand of a `+`, `-`, `~`, `++`, or `--` unary operator is nullable. An operand is considered nullable if the type of the operand is `null` or `undefined` or a union type that includes `null` or `undefined`. -Note that the union type case only only occurs in [`strictNullChecks`](/tsconfig#strictNullChecks) mode because `null` and `undefined` disappear from unions in classic type checking mode. +Note that the union type case only occurs in [`strictNullChecks`](/tsconfig#strictNullChecks) mode because `null` and `undefined` disappear from unions in classic type checking mode. ## Dotted property for types with string index signatures From ff2b6e5e647e768791ef6756c52ff62cac86ebe7 Mon Sep 17 00:00:00 2001 From: Yevgeny Iliyn Date: Sun, 18 Feb 2024 13:29:41 +0400 Subject: [PATCH 02/17] Fix typo in TypeScript 1.4.md --- packages/documentation/copy/en/release-notes/TypeScript 1.4.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/documentation/copy/en/release-notes/TypeScript 1.4.md b/packages/documentation/copy/en/release-notes/TypeScript 1.4.md index f06d7f712a22..5b62953f6639 100644 --- a/packages/documentation/copy/en/release-notes/TypeScript 1.4.md +++ b/packages/documentation/copy/en/release-notes/TypeScript 1.4.md @@ -237,7 +237,7 @@ This is now the default for MSBuild projects; this allows MSBuild incremental bu ## AMD Module names -By default AMD modules are generated anonymous. This can lead to problems when other tools are used to process the resulting modules like a bundlers (e.g. `r.js`). +By default AMD modules are generated anonymous. This can lead to problems when other tools are used to process the resulting modules like bundlers (e.g. `r.js`). The new `amd-module name` tag allows passing an optional module name to the compiler: From f8d1882106a51910ac1de5e667434217146ce706 Mon Sep 17 00:00:00 2001 From: Yevgeny Iliyn Date: Sun, 18 Feb 2024 13:36:27 +0400 Subject: [PATCH 03/17] Fix typo in TypeScript 1.5.md --- .../documentation/copy/en/release-notes/TypeScript 1.5.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/documentation/copy/en/release-notes/TypeScript 1.5.md b/packages/documentation/copy/en/release-notes/TypeScript 1.5.md index b2eef46f75f4..a6fe55897789 100644 --- a/packages/documentation/copy/en/release-notes/TypeScript 1.5.md +++ b/packages/documentation/copy/en/release-notes/TypeScript 1.5.md @@ -292,7 +292,7 @@ TypeScript will emit the string in ES3/ES5 as `"\uD842\uDFB7"`. ## Tagged template strings in ES3/ES5 In TypeScript 1.4, we added support for template strings for all targets, and tagged templates for just ES6. -Thanks to some considerable work done by [@ivogabe](https://github.com/ivogabe), we bridged the gap for for tagged templates in ES3 and ES5. +Thanks to some considerable work done by [@ivogabe](https://github.com/ivogabe), we bridged the gap for tagged templates in ES3 and ES5. When targeting ES3/ES5, the following code @@ -320,7 +320,7 @@ var _a; ## AMD-dependency optional names -`/// ` informs the compiler about a non-TS module dependency that needs to be injected in the resulting module's require call; +`/// ` informs the compiler about a non-TS module dependency that needs to be injected in the resulting module's required call; however, there was no way to consume this module in the TS code. The new `amd-dependency name` property allows passing an optional name for an amd-dependency: @@ -380,7 +380,7 @@ Now if a new file `FolderA\3.ts` is added to the input, the output structure wil The TypeScript compiler emits a few helpers like `__extends` when needed. The helpers are emitted in every file they are referenced in. -If you want to consolidate all helpers in one place, or override the default behavior, use [`noEmitHelpers`](/tsconfig#noEmitHelpers) to instructs the compiler not to emit them. +If you want to consolidate all helpers in one place, or override the default behavior, use [`noEmitHelpers`](/tsconfig#noEmitHelpers) to instruct the compiler not to emit them. ## `--newLine` command line option @@ -389,5 +389,5 @@ By default the output new line character is `\r\n` on Windows based systems and ## `--inlineSourceMap` and `inlineSources` command line options -[`inlineSourceMap`](/tsconfig#inlineSourceMap) causes source map files to be written inline in the generated `.js` files instead of in a independent `.js.map` file. +[`inlineSourceMap`](/tsconfig#inlineSourceMap) causes source map files to be written inline in the generated `.js` files instead of in an independent `.js.map` file. [`inlineSources`](/tsconfig#inlineSources) allows for additionally inlining the source `.ts` file into the `.js` file. From 23944b486b5051eac7b03026454dae6162a65988 Mon Sep 17 00:00:00 2001 From: Yevgeny Iliyn Date: Sun, 18 Feb 2024 13:42:39 +0400 Subject: [PATCH 04/17] Fix typo in TypeScript 1.8.md --- .../documentation/copy/en/release-notes/TypeScript 1.8.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/documentation/copy/en/release-notes/TypeScript 1.8.md b/packages/documentation/copy/en/release-notes/TypeScript 1.8.md index 4451aa28f918..b3c0fd18bc20 100644 --- a/packages/documentation/copy/en/release-notes/TypeScript 1.8.md +++ b/packages/documentation/copy/en/release-notes/TypeScript 1.8.md @@ -150,7 +150,7 @@ const Greeter = ({ name = "world" }) =>
Hello, {name}!
; let example = ; ``` -For this feature and simplified props, be sure to be use the [latest version of react.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts). +For this feature and simplified props, be sure to use the [latest version of react.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts). ## Simplified `props` type management in React @@ -351,7 +351,7 @@ define("a", ["require", "exports", "lib/b"], function (require, exports, B) { ## Support for `default` import interop with SystemJS -Module loaders like SystemJS wrap CommonJS modules and expose then as a `default` ES6 import. This makes it impossible to share the definition files between the SystemJS and CommonJS implementation of the module as the module shape looks different based on the loader. +Module loaders like SystemJS wrap CommonJS modules and expose them as a `default` ES6 import. This makes it impossible to share the definition files between the SystemJS and CommonJS implementation of the module as the module shape looks different based on the loader. Setting the new compiler flag [`allowSyntheticDefaultImports`](/tsconfig#allowSyntheticDefaultImports) indicates that the module loader performs some kind of synthetic default import member creation not indicated in the imported .ts or .d.ts. The compiler will infer the existence of a `default` export that has the shape of the entire module itself. @@ -524,7 +524,7 @@ Also, a nightly NuGet package to match the [nightly npm package](http://blogs.ms We understand that a ton of monochrome output can be a little difficult on the eyes. Colors can help discern where a message starts and ends, and these visual clues are important when error output gets overwhelming. -By just passing the [`pretty`](/tsconfig#pretty) command line option, TypeScript gives more colorful output with context about where things are going wrong. +By just passing the [`pretty`](/tsconfig#pretty) command line option, TypeScript gives a more colorful output with context about where things are going wrong. ![Showing off pretty error messages in ConEmu](https://raw.githubusercontent.com/wiki/Microsoft/TypeScript/images/new-in-typescript/pretty01.png) From 0c4b564bdb1182f2a20fc9867177d9996c738e32 Mon Sep 17 00:00:00 2001 From: Yevgeny Iliyn Date: Sun, 18 Feb 2024 13:46:34 +0400 Subject: [PATCH 05/17] Fix typo in TypeScript 2.0.md --- .../copy/en/release-notes/TypeScript 2.0.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/documentation/copy/en/release-notes/TypeScript 2.0.md b/packages/documentation/copy/en/release-notes/TypeScript 2.0.md index 349cde6db6b3..e2455d658cb5 100644 --- a/packages/documentation/copy/en/release-notes/TypeScript 2.0.md +++ b/packages/documentation/copy/en/release-notes/TypeScript 2.0.md @@ -103,7 +103,7 @@ The effects on subject variable types accurately reflect JavaScript semantics (e ## Dotted names in type guards Type guards previously only supported checking local variables and parameters. -Type guards now support checking "dotted names" consisting of a variable or parameter name followed one or more property accesses. +Type guards now support checking "dotted names" consisting of a variable or parameter name followed by one or more property accesses. ##### Example @@ -478,7 +478,7 @@ A new flag is also added in TypeScript 2.0 to flag all uses of `this` in functio Glob support is here!! Glob support has been [one of the most requested features](https://github.com/Microsoft/TypeScript/issues/1927). -Glob-like file patterns are supported two properties [`include`](/tsconfig#include) and [`exclude`](/tsconfig#exclude). +Glob-like file patterns are supported by two properties [`include`](/tsconfig#include) and [`exclude`](/tsconfig#exclude). ##### Example @@ -562,7 +562,7 @@ For instance, an import to a module `"jquery"` would be translated at runtime to } ``` -Using [`paths`](/tsconfig#paths) also allow for more sophisticated mappings including multiple fall back locations. +Using [`paths`](/tsconfig#paths) also allows for more sophisticated mappings including multiple fall back locations. Consider a project configuration where only some modules are available in one location, and the rest are in another. ## Virtual Directories with `rootDirs` @@ -627,7 +627,7 @@ x(y); ## Wildcard character in module names -Importing none-code resources using module loaders extension (e.g. [AMD](https://github.com/amdjs/amdjs-api/blob/master/LoaderPlugins.md) or [SystemJS](https://github.com/systemjs/systemjs/blob/main/docs/module-types.md)) has not been easy before; +Importing non-code resources using module loaders extension (e.g. [AMD](https://github.com/amdjs/amdjs-api/blob/master/LoaderPlugins.md) or [SystemJS](https://github.com/systemjs/systemjs/blob/main/docs/module-types.md)) has not been easy before; previously an ambient module declaration had to be defined for each resource. TypeScript 2.0 supports the use of the wildcard character (`*`) to declare a "family" of module names; @@ -741,7 +741,7 @@ function test(x: Bar) { ## Private and Protected Constructors A class constructor may be marked `private` or `protected`. -A class with private constructor cannot be instantiated outside the class body, and cannot be extended. +A class with a private constructor cannot be instantiated outside the class body, and cannot be extended. A class with protected constructor cannot be instantiated outside the class body, but can be extended. ##### Example From 1d23b2af1d1195de43a90a0ed62aa2ca3218d0b2 Mon Sep 17 00:00:00 2001 From: Yevgeny Iliyn Date: Sun, 18 Feb 2024 13:48:23 +0400 Subject: [PATCH 06/17] Fix typo in TypeScript 2.1.md --- packages/documentation/copy/en/release-notes/TypeScript 2.1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/documentation/copy/en/release-notes/TypeScript 2.1.md b/packages/documentation/copy/en/release-notes/TypeScript 2.1.md index 0be57df89659..89561a0fc300 100644 --- a/packages/documentation/copy/en/release-notes/TypeScript 2.1.md +++ b/packages/documentation/copy/en/release-notes/TypeScript 2.1.md @@ -473,7 +473,7 @@ TypeScript 2.1 supports inheriting configuration using `extends`, where: - `extends` is a new top-level property in `tsconfig.json` (alongside `compilerOptions`, [`files`](/tsconfig#files), [`include`](/tsconfig#include), and [`exclude`](/tsconfig#exclude)). - The value of `extends` must be a string containing a path to another configuration file to inherit from. -- The configuration from the base file are loaded first, then overridden by those in the inheriting config file. +- The configuration from the base file is loaded first, then overridden by those in the inheriting config file. - Circularity between configuration files is not allowed. - [`files`](/tsconfig#files), [`include`](/tsconfig#include), and [`exclude`](/tsconfig#exclude) from the inheriting config file _overwrite_ those from the base config file. - All relative paths found in the configuration file will be resolved relative to the configuration file they originated in. From 37cb76bd894e577d93156372d511d8bb7866e98f Mon Sep 17 00:00:00 2001 From: Yevgeny Iliyn Date: Sun, 18 Feb 2024 13:51:48 +0400 Subject: [PATCH 07/17] Fix typo in TypeScript 2.2.md --- .../documentation/copy/en/release-notes/TypeScript 2.2.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/documentation/copy/en/release-notes/TypeScript 2.2.md b/packages/documentation/copy/en/release-notes/TypeScript 2.2.md index e7961ae3b0ef..a1bad5476f49 100644 --- a/packages/documentation/copy/en/release-notes/TypeScript 2.2.md +++ b/packages/documentation/copy/en/release-notes/TypeScript 2.2.md @@ -180,12 +180,12 @@ map["prop1"] = 1; map.prop2 = 2; ``` -This only apply to types with an _explicit_ string index signature. +This only applies to types with an _explicit_ string index signature. It is still an error to access unknown properties on a type using `.` notation. ## Support for spread operator on JSX element children -TypeScript 2.2 adds support for using spread on a JSX element children. +TypeScript 2.2 adds support for using spread on JSX element children. Please see [facebook/jsx#57](https://github.com/facebook/jsx/issues/57) for more details. ##### Example @@ -208,5 +208,5 @@ let x: TodoListProps; ## New `jsx: react-native` -React-native build pipeline expects all files to have a `.js` extensions even if the file contains JSX syntax. -The new [`jsx`](/tsconfig#jsx) value `react-native` will persevere the JSX syntax in the output file, but give it a `.js` extension. +React-native build pipeline expects all files to have a `.js` extension even if the file contains JSX syntax. +The new [`jsx`](/tsconfig#jsx) value `react-native` will preserve the JSX syntax in the output file, but give it a `.js` extension. From 8b76a4c29a1efa86b274eea36a24058ec5e749fa Mon Sep 17 00:00:00 2001 From: Yevgeny Iliyn Date: Sun, 18 Feb 2024 13:55:27 +0400 Subject: [PATCH 08/17] Fix typo in TypeScript 2.6.md --- .../documentation/copy/en/release-notes/TypeScript 2.6.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/documentation/copy/en/release-notes/TypeScript 2.6.md b/packages/documentation/copy/en/release-notes/TypeScript 2.6.md index bffe91d94a92..f476c1fdc913 100644 --- a/packages/documentation/copy/en/release-notes/TypeScript 2.6.md +++ b/packages/documentation/copy/en/release-notes/TypeScript 2.6.md @@ -143,7 +143,7 @@ var result = templateObjectFactory() === templateObjectFactory(); ## Localized diagnostics on the command line TypeScript 2.6 npm package ships with localized versions of diagnostic messages for 13 languages. -The localized messages are available when using `--locale` flag on the command line. +The localized messages are available when using the `--locale` flag on the command line. ##### Example @@ -214,7 +214,7 @@ wn' 'es2016.array.include' 'es2017.object' 'es2017.sharedmemory' 'es2017.string' ## Suppress errors in .ts files using '// @ts-ignore' comments -TypeScript 2.6 support suppressing errors in .ts files using `// @ts-ignore` comments placed above the offending lines. +TypeScript 2.6 supports suppressing errors in .ts files using `// @ts-ignore` comments placed above the offending lines. ##### Example @@ -235,7 +235,7 @@ Please note that this comment only suppresses the error reporting, and we recomm TypeScript 2.6 brings a faster `--watch` implementation. The new version optimizes code generation and checking for code bases using ES modules. Changes detected in a module file will result in _only_ regenerating the changed module, and files that depend on it, instead of the whole project. -Projects with large number of files should reap the most benefit from this change. +Projects with a large number of files should reap the most benefit from this change. The new implementation also brings performance enhancements to watching in tsserver. The watcher logic has been completely rewritten to respond faster to change events. @@ -247,7 +247,7 @@ Declarations are only written to but never read from are now flagged as unused. ##### Example -Bellow both `n` and `m` will be marked as unused, because their values are never _read_. Previously TypeScript would only check whether their values were _referenced_. +Below both `n` and `m` will be marked as unused, because their values are never _read_. Previously TypeScript would only check whether their values were _referenced_. ```ts function f(n: number) { From 8c00f1e8785319ed475bb36462b1b4e66663ffd6 Mon Sep 17 00:00:00 2001 From: Yevgeny Iliyn Date: Sun, 18 Feb 2024 13:58:15 +0400 Subject: [PATCH 09/17] Fix typo in TypeScript 2.8.md --- .../documentation/copy/en/release-notes/TypeScript 2.8.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/documentation/copy/en/release-notes/TypeScript 2.8.md b/packages/documentation/copy/en/release-notes/TypeScript 2.8.md index 3c2721eb3e09..4e75be931a54 100644 --- a/packages/documentation/copy/en/release-notes/TypeScript 2.8.md +++ b/packages/documentation/copy/en/release-notes/TypeScript 2.8.md @@ -267,7 +267,7 @@ type T24 = InstanceType; // Error ## Improved control over mapped type modifiers -Mapped types support adding a `readonly` or `?` modifier to a mapped property, but they did not provide support the ability to _remove_ modifiers. +Mapped types support adding a `readonly` or `?` modifier to a mapped property, but they did not provide support for the ability to _remove_ modifiers. This matters in [_homomorphic mapped types_](https://github.com/Microsoft/TypeScript/pull/12563) which by default preserve the modifiers of the underlying type. TypeScript 2.8 adds the ability for a mapped type to either add or remove a particular modifier. @@ -328,7 +328,7 @@ type T7 = T4; // "a" | "b" ## Better handling for namespace patterns in `.js` files TypeScript 2.8 adds support for understanding more namespace patterns in `.js` files. -Empty object literals declarations on top level, just like functions and classes, are now recognized as as namespace declarations in JavaScript. +Empty object literals declarations on top level, just like functions and classes, are now recognized as namespace declarations in JavaScript. ```js var ns = {}; // recognized as a declaration for a namespace `ns` From 7f3ce4d5155f568900f5dccbc13453d103c4c506 Mon Sep 17 00:00:00 2001 From: Yevgeny Iliyn Date: Sun, 18 Feb 2024 14:00:40 +0400 Subject: [PATCH 10/17] Fix typo in TypeScript 3.0.md --- packages/documentation/copy/en/release-notes/TypeScript 3.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/documentation/copy/en/release-notes/TypeScript 3.0.md b/packages/documentation/copy/en/release-notes/TypeScript 3.0.md index 5d0c6203e45f..8965b1947782 100644 --- a/packages/documentation/copy/en/release-notes/TypeScript 3.0.md +++ b/packages/documentation/copy/en/release-notes/TypeScript 3.0.md @@ -343,7 +343,7 @@ TypeScript adds a new triple-slash-reference directive (`/// Date: Sun, 18 Feb 2024 14:06:35 +0400 Subject: [PATCH 11/17] Fix typo in TypeScript 3.5.md --- packages/documentation/copy/en/release-notes/TypeScript 3.5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/documentation/copy/en/release-notes/TypeScript 3.5.md b/packages/documentation/copy/en/release-notes/TypeScript 3.5.md index 015ba21e0649..64df52b77f97 100644 --- a/packages/documentation/copy/en/release-notes/TypeScript 3.5.md +++ b/packages/documentation/copy/en/release-notes/TypeScript 3.5.md @@ -70,7 +70,7 @@ const thing: Point | Label = { }; ``` -Previously, a non-disciminated union wouldn't have _any_ excess property checking done on its members, and as a result, the incorrectly typed `name` property slipped by. +Previously, a non-discriminated union wouldn't have _any_ excess property checking done on its members, and as a result, the incorrectly typed `name` property slipped by. In TypeScript 3.5, the type-checker at least verifies that all the provided properties belong to _some_ union member and have the appropriate type, meaning that the sample above correctly issues an error. From c0c0430d7d2b00fd00b6328e000b86aa67a8ad83 Mon Sep 17 00:00:00 2001 From: Yevgeny Iliyn Date: Sun, 18 Feb 2024 14:12:02 +0400 Subject: [PATCH 12/17] Fix typo in TypeScript 4.0.md --- .../documentation/copy/en/release-notes/TypeScript 4.0.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/documentation/copy/en/release-notes/TypeScript 4.0.md b/packages/documentation/copy/en/release-notes/TypeScript 4.0.md index 9edb7c08a3e4..1a7f570f8978 100644 --- a/packages/documentation/copy/en/release-notes/TypeScript 4.0.md +++ b/packages/documentation/copy/en/release-notes/TypeScript 4.0.md @@ -571,7 +571,7 @@ For details, [read up more on the pull request](https://github.com/microsoft/Typ ## `--incremental` with `--noEmit` -TypeScript 4.0 allows us to use the [`noEmit`](/tsconfig#noEmit) flag when while still leveraging [`incremental`](/tsconfig#incremental) compiles. +TypeScript 4.0 allows us to use the [`noEmit`](/tsconfig#noEmit) flag while still leveraging [`incremental`](/tsconfig#incremental) compiles. This was previously not allowed, as [`incremental`](/tsconfig#incremental) needs to emit a `.tsbuildinfo` files; however, the use-case to enable faster incremental builds is important enough to enable for all users. For more details, you can [see the implementing pull request](https://github.com/microsoft/TypeScript/pull/39122). @@ -604,7 +604,7 @@ For more details, [check out the pull request for this feature](https://github.c TypeScript's editing support now recognizes when a declaration has been marked with a `/** @deprecated */` JSDoc comment. That information is surfaced in completion lists and as a suggestion diagnostic that editors can handle specially. -In an editor like VS Code, deprecated values are typically displayed a strike-though style ~~like this~~. +In an editor like VS Code, deprecated values are typically displayed in a strike-though style ~~like this~~. ![Some examples of deprecated declarations with strikethrough text in the editor](https://devblogs.microsoft.com/typescript/wp-content/uploads/sites/11/2020/06/deprecated_4-0.png) From 70ca3ac66b8c99ae9aa5206bbd945f17b88960ae Mon Sep 17 00:00:00 2001 From: Yevgeny Iliyn Date: Sun, 18 Feb 2024 14:15:38 +0400 Subject: [PATCH 13/17] Fix typo in TypeScript 4.1.md --- .../documentation/copy/en/release-notes/TypeScript 4.1.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/documentation/copy/en/release-notes/TypeScript 4.1.md b/packages/documentation/copy/en/release-notes/TypeScript 4.1.md index 9456995a3455..d2bd55d2fd91 100644 --- a/packages/documentation/copy/en/release-notes/TypeScript 4.1.md +++ b/packages/documentation/copy/en/release-notes/TypeScript 4.1.md @@ -35,7 +35,7 @@ type Options = { // }; ``` -But there's another place that that string literal types could be used as building blocks: building other string literal types. +But there's another place that string literal types could be used as building blocks: building other string literal types. That's why TypeScript 4.1 brings the template literal string type. It has the same syntax as [template literal strings in JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals), but is used in type positions. @@ -299,7 +299,7 @@ declare function customThen( ): Promise>; ``` -Keep in mind that while these recursive types are powerful, but they should be used responsibly and sparingly. +Keep in mind that while these recursive types are powerful, they should be used responsibly and sparingly. First off, these types can do a lot of work which means that they can increase type-checking time. Trying to model numbers in the Collatz conjecture or Fibonacci sequence might be fun, but don't ship that in `.d.ts` files on npm. @@ -583,7 +583,7 @@ TypeScript 4.1 ships with a quick fix to help fix this break. In JavaScript, object spreads (like `{ ...foo }`) don't operate over falsy values. So in code like `{ ...foo }`, `foo` will be skipped over if it's `null` or `undefined`. -Many users take advantage of this to spread in properties "conditionally". +Many users take advantage of this to spread properties "conditionally". ```ts interface Person { From 8ccd65d58bcb2b86c306a0fc16ad9b61996c425d Mon Sep 17 00:00:00 2001 From: Yevgeny Iliyn Date: Sun, 18 Feb 2024 14:25:21 +0400 Subject: [PATCH 14/17] Fix typo in TypeScript 5.0.md --- .../documentation/copy/en/release-notes/TypeScript 5.0.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/documentation/copy/en/release-notes/TypeScript 5.0.md b/packages/documentation/copy/en/release-notes/TypeScript 5.0.md index f822e5f79eb8..629baca549da 100644 --- a/packages/documentation/copy/en/release-notes/TypeScript 5.0.md +++ b/packages/documentation/copy/en/release-notes/TypeScript 5.0.md @@ -686,7 +686,7 @@ Note that historically, a similar effect has often been achievable by adding a d Strictly speaking, the former is interpreted as a declaration file for a JavaScript file named `app.css.js`. Because relative files imports need to include extensions in Node's ESM support, TypeScript would error on our example in an ESM file under `--moduleResolution node16` or `nodenext`. -For more information, read up [the proposalfor this feature](https://github.com/microsoft/TypeScript/issues/50133) and [its corresponding pull request](https://github.com/microsoft/TypeScript/pull/51435). +For more information, read up [the proposal for this feature](https://github.com/microsoft/TypeScript/issues/50133) and [its corresponding pull request](https://github.com/microsoft/TypeScript/pull/51435). ### `customConditions` @@ -866,7 +866,7 @@ module.exports = { While this is a limitation, it does help make some issues more obvious. For example, it's very common to forget to set the [`type` field in `package.json`](https://nodejs.org/api/packages.html#type) under `--module node16`. -As a result, developers would start writing CommonJS modules instead of an ES modules without realizing it, giving surprising lookup rules and JavaScript output. +As a result, developers would start writing CommonJS modules instead of ES modules without realizing it, giving surprising lookup rules and JavaScript output. This new flag ensures that you're intentional about the file type you're using because the syntax is intentionally different. Because `--verbatimModuleSyntax` provides a more consistent story than `--importsNotUsedAsValues` and `--preserveValueImports`, those two existing flags are being deprecated in its favor. @@ -1156,7 +1156,7 @@ The way JavaScript compares strings means that `"Toggle"` always comes before `" So from that perspective, the import list is sorted. TypeScript previously considered the import list to be sorted because it was doing a basic case-sensitive sort. -This could be a point of frustration for developers who preferred a case-*insensitive* ordering, or who used tools like ESLint which require to case-insensitive ordering by default. +This could be a point of frustration for developers who preferred a case-*insensitive* ordering, or who used tools like ESLint which require case-insensitive ordering by default. TypeScript now detects case sensitivity by default. This means that TypeScript and tools like ESLint typically won't "fight" each other over how to best sort imports. From 783e55ddf0ba92c016e1393e5e839f1dfa450010 Mon Sep 17 00:00:00 2001 From: Yevgeny Iliyn Date: Sun, 18 Feb 2024 14:28:15 +0400 Subject: [PATCH 15/17] Fix typo in TypeScript 5.2.md --- .../documentation/copy/en/release-notes/TypeScript 5.2.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/documentation/copy/en/release-notes/TypeScript 5.2.md b/packages/documentation/copy/en/release-notes/TypeScript 5.2.md index 5e987d9b65d0..cee008d957b7 100644 --- a/packages/documentation/copy/en/release-notes/TypeScript 5.2.md +++ b/packages/documentation/copy/en/release-notes/TypeScript 5.2.md @@ -646,7 +646,7 @@ We'd like to extend our thanks to [Josh Goldberg](https://github.com/JoshuaKGold ## Easier Method Usage for Unions of Arrays -In previous versions on TypeScript, calling a method on a union of arrays could end in pain. +In previous versions of TypeScript, calling a method on a union of arrays could end in pain. ```ts declare let array: string[] | number[]; @@ -750,7 +750,7 @@ To do this, the type system has to track when any two types are already being re Previously TypeScript already kept a stack of type pairs, and iterated through that to determine whether those types are being related. When this stack is shallow that's not a problem; but when the stack isn't shallow, that, uh, [is a problem](https://accidentallyquadratic.tumblr.com/). -In TypeScript 5.3, a simple `Set` helps tracks this information. +In TypeScript 5.3, a simple `Set` helps track this information. This reduced the time spent on a reported test case that used the [drizzle](https://github.com/drizzle-team/drizzle-orm) library by over 33%! ``` @@ -816,7 +816,7 @@ For more information, [see the change here](https://github.com/microsoft/TypeScr ### Consistent Export Checking for Merged Symbols -When two declarations merge, they must agree in whether they are both exported. +When two declarations merge, they must agree on whether they are both exported. Due to a bug, TypeScript missed specific cases in ambient contexts, like in declaration files or `declare module` blocks. For example, it would not issue an error on a case like the following, where `replaceInFile` is declared once as an exported function, and one as an un-exported namespace. From ce8daa0aeaef1f0cd8c173528f9fba1e387d3f39 Mon Sep 17 00:00:00 2001 From: Yevgeny Iliyn Date: Sun, 18 Feb 2024 14:29:57 +0400 Subject: [PATCH 16/17] Fix typo in TypeScript 5.3.md --- packages/documentation/copy/en/release-notes/TypeScript 5.3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/documentation/copy/en/release-notes/TypeScript 5.3.md b/packages/documentation/copy/en/release-notes/TypeScript 5.3.md index 16306246044c..6d3cebf54a63 100644 --- a/packages/documentation/copy/en/release-notes/TypeScript 5.3.md +++ b/packages/documentation/copy/en/release-notes/TypeScript 5.3.md @@ -384,7 +384,7 @@ For more information, [see this pull request](https://github.com/microsoft/TypeS TypeScript itself ships two library files: `tsserverlibrary.js` and `typescript.js`. There are certain APIs available only in `tsserverlibrary.js` (like the `ProjectService` API), which may be useful to some importers. -Still, the two are distinct bundles with have a lot of overlap, duplicating code in the package. +Still, the two are distinct bundles which have a lot of overlap, duplicating code in the package. What's more, it can be challenging to consistently use one over the other due to auto-imports or muscle memory. Accidentally loading both modules is far too easy, and code may not work properly on a different instance of the API. Even if it does work, loading a second bundle increases resource usage. From a82a98f0080856b8a6676e954a046d03d7b7a91b Mon Sep 17 00:00:00 2001 From: Yevgeny Iliyn Date: Mon, 1 Apr 2024 00:05:40 +0500 Subject: [PATCH 17/17] Update packages/documentation/copy/en/release-notes/TypeScript 2.0.md Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com> --- packages/documentation/copy/en/release-notes/TypeScript 2.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/documentation/copy/en/release-notes/TypeScript 2.0.md b/packages/documentation/copy/en/release-notes/TypeScript 2.0.md index e2455d658cb5..d17f20b06659 100644 --- a/packages/documentation/copy/en/release-notes/TypeScript 2.0.md +++ b/packages/documentation/copy/en/release-notes/TypeScript 2.0.md @@ -742,7 +742,7 @@ function test(x: Bar) { A class constructor may be marked `private` or `protected`. A class with a private constructor cannot be instantiated outside the class body, and cannot be extended. -A class with protected constructor cannot be instantiated outside the class body, but can be extended. +A class with a protected constructor cannot be instantiated outside the class body, but can be extended. ##### Example