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
}
This changelog documents all esbuild versions published in the year 2022 (versions 0.14.11 through 0.16.12).
0.16.12
Loader defaults to js for extensionless files (#2776)
Certain packages contain files without an extension. For example, the yargs package contains the file yargs/yargs which has no extension. Node, Webpack, and Parcel can all understand code that imports yargs/yargs because they assume that the file is JavaScript. However, esbuild was previously unable to understand this code because it relies on the file extension to tell it how to interpret the file. With this release, esbuild will now assume files without an extension are JavaScript files. This can be customized by setting the loader for "" (the empty string, representing files without an extension) to another loader. For example, if you want files without an extension to be treated as CSS instead, you can do that like this:
In addition, the "type" field in package.json files now only applies to files with an explicit .js, .jsx, .ts, or .tsx extension. Previously it was incorrectly applied by esbuild to all files that had an extension other than .mjs, .mts, .cjs, or .cts including extensionless files. So for example an extensionless file in a "type": "module" package is now treated as CommonJS instead of ESM.
0.16.11
Avoid a syntax error in the presence of direct eval (#2761)
The behavior of nested function declarations in JavaScript depends on whether the code is run in strict mode or not. It would be problematic if esbuild preserved nested function declarations in its output because then the behavior would depend on whether the output was run in strict mode or not instead of respecting the strict mode behavior of the original source code. To avoid this, esbuild transforms nested function declarations to preserve the intended behavior of the original source code regardless of whether the output is run in strict mode or not:
// Original code
if (true) {
function foo() {}
console.log(!!foo)
foo = null
console.log(!!foo)
}
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 dev-deps group with 8 updates in the / directory:
7.1.0
7.9.0
7.1.0
7.9.0
0.14.54
0.21.2
2.2.5
2.3.0
3.1.2
3.1.3
10.3.0
10.4.0
5.0.5
5.0.7
5.3.3
5.4.5
Updates
@typescript-eslint/eslint-plugin
from 7.1.0 to 7.9.0Release notes
Sourced from
@​typescript-eslint/eslint-plugin
's releases.... (truncated)
Changelog
Sourced from
@​typescript-eslint/eslint-plugin
's changelog.... (truncated)
Commits
77fc366
chore(release): publish 7.9.0f53fece
chore: add knip (#8192)8acb8d4
fix(eslint-plugin): [explicit-function-return-types] fix false positive on de...d696ea2
docs(eslint-plugin): fix several 404 URLs (#9064)37a41d9
docs: fix broken link toimport/no-duplicates
onno-duplicate-imports
pag...ab92621
docs: correct its/it's spelling (#9048)f248e68
docs: [no-floating-promises] remove ugly commas (#9034)6e1241b
docs: fix no-unnecessary-boolean-literal-compare example (#8981)ee677f6
chore(release): publish 7.8.08127873
fix(eslint-plugin): [no-unused-vars] clear error report range (#8640)Updates
@typescript-eslint/parser
from 7.1.0 to 7.9.0Release notes
Sourced from
@​typescript-eslint/parser
's releases.... (truncated)
Changelog
Sourced from
@​typescript-eslint/parser
's changelog.... (truncated)
Commits
77fc366
chore(release): publish 7.9.0f53fece
chore: add knip (#8192)ee677f6
chore(release): publish 7.8.03e19436
chore(release): publish 7.7.1e44a1a2
chore(release): publish 7.7.0e1db872
chore(release): publish 7.6.0a6ab2cb
feat: bump npm dependency ranges (#8860)a14ba9d
chore(release): publish 7.5.0ecb6b55
docs: add homepage (#8742)d5615d7
fix(parser): disallowerrorOnTypeScriptSyntacticAndSemanticIssues
(#8784)Updates
esbuild
from 0.14.54 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
karma-esbuild
from 2.2.5 to 2.3.0Release notes
Sourced from karma-esbuild's releases.
Commits
cf1cb8f
2.3.02799b2b
Merge pull request #55 from handerss-tibco/esbuild-17e47863f
Fix tests58106ad
Switch to new esbuild APIs for incremental builds4f75bf3
Bump esbuild to 0.17 and update peerDependenciesMaintainer changes
This version was pushed to npm by jridgewell, a new releaser for karma-esbuild since your current version.
Updates
lit
from 3.1.2 to 3.1.3Release notes
Sourced from lit's releases.
Changelog
Sourced from lit's changelog.
Commits
700799b
Version Packages (#4625)1b00c07
Update prettier (#4559)Updates
mocha
from 10.3.0 to 10.4.0Release notes
Sourced from mocha's releases.
Changelog
Sourced from mocha's changelog.
Commits
ffd9557
Release v10.4.07ac67f3
build(deps): bump the github-actions group with 2 updates (#5125)7a2781c
chore: activate dependabot for workflows (#5123)97dcbb2
fix: harden error handling inlib/cli/run.js
(#5074)6f3f45e
fix: xunit integration test (#5122)a5b5652
docs: fix documentation concerning glob expansion on UNIX (#4869)efbb147
feat: add file path to xunit reporter (#4985)a2e600d
fix: closes #5115 (#5116)3735873
feat: include.cause
stacks in the error stack traces (#4829)b88978d
chore: bump ESLint ecmaVersion to 2020 (#5104)Maintainer changes
This version was pushed to npm by voxpelli, a new releaser for mocha since your current version.
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
typescript
from 5.3.3 to 5.4.5Release notes
Sourced from typescript's releases.
... (truncated)
Commits
27bcd4c
Update LKG9f33bf1
🤖 Pick PR #58098 (Fix constraints of nested homomorph...) into release-5.4 (#...71b2f84
Bump version to 5.4.5 and LKG892936f
🤖 Pick PR #58083 (Don't propagate partial union/inter...) into release-5.4 (#...38a7c05
release-5.4: Always set node-version for setup-node (#58117)b754fc3
🤖 Pick PR #57778 (fix type import check for default-i...) into release-5.4 (#...8eb3367
Bump version to 5.4.4 and LKGde9096b
🤖 Pick PR #57871 (Divide-and-conquer strategy for int...) into release-5.4 (#...06aae98
🤖 Pick PR #57973 (Compare package.json paths with cor...) into release-5.4 (#...6d8134e
🤖 Pick PR #57637 (Fixed a regression related to deter...) into release-5.4 (#...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