-
Notifications
You must be signed in to change notification settings - Fork 69
Commit bc41b70
authored
chore(deps): update dependency esbuild to ^0.21.0 (#429)
[](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [esbuild](https://togithub.com/evanw/esbuild) | [`^0.20.0` ->
`^0.21.0`](https://renovatebot.com/diffs/npm/esbuild/0.20.0/0.21.1) |
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
---
### Release Notes
<details>
<summary>evanw/esbuild (esbuild)</summary>
###
[`v0.21.1`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#0211)
[Compare
Source](https://togithub.com/evanw/esbuild/compare/v0.21.0...v0.21.1)
- Fix a regression with `--keep-names`
([#​3756](https://togithub.com/evanw/esbuild/issues/3756))
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:
```js
// 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`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#0210)
[Compare
Source](https://togithub.com/evanw/esbuild/compare/v0.20.2...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](https://togithub.com/evanw/esbuild/issues/104))
With this release, esbuild now contains an implementation of the
upcoming [JavaScript decorators
proposal](https://togithub.com/tc39/proposal-decorators). This is the
same feature that shipped in [TypeScript
5.0](https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#decorators)
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:
```js
const log = (fn, context) => function() {
console.log(`before ${context.name}`)
const it = fn.apply(this, arguments)
console.log(`after ${context.name}`)
return it
}
class Foo {
@​log static foo() {
console.log('in foo')
}
}
// Logs "before foo", "in foo", "after foo"
Foo.foo()
```
Note that this feature is different than the existing "TypeScript
experimental decorators" feature that esbuild already implements. It
uses similar syntax but behaves very differently, and the two are not
compatible (although it's sometimes possible to write decorators that
work with both). TypeScript experimental decorators will still be
supported by esbuild going forward as they have been around for a long
time, are very widely used, and let you do certain things that are not
possible with JavaScript decorators (such as decorating function
parameters). By default esbuild will parse and transform JavaScript
decorators, but you can tell esbuild to parse and transform TypeScript
experimental decorators instead by setting `"experimentalDecorators":
true` in your `tsconfig.json` file.
Probably at least half of the work for this feature went into creating a
test suite that exercises many of the proposal's edge cases:
https://github.com/evanw/decorator-tests. It has given me a reasonable
level of confidence that esbuild's initial implementation is acceptable.
However, I don't have access to a significant sample of real code that
uses JavaScript decorators. If you're currently using JavaScript
decorators in a real code base, please try out esbuild's implementation
and let me know if anything seems off.
**1 parent c1892ed commit bc41b70Copy full SHA for bc41b70
2 files changed
+97
-102
lines changed+96-101Lines changed: 96 additions & 101 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+1-1Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
49 |
| - | |
| 49 | + | |
50 | 50 |
| |
51 | 51 |
| |
52 | 52 |
| |
|
0 commit comments