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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+28Lines changed: 28 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,34 @@
2
2
3
3
## Unreleased
4
4
5
+
* Parse and print JavaScript imports with an explicit phase ([#4238](https://github.com/evanw/esbuild/issues/4238))
6
+
7
+
This release adds basic syntax support for the `defer` and `source` import phases in JavaScript:
8
+
9
+
*`defer`
10
+
11
+
This is a [stage 3 proposal](https://github.com/tc39/proposal-defer-import-eval) for an upcoming JavaScript feature that will provide one way to eagerly load but lazily initialize imported modules. The imported module is automatically initialized on first use. Support for this syntax will also be part of the upcoming release of [TypeScript 5.9](https://devblogs.microsoft.com/typescript/announcing-typescript-5-9-beta/#support-for-import-defer). The syntax looks like this:
12
+
13
+
```js
14
+
import defer * as foo from "<specifier>";
15
+
const bar = await import.defer("<specifier>");
16
+
```
17
+
18
+
Note that this feature deliberately cannot be used with the syntax `import defer foo from "<specifier>"` or `import defer { foo } from "<specifier>"`.
19
+
20
+
*`source`
21
+
22
+
This is a [stage 3 proposal](https://github.com/tc39/proposal-source-phase-imports) for an upcoming JavaScript feature that will provide another way to eagerly load but lazily initialize imported modules. The imported module is returned in an uninitialized state. Support for this syntax may or may not be a part of TypeScript 5.9 (see [this issue](https://github.com/microsoft/TypeScript/issues/61216) for details). The syntax looks like this:
23
+
24
+
```js
25
+
importsourcefoofrom"<specifier>";
26
+
constbar=awaitimport.source("<specifier>");
27
+
```
28
+
29
+
Note that this feature deliberately cannot be used with the syntax `import defer * as foo from "<specifier>"` or `import defer { foo } from "<specifier>"`.
30
+
31
+
This change only adds support forthissyntax. These imports cannot currently be bundled by esbuild. To use these newfeatureswith esbuild's bundler, the imported paths must be external to the bundle and the output format must be set to `esm`.
32
+
5
33
* Support optionally emitting absolute paths instead of relative paths ([#338](https://github.com/evanw/esbuild/issues/338), [#2082](https://github.com/evanw/esbuild/issues/2082), [#3023](https://github.com/evanw/esbuild/issues/3023))
6
34
7
35
This release introduces the `--abs-paths=` feature which takes a comma-separated list of situations where esbuild should use absolute paths instead of relative paths. There are currently three supported situations: `code` (comments and string literals), `log` (log message text and location info), and `metafile` (the JSON build metadata).
0 commit comments