@esbuild/win32-arm64
Advanced tools
Changelog
0.17.12
Fix a crash when parsing inline TypeScript decorators (#2991)
Previously esbuild's TypeScript parser crashed when parsing TypeScript decorators if the definition of the decorator was inlined into the decorator itself:
@(function sealed(constructor: Function) {
Object.seal(constructor);
Object.seal(constructor.prototype);
})
class Foo {}
This crash was not noticed earlier because this edge case did not have test coverage. The crash is fixed in this release.
Changelog
0.17.11
Fix the alias
feature to always prefer the longest match (#2963)
It's possible to configure conflicting aliases such as --alias:a=b
and --alias:a/c=d
, which is ambiguous for the import path a/c/x
(since it could map to either b/c/x
or d/x
). Previously esbuild would pick the first matching alias
, which would non-deterministically pick between one of the possible matches. This release fixes esbuild to always deterministically pick the longest possible match.
Minify calls to some global primitive constructors (#2962)
With this release, esbuild's minifier now replaces calls to Boolean
/Number
/String
/BigInt
with equivalent shorter code when relevant:
// Original code
console.log(
Boolean(a ? (b | c) !== 0 : (c & d) !== 0),
Number(e ? '1' : '2'),
String(e ? '1' : '2'),
BigInt(e ? 1n : 2n),
)
// Old output (with --minify)
console.log(Boolean(a?(b|c)!==0:(c&d)!==0),Number(e?"1":"2"),String(e?"1":"2"),BigInt(e?1n:2n));
// New output (with --minify)
console.log(!!(a?b|c:c&d),+(e?"1":"2"),e?"1":"2",e?1n:2n);
Adjust some feature compatibility tables for node (#2940)
This release makes the following adjustments to esbuild's internal feature compatibility tables for node, which tell esbuild which versions of node are known to support all aspects of that feature:
class-private-brand-checks
: node v16.9+ => node v16.4+ (a decrease)hashbang
: node v12.0+ => node v12.5+ (an increase)optional-chain
: node v16.9+ => node v16.1+ (a decrease)template-literal
: node v4+ => node v10+ (an increase)Each of these adjustments was identified by comparing against data from the node-compat-table
package and was manually verified using old node executables downloaded from https://nodejs.org/download/release/.
Changelog
0.17.7
Change esbuild's parsing of TypeScript instantiation expressions to match TypeScript 4.8+ (#2907)
This release updates esbuild's implementation of instantiation expression erasure to match microsoft/TypeScript#49353. The new rules are as follows (copied from TypeScript's PR description):
When a potential type argument list is followed by
- a line break,
- an
(
token,- a template literal string, or
- any token except
<
or>
that isn't the start of an expression,we consider that construct to be a type argument list. Otherwise we consider the construct to be a
<
relational expression followed by a>
relational expression.
Ignore sideEffects: false
for imported CSS files (#1370, #1458, #2905)
This release ignores the sideEffects
annotation in package.json
for CSS files that are imported into JS files using esbuild's css
loader. This means that these CSS files are no longer be tree-shaken.
Importing CSS into JS causes esbuild to automatically create a CSS entry point next to the JS entry point containing the bundled CSS. Previously packages that specified some form of "sideEffects": false
could potentially cause esbuild to consider one or more of the JS files on the import path to the CSS file to be side-effect free, which would result in esbuild removing that CSS file from the bundle. This was problematic because the removal of that CSS is outwardly observable, since all CSS is global, so it was incorrect for previous versions of esbuild to tree-shake CSS files imported into JS files.
Add constant folding for certain additional equality cases (#2394, #2895)
This release adds constant folding for expressions similar to the following:
// Original input
console.log(
null === 'foo',
null === undefined,
null == undefined,
false === 0,
false == 0,
1 === true,
1 == true,
)
// Old output
console.log(
null === "foo",
null === void 0,
null == void 0,
false === 0,
false == 0,
1 === true,
1 == true
);
// New output
console.log(
false,
false,
true,
false,
true,
false,
true
);