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
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,23 @@
2
2
3
3
## Unreleased
4
4
5
+
* Update support for import assertions and import attributes in node ([#3778](https://github.com/evanw/esbuild/issues/3778))
6
+
7
+
Import assertions (the `assert` keyword) have been removed from node starting in v22.0.0. So esbuild will now strip them and generate a warning with `--target=node22` or above:
8
+
9
+
```
10
+
▲ [WARNING] The "assert" keyword is not supported in the configured target environment ("node22") [assert-to-with]
Import attributes (the `with` keyword) have been backported to node 18 starting in v18.20.0. So esbuild will no longer strip them with `--target=node18.N` if `N` is 20 or greater.
21
+
5
22
* Fix `for await` transform when a label is present
6
23
7
24
This release fixes a bug where the `for await` transform, which wraps the loop in a `try` statement, previously failed to also move the loop's label into the `try` statement. This bug only affects code that uses both of these features in combination. Here's an example of some affected code:
// Import assertions (note: these were removed from the JavaScript specification and never standardized)
479
479
{
480
-
// From https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V16.md#16.14.0
481
-
js.ImportAssertions.Node={'16.14': {force: true}}
480
+
js.ImportAssertions.Node={
481
+
// From https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V16.md#16.14.0
482
+
'16.14': {force: true},
483
+
484
+
// Manually tested using a binary from https://nodejs.org/en/download/prebuilt-binaries
485
+
'22': {force: false},
486
+
}
482
487
483
488
// MDN data is wrong here: https://bugs.webkit.org/show_bug.cgi?id=251600
484
489
deletejs.ImportAssertions.IOS
485
490
deletejs.ImportAssertions.Safari
486
491
}
487
492
493
+
// Import attributes (the replacement for import assertions)
494
+
{
495
+
// Manually tested using binaries from https://nodejs.org/en/download/prebuilt-binaries
496
+
js.ImportAttributes.Node={
497
+
'18.20': {force: true},
498
+
'19': {force: false},
499
+
'20.10': {force: true},
500
+
}
501
+
}
502
+
488
503
// MDN data is wrong here: https://www.chromestatus.com/feature/6482797915013120
"<stdin>: WARNING: The \"assert\" keyword is not supported in the configured target environment\nNOTE: Did you mean to use \"with\" instead of \"assert\"?\n")
"export {default} from 'y' assert {type: 'json'}",
6239
+
"<stdin>: WARNING: The \"assert\" keyword is not supported in the configured target environment\nNOTE: Did you mean to use \"with\" instead of \"assert\"?\n")
"<stdin>: WARNING: The \"assert\" keyword is not supported in the configured target environment\nNOTE: Did you mean to use \"with\" instead of \"assert\"?\n")
0 commit comments