Bump esbuild from 0.14.2 to 0.15.15
Bumps esbuild from 0.14.2 to 0.15.15.
Release notes
Sourced from esbuild's releases.
v0.15.15
Remove duplicate CSS rules across files (#2688)
When two or more CSS rules are exactly the same (even if they are not adjacent), all but the last one can safely be removed:
/* Before */ a { color: red; } span { font-weight: bold; } a { color: red; }/* After */ span { font-weight: bold; } a { color: red; }
Previously esbuild only did this transformation within a single source file. But with this release, esbuild will now do this transformation across source files, which may lead to smaller CSS output if the same rules are repeated across multiple CSS source files in the same bundle. This transformation is only enabled when minifying (specifically when syntax minification is enabled).
Add
denoas a valid value fortarget(#2686)The
targetsetting in esbuild allows you to enable or disable JavaScript syntax features for a given version of a set of target JavaScript VMs. Previously Deno was not one of the JavaScript VMs that esbuild supported withtarget, but it will now be supported starting from this release. For example, versions of Deno older than v1.2 don't support the new||=operator, so adding e.g.--target=deno1.0to esbuild now lets you tell esbuild to transpile||=to older JavaScript.Fix the
esbuild-wasmpackage in Node v19 (#2683)A recent change to Node v19 added a non-writable
cryptoproperty to the global object: nodejs/node#44897. This conflicts with Go's WebAssembly shim code, which overwrites the globalcryptoproperty. As a result, all Go-based WebAssembly code that uses the built-in shim (including esbuild) is now broken on Node v19. This release of esbuild fixes the issue by reconfiguring the globalcryptoproperty to be writable before invoking Go's WebAssembly shim code.Fix CSS dimension printing exponent confusion edge case (#2677)
In CSS, a dimension token has a numeric "value" part and an identifier "unit" part. For example, the dimension token
32pxhas a value of32and a unit ofpx. The unit can be any valid CSS identifier. The value can be any number in floating-point format including an optional exponent (e.g.-3.14e-0has an exponent ofe-0). The full details of this syntax are here: https://www.w3.org/TR/css-syntax-3/.To maintain the integrity of the dimension token through the printing process, esbuild must handle the edge case where the unit looks like an exponent. One such case is the dimension
1e\32which has the value1and the unite2. It would be bad if this dimension token was printed such that a CSS parser would parse it as a number token with the value1e2instead of a dimension token. The way esbuild currently does this is to escape the leadingein the dimension unit, so esbuild would parse1e\32but print1\65 2(both1e\32and1\65 2represent a dimension token with a value of1and a unit ofe2).However, there is an even narrower edge case regarding this edge case. If the value part of the dimension token itself has an
e, then it's not necessary to escape theein the dimension unit because a CSS parser won't confuse the unit with the exponent even though it looks like one (since a number can only have at most one exponent). This came up because the grammar for the CSSunicode-rangeproperty uses a hack that lets you specify a hexadecimal range without quotes even though CSS has no token for a hexadecimal range. The hack is to allow the hexadecimal range to be parsed as a dimension token and optionally also a number token. Here is the grammar forunicode-range:unicode-range = <urange>#<urange> = u '+' <ident-token> '?'* | u <dimension-token> '?'* | u <number-token> '?'* | u <number-token> <dimension-token> | u <number-token> <number-token> | u '+' '?'+
and here is an example
unicode-rangedeclaration that was problematic for esbuild:
... (truncated)
Changelog
Sourced from esbuild's changelog.
Changelog: 2021
This changelog documents all esbuild versions published in the year 2021 (versions 0.8.29 through 0.14.10).
0.14.10
Enable tree shaking of classes with lowered static fields (#175)
If the configured target environment doesn't support static class fields, they are converted into a call to esbuild's
__publicFieldfunction instead. However, esbuild's tree-shaking pass treated this call as a side effect, which meant that all classes with static fields were ineligible for tree shaking. This release fixes the problem by explicitly ignoring calls to the__publicFieldfunction during tree shaking side-effect determination. Tree shaking is now enabled for these classes:// Original code class Foo { static foo = 'foo' } class Bar { static bar = 'bar' } new Bar()// Old output (with --tree-shaking=true --target=es6) class Foo { } __publicField(Foo, "foo", "foo"); class Bar { } __publicField(Bar, "bar", "bar"); new Bar();
// New output (with --tree-shaking=true --target=es6) class Bar { } __publicField(Bar, "bar", "bar"); new Bar();
Treat
--define:foo=undefinedas an undefined literal instead of an identifier (#1407)References to the global variable
undefinedare automatically replaced with the literal value for undefined, which appears asvoid 0when printed. This allows for additional optimizations such as collapsingundefined ?? barinto justbar. However, this substitution was not done for values specified via--define:. As a result, esbuild could potentially miss out on certain optimizations in these cases. With this release, it's now possible to use--define:to substitute something with an undefined literal:// Original code let win = typeof window !== 'undefined' ? window : {}// Old output (with --define:window=undefined --minify) let win=typeof undefined!="undefined"?undefined:{};
// New output (with --define:window=undefined --minify) let win={};
Add the
--drop:debuggerflag (#1809)Passing this flag causes all
debugger;statements to be removed from the output. This is similar to thedrop_debugger: trueflag available in the popular UglifyJS and Terser JavaScript minifiers.
... (truncated)
Commits
478062dpublish 0.15.15 to npme7ad5fbremove duplicate css rules across files (#2688)6664172test duplicate rule merging after bundlinga73c4e9css: merge adjacent selectors forward not backward4b1200ffix #2685:preferUnplugged: truein all packagesec9c3cffix #2686: makedenoa valid value fortarget38c9c1frewrite browser tests to work without runnerd0fd268upgrade puppeteer 5.5.0 => 19.2.2daccf02fix #2683:esbuild-wasmbroken in node v19ecc9eebfix #2677: token unit escaping andunicode-range- Additional commits viewable in compare view
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 rebasewill rebase this PR -
@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it -
@dependabot mergewill merge this PR after your CI passes on it -
@dependabot squash and mergewill squash and merge this PR after your CI passes on it -
@dependabot cancel mergewill cancel a previously requested merge and block automerging -
@dependabot reopenwill reopen this PR if it is closed -
@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually -
@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)