You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+24
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,29 @@
1
1
# Changelog
2
2
3
+
## Unreleased
4
+
5
+
* Fix optimizations for calls containing spread arguments ([#2445](https://github.com/evanw/esbuild/issues/2445))
6
+
7
+
This release fixes the handling of spread arguments in the optimization of `/* @__PURE__ */` comments, empty functions, and identity functions:
8
+
9
+
```js
10
+
// Original code
11
+
function empty() {}
12
+
function identity(x) { return x }
13
+
/* @__PURE__ */ a(...x)
14
+
/* @__PURE__ */ new b(...x)
15
+
empty(...x)
16
+
identity(...x)
17
+
18
+
// Old output (with --minify --tree-shaking=true)
19
+
...x;...x;...x;...x;
20
+
21
+
// New output (with --minify --tree-shaking=true)
22
+
function identity(n){return n}[...x];[...x];[...x];identity(...x);
23
+
```
24
+
25
+
Previously esbuild assumed arguments with side effects could be directly inlined. This is almost always true except for spread arguments, which are not syntactically valid on their own and which have the side effect of causing iteration, which might have further side effects. Now esbuild will wrap these elements in an unused array so that they are syntactically valid and so that the iteration side effects are preserved.
26
+
3
27
## 0.14.53
4
28
5
29
This release fixes a minor issue with the previous release: I had to rename the package `esbuild-linux-loong64` to `@esbuild/linux-loong64` in the contributed PR because someone registered the package name before I could claim it, and I missed a spot. Hopefully everything is working after this release. I plan to change all platform-specific package names to use the `@esbuild/` scope at some point to avoid this problem in the future.
0 commit comments