Fix TypeScript-specific class transform edge case (#3559)
The previous release introduced an optimization that avoided transforming super() in the class constructor for TypeScript code compiled with useDefineForClassFields set to false if all class instance fields have no initializers. The rationale was that in this case, all class instance fields are omitted in the output so no changes to the constructor are needed. However, if all of this is the case and there are #private instance fields with initializers, those private instance field initializers were still being moved into the constructor. This was problematic because they were being inserted before the call to super() (since super() is now no longer transformed in that case). This release introduces an additional optimization that avoids moving the private instance field initializers into the constructor in this edge case, which generates smaller code, matches the TypeScript compiler's output more closely, and avoids this bug:
// Original code
class Foo extends Bar {
#private = 1;
public: any;
constructor() {
super();
}
}
// Old output (with esbuild v0.19.9)
class Foo extends Bar {
constructor() {
super();
this.#private = 1;
}
#private;
}
// Old output (with esbuild v0.19.10)
class Foo extends Bar {
constructor() {
this.#private = 1;
super();
}
#private;
}
// New output
class Foo extends Bar {
#private = 1;
constructor() {
super();
}
}
Minifier: allow reording a primitive past a side-effect (#3568)
The minifier previously allowed reordering a side-effect past a primitive, but didn't handle the case of reordering a primitive past a side-effect. This additional case is now handled:
Fix TypeScript-specific class transform edge case (#3559)
The previous release introduced an optimization that avoided transforming super() in the class constructor for TypeScript code compiled with useDefineForClassFields set to false if all class instance fields have no initializers. The rationale was that in this case, all class instance fields are omitted in the output so no changes to the constructor are needed. However, if all of this is the case and there are #private instance fields with initializers, those private instance field initializers were still being moved into the constructor. This was problematic because they were being inserted before the call to super() (since super() is now no longer transformed in that case). This release introduces an additional optimization that avoids moving the private instance field initializers into the constructor in this edge case, which generates smaller code, matches the TypeScript compiler's output more closely, and avoids this bug:
// Original code
class Foo extends Bar {
#private = 1;
public: any;
constructor() {
super();
}
}
// Old output (with esbuild v0.19.9)
class Foo extends Bar {
constructor() {
super();
this.#private = 1;
}
#private;
}
// Old output (with esbuild v0.19.10)
class Foo extends Bar {
constructor() {
this.#private = 1;
super();
}
#private;
}
// New output
class Foo extends Bar {
#private = 1;
constructor() {
super();
}
}
Minifier: allow reording a primitive past a side-effect (#3568)
The minifier previously allowed reordering a side-effect past a primitive, but didn't handle the case of reordering a primitive past a side-effect. This additional case is now handled:
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 3 updates: @vitest/coverage-istanbul, esbuild and vitest.
Updates
@vitest/coverage-istanbul
from 1.0.1 to 1.1.1Release notes
Sourced from
@vitest/coverage-istanbul
's releases.... (truncated)
Commits
c8abbc1
chore: release v1.1.19497f48
chore: release v1.1.066933c3
chore: release v1.0.47c19664
chore: release v1.0.37006bb3
chore: release v1.0.2Updates
esbuild
from 0.19.8 to 0.19.11Release notes
Sourced from esbuild's releases.
... (truncated)
Changelog
Sourced from esbuild's changelog.
... (truncated)
Commits
6ee8225
publish 0.19.11 to npmf8ae3af
fix #3561: treeshaking of knownSymbol
instances0811058
switch define data to flagsf5f8ff8
fix #3568: can reorder primitive past side-effect914f608
fix #3558: put thestop()
api call back2aa166b
fix #3559: fix recent class transform regression55e1127
publish 0.19.10 to npmd968af2
fix #3511:@__NO_SIDE_EFFECTS__
with templates00c4ebe
fix #3546: don't transformrequire
glob importse1b7050
fix #3319: missing symbol usage in glob transformUpdates
vitest
from 1.0.1 to 1.1.1Release notes
Sourced from vitest's releases.
... (truncated)
Commits
c8abbc1
chore: release v1.1.12baea35
fix(vitest): showbeforeAll/afterAll
errors in junit reporter (#4819)7e6a62a
fix: match jest json output by making json reporter output ndjson-compatible ...5053a5d
fix: correct option name--no-parallelism
(#4831)06c14f7
fix(vitest): fix file snapshots in skipped suites considered obsolete (#4795)8ddb494
chore: always externalize vitest (#4816)8f6225b
fix: don't fail ifinline: true
is set (#4815)ee8b46d
fix: don't crash when using happy-dom or jsdom environment on Yarn PnP worksp...957daa3
fix(vitest): initialize snapshot state only once for each file suite (#4796)cf53d4b
fix(vm-threads): tests not cancelled on key press, cancelled tests shown twic...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