Update dependency esbuild to v0.20.1 #539
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.19.11
->0.20.1
Release Notes
evanw/esbuild (esbuild)
v0.20.1
Compare Source
Fix a bug with the CSS nesting transform (#3648)
This release fixes a bug with the CSS nesting transform for older browsers where the generated CSS could be incorrect if a selector list contained a pseudo element followed by another selector. The bug was caused by incorrectly mutating the parent rule's selector list when filtering out pseudo elements for the child rules:
Constant folding for JavaScript inequality operators (#3645)
This release introduces constant folding for the
< > <= >=
operators. The minifier will now replace these operators withtrue
orfalse
when both sides are compile-time numeric or string constants:Better handling of
__proto__
edge cases (#3651)JavaScript object literal syntax contains a special case where a non-computed property with a key of
__proto__
sets the prototype of the object. This does not apply to computed properties or to properties that use the shorthand property syntax introduced in ES6. Previously esbuild didn't correctly preserve the "sets the prototype" status of properties inside an object literal, meaning a property that sets the prototype could accidentally be transformed into one that doesn't and vice versa. This has now been fixed:Fix cross-platform non-determinism with CSS color space transformations (#3650)
The Go compiler takes advantage of "fused multiply and add" (FMA) instructions on certain processors which do the operation
x*y + z
without intermediate rounding. This causes esbuild's CSS color space math to differ on different processors (currentlyppc64le
ands390x
), which breaks esbuild's guarantee of deterministic output. To avoid this, esbuild's color space math now inserts afloat64()
cast around every single math operation. This tells the Go compiler not to use the FMA optimization.Fix a crash when resolving a path from a directory that doesn't exist (#3634)
This release fixes a regression where esbuild could crash when resolving an absolute path if the source directory for the path resolution operation doesn't exist. While this situation doesn't normally come up, it could come up when running esbuild concurrently with another operation that mutates the file system as esbuild is doing a build (such as using
git
to switch branches). The underlying problem was a regression that was introduced in version 0.18.0.v0.20.0
Compare Source
This release deliberately contains backwards-incompatible changes. To avoid automatically picking up releases like this, you should either be pinning the exact version of
esbuild
in yourpackage.json
file (recommended) or be using a version range syntax that only accepts patch upgrades such as^0.19.0
or~0.19.0
. See npm's documentation about semver for more information.This time there is only one breaking change, and it only matters for people using Deno. Deno tests that use esbuild will now fail unless you make the change described below.
Work around API deprecations in Deno 1.40.x (#3609, #3611)
Deno 1.40.0 was just released and introduced run-time warnings about certain APIs that esbuild uses. With this release, esbuild will work around these run-time warnings by using newer APIs if they are present and falling back to the original APIs otherwise. This should avoid the warnings without breaking compatibility with older versions of Deno.
Unfortunately, doing this introduces a breaking change. The newer child process APIs lack a way to synchronously terminate esbuild's child process, so calling
esbuild.stop()
from within a Deno test is no longer sufficient to prevent Deno from failing a test that uses esbuild's API (Deno fails tests that create a child process without killing it before the test ends). To work around this, esbuild'sstop()
function has been changed to return a promise, and you now have to changeesbuild.stop()
toawait esbuild.stop()
in all of your Deno tests.Reorder implicit file extensions within
node_modules
(#3341, #3608)In version 0.18.0, esbuild changed the behavior of implicit file extensions within
node_modules
directories (i.e. in published packages) to prefer.js
over.ts
even when the--resolve-extensions=
order prefers.ts
over.js
(which it does by default). However, doing that also accidentally made esbuild prefer.css
over.ts
, which caused problems for people that published packages containing both TypeScript and CSS in files with the same name.With this release, esbuild will reorder TypeScript file extensions immediately after the last JavaScript file extensions in the implicit file extension order instead of putting them at the end of the order. Specifically the default implicit file extension order is
.tsx,.ts,.jsx,.js,.css,.json
which used to become.jsx,.js,.css,.json,.tsx,.ts
innode_modules
directories. With this release it will now become.jsx,.js,.tsx,.ts,.css,.json
instead.Why even rewrite the implicit file extension order at all? One reason is because the
.js
file is more likely to behave correctly than the.ts
file. The behavior of the.ts
file may depend ontsconfig.json
and thetsconfig.json
file may not even be published, or may useextends
to refer to a basetsconfig.json
file that wasn't published. People can get into this situation when they forget to add all.ts
files to their.npmignore
file before publishing to npm. Picking.js
over.ts
helps make it more likely that resulting bundle will behave correctly.v0.19.12
Compare Source
The "preserve" JSX mode now preserves JSX text verbatim (#3605)
The JSX specification deliberately doesn't specify how JSX text is supposed to be interpreted and there is no canonical way to interpret JSX text. Two most popular interpretations are Babel and TypeScript. Yes they are different (esbuild deliberately follows TypeScript by the way).
Previously esbuild normalized text to the TypeScript interpretation when the "preserve" JSX mode is active. However, "preserve" should arguably reproduce the original JSX text verbatim so that whatever JSX transform runs after esbuild is free to interpret it however it wants. So with this release, esbuild will now pass JSX text through unmodified:
Allow JSX elements as JSX attribute values
JSX has an obscure feature where you can use JSX elements in attribute position without surrounding them with
{...}
. It looks like this:I think I originally didn't implement it even though it's part of the JSX specification because it previously didn't work in TypeScript (and potentially also in Babel?). However, support for it was silently added in TypeScript 4.8 without me noticing and Babel has also since fixed their bugs regarding this feature. So I'm adding it to esbuild too now that I know it's widely supported.
Keep in mind that there is some ongoing discussion about removing this feature from JSX. I agree that the syntax seems out of place (it does away with the elegance of "JSX is basically just XML with
{...}
escapes" for something arguably harder to read, which doesn't seem like a good trade-off), but it's in the specification and TypeScript and Babel both implement it so I'm going to have esbuild implement it too. However, I reserve the right to remove it from esbuild if it's ever removed from the specification in the future. So use it with caution.Fix a bug with TypeScript type parsing (#3574)
This release fixes a bug with esbuild's TypeScript parser where a conditional type containing a union type that ends with an infer type that ends with a constraint could fail to parse. This was caused by the "don't parse a conditional type" flag not getting passed through the union type parser. Here's an example of valid TypeScript code that previously failed to parse correctly:
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.