Implement initial support for simplifying calc() expressions in CSS (#1607)
This release includes basic simplification of calc() expressions in CSS when minification is enabled. The approach mainly follows the official CSS specification, which means it should behave the way browsers behave: https://www.w3.org/TR/css-values-4/#calc-func. This is a basic implementation so there are probably some calc() expressions that can be reduced by other tools but not by esbuild. This release mainly focuses on setting up the parsing infrastructure for calc() expressions to make it straightforward to implement additional simplifications in the future. Here's an example of this new functionality:
Note that this transformation doesn't attempt to modify any expression containing a var() CSS variable reference. These variable references can contain any number of tokens so it's not safe to move forward with a simplification assuming that var() is a single token. For example, calc(2px * var(--x) * 3) is not transformed into calc(6px * var(--x)) in case var(--x) contains something like 4 + 5px (calc(2px * 4 + 5px * 3) evaluates to 23px while calc(6px * 4 + 5px) evaluates to 29px).
Fix a crash with a legal comment followed by an import (#1730)
Version 0.13.10 introduced parsing for CSS legal comments but caused a regression in the code that checks whether there are any rules that come before @import. This is not desired because browsers ignore @import rules after other non-@import rules, so esbuild warns you when you do this. However, legal comments are modeled as rules in esbuild's internal AST even though they aren't actual CSS rules, and the code that performs this check wasn't updated. This release fixes the crash.
This release adds support for a new upcoming JavaScript feature called class static blocks that lets you evaluate code inside of a class body. It looks like this:
Implement initial support for simplifying calc() expressions in CSS (#1607)
This release includes basic simplification of calc() expressions in CSS when minification is enabled. The approach mainly follows the official CSS specification, which means it should behave the way browsers behave: https://www.w3.org/TR/css-values-4/#calc-func. This is a basic implementation so there are probably some calc() expressions that can be reduced by other tools but not by esbuild. This release mainly focuses on setting up the parsing infrastructure for calc() expressions to make it straightforward to implement additional simplifications in the future. Here's an example of this new functionality:
Note that this transformation doesn't attempt to modify any expression containing a var() CSS variable reference. These variable references can contain any number of tokens so it's not safe to move forward with a simplification assuming that var() is a single token. For example, calc(2px * var(--x) * 3) is not transformed into calc(6px * var(--x)) in case var(--x) contains something like 4 + 5px (calc(2px * 4 + 5px * 3) evaluates to 23px while calc(6px * 4 + 5px) evaluates to 29px).
Fix a crash with a legal comment followed by an import (#1730)
Version 0.13.10 introduced parsing for CSS legal comments but caused a regression in the code that checks whether there are any rules that come before @import. This is not desired because browsers ignore @import rules after other non-@import rules, so esbuild warns you when you do this. However, legal comments are modeled as rules in esbuild's internal AST even though they aren't actual CSS rules, and the code that performs this check wasn't updated. This release fixes the crash.
This release adds support for a new upcoming JavaScript feature called class static blocks that lets you evaluate code inside of a class body. It looks like this:
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.13.3 to 0.13.12.
Release notes
Sourced from esbuild's releases.
... (truncated)
Changelog
Sourced from esbuild's changelog.
... (truncated)
Commits
a133f7d
publish 0.13.12 to npmb32360d
implement "calc()" reduction for css (#1731)2959332
enable tree shaking of "Reflect" static methods602625c
fix #1730: crash with legal comment and@import
bc1a853
enable tree shaking for empty "static {}" blocks4c8f834
publish 0.13.11 to npm8161752
implement class static blocks (#1729)859382e
also handle "super" inside static class fields0aa7f71
fix writing to a "super" property0ea9c51
test coverage for super and object methodsDependabot 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)