@esbuild/linux-arm
Advanced tools
Changelog
0.19.12
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:
// Original code
let el =
<a href={'/'} title=''"'> some text
{foo}
more text </a>
// Old output (with --loader=jsx --jsx=preserve)
let el = <a href="/" title={`'"`}>
{" some text"}
{foo}
{"more text "}
</a>;
// New output (with --loader=jsx --jsx=preserve)
let el = <a href={"/"} title=''"'> some text
{foo}
more text </a>;
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:
let el = <div data-ab=<><a/><b/></>/>;
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:
type InferUnion<T> = T extends { a: infer U extends number } | infer U extends number ? U : never
All esbuild versions published in the year 2022 (versions 0.16.13 through 0.19.11) can be found in CHANGELOG-2023.md.
All esbuild versions published in the year 2022 (versions 0.14.11 through 0.16.12) can be found in CHANGELOG-2022.md.
All esbuild versions published in the year 2021 (versions 0.8.29 through 0.14.10) can be found in CHANGELOG-2021.md.
All esbuild versions published in the year 2020 (versions 0.3.0 through 0.8.28) can be found in CHANGELOG-2020.md.
Changelog
0.18.15
Add the --serve-fallback=
option (#2904)
The web server built into esbuild serves the latest in-memory results of the configured build. If the requested path doesn't match any in-memory build result, esbuild also provides the --servedir=
option to tell esbuild to serve the requested path from that directory instead. And if the requested path doesn't match either of those things, esbuild will either automatically generate a directory listing (for directories) or return a 404 error.
Starting with this release, that last step can now be replaced with telling esbuild to serve a specific HTML file using the --serve-fallback=
option. This can be used to provide a "not found" page for missing URLs. It can also be used to implement a single-page app that mutates the current URL and therefore requires the single app entry point to be served when the page is loaded regardless of whatever the current URL is.
Use the tsconfig
field in package.json
during extends
resolution (#3247)
This release adds a feature from TypeScript 3.2 where if a tsconfig.json
file specifies a package name in the extends
field and that package's package.json
file has a tsconfig
field, the contents of that field are used in the search for the base tsconfig.json
file.
Implement CSS nesting without :is()
when possible (#1945)
Previously esbuild would always produce a warning when transforming nested CSS for a browser that doesn't support the :is()
pseudo-class. This was because the nesting transform needs to generate an :is()
in some complex cases which means the transformed CSS would then not work in that browser. However, the CSS nesting transform can often be done without generating an :is()
. So with this release, esbuild will no longer warn when targeting browsers that don't support :is()
in the cases where an :is()
isn't needed to represent the nested CSS.
In addition, esbuild's nested CSS transform has been updated to avoid generating an :is()
in cases where an :is()
is preferable but there's a longer alternative that is also equivalent. This update means esbuild can now generate a combinatorial explosion of CSS for complex CSS nesting syntax when targeting browsers that don't support :is()
. This combinatorial explosion is necessary to accurately represent the original semantics. For example:
/* Original code */
.first,
.second,
.third {
& > & {
color: red;
}
}
/* Old output (with --target=chrome80) */
:is(.first, .second, .third) > :is(.first, .second, .third) {
color: red;
}
/* New output (with --target=chrome80) */
.first > .first,
.first > .second,
.first > .third,
.second > .first,
.second > .second,
.second > .third,
.third > .first,
.third > .second,
.third > .third {
color: red;
}
This change means you can now use CSS nesting with esbuild when targeting an older browser that doesn't support :is()
. You'll now only get a warning from esbuild if you use complex CSS nesting syntax that esbuild can't represent in that older browser without using :is()
. There are two such cases:
/* Case 1 */
a b {
.foo & {
color: red;
}
}
/* Case 2 */
a {
> b& {
color: red;
}
}
These two cases still need to use :is()
, both for different reasons, and cannot be used when targeting an older browser that doesn't support :is()
:
/* Case 1 */
.foo :is(a b) {
color: red;
}
/* Case 2 */
a > a:is(b) {
color: red;
}
Automatically lower inset
in CSS for older browsers
With this release, esbuild will now automatically expand the inset
property to the top
, right
, bottom
, and left
properties when esbuild's target
is set to a browser that doesn't support inset
:
/* Original code */
.app {
position: absolute;
inset: 10px 20px;
}
/* Old output (with --target=chrome80) */
.app {
position: absolute;
inset: 10px 20px;
}
/* New output (with --target=chrome80) */
.app {
position: absolute;
top: 10px;
right: 20px;
bottom: 10px;
left: 20px;
}
Add support for the new @starting-style
CSS rule (#3249)
This at rule allow authors to start CSS transitions on first style update. That is, you can now make the transition take effect when the display
property changes from none
to block
.
/* Original code */
@starting-style {
h1 {
background-color: transparent;
}
}
/* Output */
@starting-style{h1{background-color:transparent}}
This was contributed by @yisibl.