Correct this in field and accessor decorators (#3761)
This release changes the value of this in initializers for class field and accessor decorators from the module-level this value to the appropriate this value for the decorated element (either the class or the instance). It was previously incorrect due to lack of test coverage. Here's an example of a decorator that doesn't work without this change:
const dec = () => function() { this.bar = true }
class Foo { @dec static foo }
console.log(Foo.bar) // Should be "true"
TypeScript recently added es2023 as a compilation target, so esbuild now supports this too. There is no difference between a target of es2022 and es2023 as far as esbuild is concerned since the 2023 edition of JavaScript doesn't introduce any new syntax features.
The previous release introduced a regression with the --keep-names setting and object literals with get/set accessor methods, in which case the generated code contained syntax errors. This release fixes the regression:
// Original code
x = { get y() {} }
// Output from version 0.21.0 (with --keep-names)
x = { get y: /* @PURE */ __name(function() {
}, "y") };
// Output from this version (with --keep-names)
x = { get y() {
} };
v0.21.0
This release doesn't contain any deliberately-breaking changes. However, it contains a very complex new feature and while all of esbuild's tests pass, I would not be surprised if an important edge case turns out to be broken. So I'm releasing this as a breaking change release to avoid causing any trouble. As usual, make sure to test your code when you upgrade.
Implement the JavaScript decorators proposal (#104)
With this release, esbuild now contains an implementation of the upcoming JavaScript decorators proposal. This is the same feature that shipped in TypeScript 5.0 and has been highly-requested on esbuild's issue tracker. You can read more about them in that blog post and in this other (now slightly outdated) extensive blog post here: https://2ality.com/2022/10/javascript-decorators.html. Here's a quick example:
const log = (fn, context) => function() {
console.log(`before ${context.name}`)
const it = fn.apply(this, arguments)
console.log(`after ${context.name}`)
return it
}
Correct this in field and accessor decorators (#3761)
This release changes the value of this in initializers for class field and accessor decorators from the module-level this value to the appropriate this value for the decorated element (either the class or the instance). It was previously incorrect due to lack of test coverage. Here's an example of a decorator that doesn't work without this change:
const dec = () => function() { this.bar = true }
class Foo { @dec static foo }
console.log(Foo.bar) // Should be "true"
TypeScript recently added es2023 as a compilation target, so esbuild now supports this too. There is no difference between a target of es2022 and es2023 as far as esbuild is concerned since the 2023 edition of JavaScript doesn't introduce any new syntax features.
The previous release introduced a regression with the --keep-names setting and object literals with get/set accessor methods, in which case the generated code contained syntax errors. This release fixes the regression:
// Original code
x = { get y() {} }
// Output from version 0.21.0 (with --keep-names)
x = { get y: /* @PURE */ __name(function() {
}, "y") };
// Output from this version (with --keep-names)
x = { get y() {
} };
0.21.0
This release doesn't contain any deliberately-breaking changes. However, it contains a very complex new feature and while all of esbuild's tests pass, I would not be surprised if an important edge case turns out to be broken. So I'm releasing this as a breaking change release to avoid causing any trouble. As usual, make sure to test your code when you upgrade.
Implement the JavaScript decorators proposal (#104)
With this release, esbuild now contains an implementation of the upcoming JavaScript decorators proposal. This is the same feature that shipped in TypeScript 5.0 and has been highly-requested on esbuild's issue tracker. You can read more about them in that blog post and in this other (now slightly outdated) extensive blog post here: https://2ality.com/2022/10/javascript-decorators.html. Here's a quick example:
const log = (fn, context) => function() {
console.log(`before ${context.name}`)
const it = fn.apply(this, arguments)
console.log(`after ${context.name}`)
return it
}
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 lib-javascript group in /assets with 4 updates: @biomejs/biome, esbuild, chai and sinon.
Updates
@biomejs/biome
from 1.7.2 to 1.7.3Release notes
Sourced from
@biomejs/biome
's releases.... (truncated)
Changelog
Sourced from
@biomejs/biome
's changelog.... (truncated)
Commits
b9f90b7
release: v1.7.3 (#2722)cb0182e
feat(linter): implementNoUnmatchableAnbSelector
(#2706)f77ab54
feat(linter): implementuseExplicitLengthCheck
(#2631)afa5004
feat(biome_css_analyzer): noUnknownSelectorPseudoElement (#2655)150dd0e
feat(biome_css_analyzer): implement noDuplicateAtImportRules (#2658)773a735
fix(linter): fix typo in rule name.useConsistentBuiltinInstatiation
to `us...Updates
esbuild
from 0.20.2 to 0.21.2Release notes
Sourced from esbuild's releases.
... (truncated)
Changelog
Sourced from esbuild's changelog.
... (truncated)
Commits
b24180e
publish 0.21.2 to npmf82e0ad
fix #3761:this
in field and accessor decorators46ea596
fix #3762: addes2023
as an alias fores2022
e876394
publish 0.21.1 to npm4abc387
adjust decorator source map locationse7a9256
fix #3756: regression with--keep-names
33cbbea
runmake update-compat-table
c6da2c3
publish 0.21.0 to npm4bc834c
initial implementation of the decorators proposal (#3754)07cdbe0
some small adjustments to runtime library codeUpdates
chai
from 5.1.0 to 5.1.1Release notes
Sourced from chai's releases.
Commits
37263c0
fix: support some virtual contexts intoThrow
(#1609)91e58ed
Correct Mocha import instructions (#1611)61159d1
build(deps-dev): bump ip from 1.1.8 to 1.1.9 (#1608)8475d2a
Set up ESLint for JSDoc comments (#1605)936c0ca
5.1.0Updates
sinon
from 17.0.1 to 17.0.2Changelog
Sourced from sinon's changelog.
... (truncated)
Commits
16a25ae
17.0.2f6dca0b
upgrade packages (#2595)5025d00
Avoid return and callArg* clearing each other's state (#2593)ed068a8
Bump ip from 1.1.8 to 1.1.9 (#2587)ec4d592
fix #2589: avoid invoking getter as side-effect (#2592)9972e1e
Fix typo in mocks documentation (#2591)52e6e4c
chore: prefer cache option of setup-node08da123
Bump actions/cache from 3 to 4404ef47
Bump nokogiri from 1.14.3 to 1.16.2fd79612
Update Bug_report.mdDependabot 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