Update support for import assertions and import attributes in node (#3778)
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:
▲ [WARNING] The "assert" keyword is not supported in the configured target environment ("node22") [assert-to-with]
example.mjs:1:40:
1 │ import json from "esbuild/package.json" assert { type: "json" }
│ ~~~~~~
╵ with
Did you mean to use "with" instead of "assert"?
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.
Fix for await transform when a label is present
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:
// Original code
async function test() {
outer: for await (const x of [Promise.resolve([0, 1])]) {
for (const y of x) if (y) break outer
throw 'fail'
}
}
// Old output (with --target=es6)
function test() {
return __async(this, null, function* () {
outer: try {
for (var iter = __forAwait([Promise.resolve([0, 1])]), more, temp, error; more = !(temp = yield iter.next()).done; more = false) {
const x = temp.value;
for (const y of x) if (y) break outer;
throw "fail";
}
} catch (temp) {
error = [temp];
} finally {
try {
more && (temp = iter.return) && (yield temp.call(iter));
} finally {
if (error)
throw error[0];
}
}
Update support for import assertions and import attributes in node (#3778)
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:
▲ [WARNING] The "assert" keyword is not supported in the configured target environment ("node22") [assert-to-with]
example.mjs:1:40:
1 │ import json from "esbuild/package.json" assert { type: "json" }
│ ~~~~~~
╵ with
Did you mean to use "with" instead of "assert"?
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.
Fix for await transform when a label is present
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:
// Original code
async function test() {
outer: for await (const x of [Promise.resolve([0, 1])]) {
for (const y of x) if (y) break outer
throw 'fail'
}
}
// Old output (with --target=es6)
function test() {
return __async(this, null, function* () {
outer: try {
for (var iter = __forAwait([Promise.resolve([0, 1])]), more, temp, error; more = !(temp = yield iter.next()).done; more = false) {
const x = temp.value;
for (const y of x) if (y) break outer;
throw "fail";
}
} catch (temp) {
error = [temp];
} finally {
try {
more && (temp = iter.return) && (yield temp.call(iter));
} finally {
if (error)
throw error[0];
}
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Bumps the development group with 5 updates in the / directory:
1.4.0
1.6.0
0.20.2
0.21.4
6.1.1
6.2.0
5.0.5
5.0.7
0.3.1
0.4.0
Updates
@vitest/coverage-istanbul
from 1.4.0 to 1.6.0Release notes
Sourced from
@vitest/coverage-istanbul
's releases.... (truncated)
Commits
6b29f3d
chore: release v1.6.0a52964b
chore: release v1.5.381f57f4
chore: release v1.5.21be4510
chore: release v1.5.180265b4
fix(coverage):thresholds
to compare files relative to root (#5574)ea3c16e
fix(coverage): prevent crash whencleanOnRerun
is disabled (#5540)9e7a01c
chore: release v1.5.0Updates
esbuild
from 0.20.2 to 0.21.4Release notes
Sourced from esbuild's releases.
... (truncated)
Changelog
Sourced from esbuild's changelog.
... (truncated)
Commits
67cbf87
publish 0.21.4 to npm4ad11c3
fix #3639, fix #3646: passwith
toonResolve
516ca31
fix #3343: allow bundle-internal string aliases9e2f304
fix #3416, fix #3425: better enum constant folding8f1faf7
implement late constant-folding for&& || ??
7d50a50
implement late constant-folding of string enums1b29ac7
fold equality checks after cross-module inliningd7a8bf3
formatting support for@position-try
(for #3773)5069410
fix #3778: import assertions/attributes for node11d568c
runmake update-compat-table
Updates
eslint-plugin-promise
from 6.1.1 to 6.2.0Release notes
Sourced from eslint-plugin-promise's releases.
Commits
5e4546d
fix(no-callback-in-promise): false positives when the exception is an argumen...c0c716b
feat: ResolvegetAncestors
andgetScope
calls in eslint v9 (#466)7d33c30
chore: add pkg.funding (#468)ce9ae7f
chore(deps-dev): bump@babel/traverse
from 7.19.1 to 7.24.1 (#453)62af490
chore(deps): bump actions/checkout from 3 to 4 (#461)19b21b4
chore(deps): bump codecov/codecov-action from 3 to 4 (#459)8c74b9b
chore(deps): bump actions/setup-node from 3 to 4 (#460)bf75e4d
chore(deps): bump cycjimmy/semantic-release-action from 3 to 4 (#462)bbcfcbf
chore: add tests for Node 20 (#440)0b50079
chore: removestyfle/cancel-workflow-action
usage (#439)Updates
rimraf
from 5.0.5 to 5.0.7Commits
fb974ad
5.0.78ba2442
engines: need 14.18, where 'node:path' shows up39340d1
update depse729f76
5.0.64472c0e
DOC: add that it is cross platform46b425f
Improve readability of READMEa3b93ed
update deps, format codesd2fa213
update devDepsf3b2bf1
Upgrade GitHub Actions81c631e
remove FUNDING.yml (coming from .github repo now)Updates
vitest
from 1.4.0 to 1.6.0Release notes
Sourced from vitest's releases.
... (truncated)
Commits
6b29f3d
chore: release v1.6.0f8d3d22
feat(benchmark): support comparing benchmark result (#5398)21e58bd
feat(browser): allow injecting scripts (#5656)30f728b
feat: custom "snapshotEnvironment" option (#5449)2f91322
feat(reporter): supportincludeConsoleOutput
andaddFileAttribute
in juni...c571276
perf: unnecessary rpc call when coverage is disabled (#5658)bdce0a2
feat: support standalone mode (#5565)40c299f
fix: don't panic on empty files in node_modulesc9e68ce
fix: hash the name of the file when caching (#5654)f5faf42
fix: callresolveId('vitest')
afterbuildStart
(#5646)Updates
vitest-when
from 0.3.1 to 0.4.0Commits
2978911
chore(release): 0.4.09ac6268
feat(debug): add debug utility (#11)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show