Fix a tree-shaking bug that removed side effects (#3195)
This fixes a regression in version 0.18.4 where combining --minify-syntax with --keep-names could cause expressions with side effects after a function declaration to be considered side-effect free for tree shaking purposes. The reason was because --keep-names generates an expression statement containing a call to a helper function after the function declaration with a special flag that makes the function call able to be tree shaken, and then --minify-syntax could potentially merge that expression statement with following expressions without clearing the flag. This release fixes the bug by clearing the flag when merging expression statements together.
Fix an incorrect warning about CSS nesting (#3197)
A warning is currently generated when transforming nested CSS to a browser that doesn't support :is() because transformed nested CSS may need to use that feature to represent nesting. This was previously always triggered when an at-rule was encountered in a declaration context. Typically the only case you would encounter this is when using CSS nesting within a selector rule. However, there is a case where that's not true: when using a margin at-rule such as @top-left within @page. This release avoids incorrectly generating a warning in this case by checking that the at-rule is within a selector rule before generating a warning.
v0.18.9
Fix await using declarations inside async generator functions
I forgot about the new await using declarations when implementing lowering for async generator functions in the previous release. This change fixes the transformation of await using declarations when they are inside lowered async generator functions:
// Original code
async function* foo() {
await using x = await y
}
// Old output (with --supported:async-generator=false)
function foo() {
return __asyncGenerator(this, null, function* () {
await using x = yield new __await(y);
});
}
// New output (with --supported:async-generator=false)
function foo() {
return __asyncGenerator(this, null, function* () {
var _stack = [];
try {
const x = __using(stack, yield new __await(y), true);
} catch () {
var _error = _, _hasError = true;
} finally {
var _promise = __callDispose(_stack, _error, _hasError);
_promise && (yield new __await(_promise));
}
});
}
Insert some prefixed CSS properties when appropriate (#3122)
With this release, esbuild will now insert prefixed CSS properties in certain cases when the target setting includes browsers that require a certain prefix. This is currently done for the following properties:
Fix a tree-shaking bug that removed side effects (#3195)
This fixes a regression in version 0.18.4 where combining --minify-syntax with --keep-names could cause expressions with side effects after a function declaration to be considered side-effect free for tree shaking purposes. The reason was because --keep-names generates an expression statement containing a call to a helper function after the function declaration with a special flag that makes the function call able to be tree shaken, and then --minify-syntax could potentially merge that expression statement with following expressions without clearing the flag. This release fixes the bug by clearing the flag when merging expression statements together.
Fix an incorrect warning about CSS nesting (#3197)
A warning is currently generated when transforming nested CSS to a browser that doesn't support :is() because transformed nested CSS may need to use that feature to represent nesting. This was previously always triggered when an at-rule was encountered in a declaration context. Typically the only case you would encounter this is when using CSS nesting within a selector rule. However, there is a case where that's not true: when using a margin at-rule such as @top-left within @page. This release avoids incorrectly generating a warning in this case by checking that the at-rule is within a selector rule before generating a warning.
0.18.9
Fix await using declarations inside async generator functions
I forgot about the new await using declarations when implementing lowering for async generator functions in the previous release. This change fixes the transformation of await using declarations when they are inside lowered async generator functions:
// Original code
async function* foo() {
await using x = await y
}
// Old output (with --supported:async-generator=false)
function foo() {
return __asyncGenerator(this, null, function* () {
await using x = yield new __await(y);
});
}
// New output (with --supported:async-generator=false)
function foo() {
return __asyncGenerator(this, null, function* () {
var _stack = [];
try {
const x = __using(stack, yield new __await(y), true);
} catch () {
var _error = _, _hasError = true;
} finally {
var _promise = __callDispose(_stack, _error, _hasError);
_promise && (yield new __await(_promise));
}
});
}
Insert some prefixed CSS properties when appropriate (#3122)
With this release, esbuild will now insert prefixed CSS properties in certain cases when the target setting includes browsers that require a certain prefix. This is currently done for the following properties:
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 ignore this major version` will 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 version` will 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 dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps esbuild from 0.18.6 to 0.18.10.
Release notes
Sourced from esbuild's releases.
... (truncated)
Changelog
Sourced from esbuild's changelog.
... (truncated)
Commits
cdb6c7c
publish 0.18.10 to npm8a15942
fix #3197: css nesting warning in selector subtreeb677152
fix #3195: tree-shaking bug that didn't keep coded568ff0
publish 0.18.9 to npm7e10dd6
fix #2041: add text loader data to source maps9ed47f5
fix #3122: prefix some more css properties9d8a7e5
prefix some css properties (#3122)33322d2
switch css minify from in-place to a new arraya4e2a1e
minify: shorter printing of ts enum property keysdc913df
printer: extract enum inlining into a helperDependabot 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 ignore this major version` will 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 version` will 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 dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)