You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
*[`export * as ns` Syntax](#export-star-as-namespace-syntax)
4
4
*[Top-Level `await`](#top-level-await)
5
5
*[JSDoc Property Modifiers](#jsdoc-modifiers)
6
6
*[Better Directory Watching on Linux and `watchOptions`](#better-directory-watching)
7
7
*["Fast and Loose" Incremental Checking](#assume-direct-dependencies)
8
8
9
-
## <spanid="type-only-imports-exports" /> Type-Only Imports and Export
9
+
## Type-Only Imports and Exports
10
10
11
11
This feature is something most users may never have to think about; however, if you've hit issues under `--isolatedModules`, TypeScript's `transpileModule` API, or Babel, this feature might be relevant.
12
12
@@ -61,7 +61,7 @@ This flag takes 3 different values:
61
61
62
62
For more information about the feature, you can [take a look at the pull request](https://github.com/microsoft/TypeScript/pull/35200), and [relevant changes](https://github.com/microsoft/TypeScript/pull/36092/) around broadening where imports from an `import type` declaration can be used.
TypeScript 3.8 brings support for ECMAScript's private fields, part of the [stage-3 class fields proposal](https://github.com/tc39/proposal-class-fields/).
67
67
@@ -262,7 +262,7 @@ A final consideration might be speed: `private` properties are no different from
262
262
In contrast, because `#` private fields are downleveled using `WeakMap`s, they may be slower to use.
263
263
While some runtimes might optimize their actual implementations of `#` private fields, and even have speedy `WeakMap` implementations, that might not be the case in all runtimes.
264
264
265
-
## <spanid="export-star-as-namespace-syntax" /> `export * as ns` Syntax
265
+
## `export * as ns` Syntax
266
266
267
267
It's often common to have a single entry-point that exposes all the members of another module as a single member.
268
268
@@ -280,7 +280,7 @@ export * as utilities from "./utilities.js";
280
280
This is a nice quality-of-life improvement to JavaScript, and TypeScript 3.8 implements this syntax.
281
281
When your module target is earlier than `es2020`, TypeScript will output something along the lines of the first code snippet.
282
282
283
-
## <spanid="top-level-await" /> Top-Level `await`
283
+
## Top-Level `await`
284
284
285
285
TypeScript 3.8 provides support for a handy upcoming ECMAScript feature called "top-level `await`".
286
286
@@ -318,13 +318,13 @@ Support within several environments and bundlers may be limited or may require e
318
318
319
319
For more information on our implementation, you can [check out the original pull request](https://github.com/microsoft/TypeScript/pull/35813).
320
320
321
-
## <spanid="es2020-for-target-and-module" /> `es2020` for `target` and `module`
321
+
## `es2020` for `target` and `module`
322
322
323
323
TypeScript 3.8 supports `es2020` as an option for `module` and `target`.
324
324
This will preserve newer ECMAScript 2020 features like optional chaining, nullish coalescing, `export * as ns`, and dynamic `import(...)` syntax.
325
325
It also means `bigint` literals now have a stable `target` below `esnext`.
TypeScript 3.8 supports JavaScript files by turning on the `allowJs` flag, and also supports *type-checking* those JavaScript files via the `checkJs` option or by adding a `// @ts-check` comment to the top of your `.js` files.
330
330
@@ -380,7 +380,7 @@ new Foo().stuff++;
380
380
// Cannot assign to 'stuff' because it is a read-only property.
381
381
```
382
382
383
-
## <spanid="better-directory-watching" /> Better Directory Watching on Linux and `watchOptions`
383
+
## Better Directory Watching on Linux and `watchOptions`
384
384
385
385
TypeScript 3.8 ships a new strategy for watching directories, which is crucial for efficiently picking up changes to `node_modules`.
TypeScript 3.9 ships with many new speed improvements.
53
53
Our team has been focusing on performance after observing extremely poor editing/compilation speed with packages like material-ui and styled-components.
@@ -69,7 +69,7 @@ TypeScript 3.9 addresses this issue by [changing the internals of how the compil
69
69
70
70
While there's still room for improvement, we hope this work translates to a snappier experience for everyone!
Imagine that we're writing a library in TypeScript and we're exporting some function called `doStuff` as part of our public API.
75
75
The function's types declare that it takes two `string`s so that other TypeScript users can get type-checking errors, but it also does a runtime check (maybe only in development builds) to give JavaScript users a helpful error.
The TypeScript compiler not only powers the TypeScript editing experience in most major editors, it also powers the JavaScript experience in the Visual Studio family of editors and more.
197
197
Using new TypeScript/JavaScript functionality in your editor will differ depending on your editor, but
@@ -200,7 +200,7 @@ Using new TypeScript/JavaScript functionality in your editor will differ dependi
200
200
* Visual Studio 2017/2019 have [the SDK installers above] and [MSBuild installs](https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild).
201
201
* Sublime Text 3 supports [selecting different versions of TypeScript](https://github.com/microsoft/TypeScript-Sublime-Plugin#note-using-different-versions-of-typescript)
202
202
203
-
### <spanid=cjs-auto-imports /> CommonJS Auto-Imports in JavaScript
203
+
### CommonJS Auto-Imports in JavaScript
204
204
205
205
One great new improvement is in auto-imports in JavaScript files using CommonJS modules.
206
206
@@ -223,7 +223,7 @@ TypeScript now automatically detects the types of imports you're using to keep y
223
223
224
224
For more details on the change, see [the corresponding pull request](https://github.com/microsoft/TypeScript/pull/37027).
TypeScript's refactorings and quick fixes often didn't do a great job of preserving newlines.
229
229
As a really basic example, take the following code.
@@ -284,7 +284,7 @@ function printSquares() {
284
284
285
285
You can see more about the implementation [in this pull request](https://github.com/microsoft/TypeScript/pull/36688)
286
286
287
-
### <spanid=missing-returns /> Quick Fixes for Missing Return Expressions
287
+
### Quick Fixes for Missing Return Expressions
288
288
289
289
There are occasions where we might forget to return the value of the last statement in a function, especially when adding curly braces to arrow functions.
290
290
@@ -300,7 +300,7 @@ Thanks to [a pull request](https://github.com/microsoft/TypeScript/pull/26434) f
300
300
301
301

302
302
303
-
### <spanid=solution-style-tsconfig /> Support for "Solution Style" `tsconfig.json` Files
303
+
### Support for "Solution Style" `tsconfig.json` Files
304
304
305
305
Editors need to figure out which configuration file a file belongs to so that it can apply the appropriate options and figure out which other files are included in the current "project".
306
306
By default, editors powered by TypeScript's language server do this by walking up each parent directory to find a `tsconfig.json`.
@@ -325,7 +325,7 @@ Here, none of these `tsconfig.*.json` files get picked up by the server, but we'
325
325
TypeScript 3.9 adds support to editing scenarios for this configuration.
326
326
For more details, take a look at [the pull request that added this functionality](https://github.com/microsoft/TypeScript/pull/37239).
327
327
328
-
## <spanid=breaking-changes /> Breaking Changes
328
+
## Breaking Changes
329
329
330
330
### Parsing Differences in Optional Chaining and Non-Null Assertions
0 commit comments