You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

783 lines
31 KiB

1 month ago
  1. # Changelog
  2. ## v5.37.0
  3. - Reserved object properties from chrome extensions (domprops)
  4. - Fix semicolon insertion between a class property without a semicolon `a` and a computed class property `["prop"]`
  5. ## v5.36.0
  6. - Support import attributes `with` syntax
  7. ## v5.35.0
  8. - Ensure parent directory exists when using --output on CLI (#1530)
  9. ## v5.34.1
  10. - bump the rollup devDependency to disable CVE warnings (Terser was not affected)
  11. ## v5.34.0
  12. - internal: stop assigning properties to objects they don't belong in
  13. - internal: run compress tests in parallel
  14. - `drop_console`: emit an empty function if the return value of `console.METHOD(...)` may be called.
  15. ## v5.33.0
  16. - `reduce_vars` improved when dealing with hoisted function definitions (#1544)
  17. ## v5.32.0
  18. - `import("module")` can now be input and output from ESTree AST (#1557)
  19. - `BigInt` literals can now be input and output from ESTree AST (#1555)
  20. - `typeof` an object or array (`typeof {}` and `typeof []`) can now be statically evaluated. (#1546)
  21. ## v5.31.6
  22. - Retain side effects in a `case` when the expression is a sequence (comma) expression
  23. ## v5.31.5
  24. - Revert v5.31.4, which created mysterious issues #1548, #1549
  25. ## v5.31.4 (reverted)
  26. - drop_unused: drop classes which only have side effects in the `extends` part
  27. ## v5.31.3
  28. - drop_unused: drop unused parameters from IIFEs in some more situations.
  29. ## v5.31.2
  30. - drop_unused: scan variables in self-referential class declarations that contain side effects.
  31. - Don't add parens to arrow function when it's the default for an argument (#1540)
  32. - Update domprops (#1538)
  33. ## v5.31.1
  34. - Allow drop-unused to drop the whole assignment (not just the assigned name) in more situations, in order to avoid duplication of long strings.
  35. ## v5.31.0
  36. - Sync up property mangler exceptions with current contents of Firefox and Chrome environments
  37. - Add more webcomponent properties to property mangler exceptions (#1525)
  38. - Drop non-nullish constants in `...spreads` in objects (#1141)
  39. ## v5.30.4
  40. - Fix parsing `#private in ...` when next to other operators
  41. ## v5.30.3
  42. - Fix precedence of `#private in ...` operator
  43. ## v5.30.2
  44. - Avoid optimizations inside computed keys, because they can cause js-engine-specific bugs.
  45. ## v5.30.1
  46. - Removed useless `\` escapes for non-ascii characters
  47. - Make modern identifier characters quoted for older environments (#1512)
  48. ## v5.30.0
  49. - Improve removal of classes referring to themselves
  50. ## v5.29.2
  51. - Make sure 'computed_props' creates string keys
  52. - Take into account the evaluated size when inlining
  53. ## v5.29.1
  54. - fix optimisation of all-bits mask check
  55. ## v5.29.0
  56. - Re-releases previously reverted 5.28.0
  57. - Fix crash while optimizing some bitwise ops
  58. - (internal) Remove needless wrapper for from_moz (#1499)
  59. ## v5.28.1
  60. (hotfix release)
  61. - Reverts v5.28.0
  62. ## v5.28.0
  63. - Optimise redundant or shrinkable bitwise operations (`|`, `^`, `&`, `>>`, `<<`)
  64. - Evaluate some `BigInt` math operations
  65. ## v5.27.2
  66. - Recognise `this` as a reference to the surrounding class in `drop_unused`. Closes #1472
  67. ## v5.27.1
  68. - Fixed case where `collapse_vars` inlines `await` expressions into non-async functions.
  69. ## v5.27.0
  70. - Created `minify_sync()` alternative to `minify()` since there's no async code left.
  71. ## v5.26.0
  72. - Do not take the `/*#__PURE__*/` annotation into account when the `side_effects` compress option is off.
  73. - The `preserve_annotations` option now automatically opts annotation comments in, instead of requiring the `comments` option to be configured for this.
  74. - Refuse to parse empty parenthesized expressions (`()`)
  75. ## v5.25.0
  76. - Regex properties added to reserved property mangler (#1471)
  77. - `pure_new` option added to drop unused `new` expressions.
  78. ## v5.24.0
  79. - Improve formatting performance in V8 by keeping a small work string and a large output string
  80. ## v5.23.0
  81. - When top_retain will keep a variable assignment around, inline the assignee when it's shorter than the name (#1434)
  82. - Remove empty class `static {}` blocks.
  83. ## v5.22.0
  84. - Do not `unsafe`ly shorten expressions like a?.toString() when they're conditional.
  85. - Avoid running drop_unused in nodes that aren't scopes. Fixes a rare crash.
  86. - When 'module' is enabled, assume strict mode when figuring out scopes.
  87. ## v5.21.0
  88. - Do not inline functions that would be retained in the toplevel (as this would cause code duplication).
  89. - Fix precedence of arrow function and ternary operator when formatting output.
  90. ## v5.20.0
  91. - Passing `minify()` zero files will now throw a clean exception (#1450)
  92. - `drop_console` supports passing in an array of `console.*` method names (#1445)
  93. - New DOM properties from the WebGPU API have been added for use in the property mangler (#1436)
  94. - Internal code simplification (#1437)
  95. ## v5.19.4
  96. - Prevent creating very deeply nested ternaries from a long list of `if..return`
  97. - Prevent inlining classes into other functions, to avoid constructors being compared.
  98. ## v5.19.3
  99. - Fix side effect detection of `optional?.chains`.
  100. - Add roundRect to domprops.js (#1426)
  101. ## v5.19.2
  102. - fix performance hit from avoiding HTML comments in the output
  103. ## v5.19.1
  104. - Better avoid outputting `</script>` and HTML comments.
  105. - Fix unused variables in class static blocks not being dropped correctly.
  106. - Fix sourcemap names of methods that are `async` or `static`
  107. ## v5.19.0
  108. - Allow `/*@__MANGLE_PROP__*/` annotation in `object.property`, in addition to property declarations.
  109. ## v5.18.2
  110. - Stop using recursion in hoisted defuns fix.
  111. ## v5.18.1
  112. - Fix major performance issue caused by hoisted defuns' scopes bugfix.
  113. ## v5.18.0
  114. - Add new `/*@__MANGLE_PROP__*/` annotation, to mark properties that should be mangled.
  115. ## v5.17.7
  116. - Update some dependencies
  117. - Add consistent sorting for `v` RegExp flag
  118. - Add `inert` DOM attribute to domprops
  119. ## v5.17.6
  120. - Fixes to mozilla AST input and output, for class properties, private properties and static blocks
  121. - Fix outputting a shorthand property in quotes when safari10 and ecma=2015 options are enabled
  122. - `configurable` and `enumerable`, used in Object.defineProperty, added to domprops (#1393)
  123. ## v5.17.5
  124. - Take into account the non-deferred bits of a class, such as static properties, while dropping unused code.
  125. ## v5.17.4
  126. - Fix crash when trying to negate a class (`!class{}`)
  127. - Avoid outputting comments between `yield`/`await` and its argument
  128. - Fix detection of left-hand-side of assignment, to avoid optimizing it like any other expression in some edge cases
  129. ## v5.17.3
  130. - Fix issue with trimming a static class property's contents accessing the class as `this`.
  131. ## v5.17.2
  132. - Be less conservative when detecting use-before-definition of `var` in hoisted functions.
  133. - Support unusual (but perfectly valid) initializers of for-in and for-of loops.
  134. - Fix issue where hoisted function would be dropped if it was after a `continue` statement
  135. ## v5.17.1
  136. - Fix evaluating `.length` when the source array might've been mutated
  137. ## v5.17.0
  138. - Drop vestigial `= undefined` default argument in IIFE calls (#1366)
  139. - Evaluate known arrays' `.length` property when statically determinable
  140. - Add `@__KEY__` annotation to mangle string literals (#1365)
  141. ## v5.16.9
  142. - Fix parentheses in output of optional chains (`a?.b`) (#1374)
  143. - More documentation on source maps (#1368)
  144. - New `lhs_constants` option, allowing to stop Terser from swapping comparison operands (#1361)
  145. ## v5.16.8
  146. - Become even less conservative around function definitions for `reduce_vars`
  147. - Fix parsing context of `import.meta` expressions such that method calls are allowed
  148. ## v5.16.6
  149. - Become less conservative with analyzing function definitions for `reduce_vars`
  150. - Parse `import.meta` as a real AST node and not an `object.property`
  151. ## v5.16.5
  152. - Correctly handle AST transform functions that mutate children arrays
  153. - Don't mutate the options object passed to Terser (#1342)
  154. - Do not treat BigInt like a number
  155. ## v5.16.4
  156. - Keep `(defaultArg = undefined) => ...`, because default args don't count for function length
  157. - Prevent inlining variables into `?.` optional chains
  158. - Avoid removing unused arguments while transforming
  159. - Optimize iterating AST node lists
  160. - Make sure `catch` and `finally` aren't children of `try` in the AST
  161. - Use modern unicode property escapes (`\p{...}`) to parse identifiers when available
  162. ## v5.16.3
  163. - Ensure function definitions, don't assume the values of variables defined after them.
  164. ## v5.16.2
  165. - Fix sourcemaps with non-ascii characters (#1318)
  166. - Support string module name and export * as (#1336)
  167. - Do not move `let` out of `for` initializers, as it can change scoping
  168. - Fix a corner case that would generate the invalid syntax `if (something) let x` ("let" in braceless if body)
  169. - Knowledge of more native object properties (#1330)
  170. - Got rid of Travis (#1323)
  171. - Added semi-secret `asObject` sourcemap option to typescript defs (#1321)
  172. ## v5.16.1
  173. - Properly handle references in destructurings (`const { [reference]: val } = ...`)
  174. - Allow parsing of `.#privatefield` in nested classes
  175. - Do not evaluate operations that return large strings if that would make the output code larger
  176. - Make `collapse_vars` handle block scope correctly
  177. - Internal improvements: Typos (#1311), more tests, small-scale refactoring
  178. ## v5.16.0
  179. - Disallow private fields in object bodies (#1011)
  180. - Parse `#privatefield in object` (#1279)
  181. - Compress `#privatefield in object`
  182. ## v5.15.1
  183. - Fixed missing parentheses around optional chains
  184. - Avoid bare `let` or `const` as the bodies of `if` statements (#1253)
  185. - Small internal fixes (#1271)
  186. - Avoid inlining a class twice and creating two equivalent but `!==` classes.
  187. ## v5.15.0
  188. - Basic support for ES2022 class static initializer blocks.
  189. - Add `AudioWorkletNode` constructor options to domprops list (#1230)
  190. - Make identity function inliner not inline `id(...expandedArgs)`
  191. ## v5.14.2
  192. - Security fix for RegExps that should not be evaluated (regexp DDOS)
  193. - Source maps improvements (#1211)
  194. - Performance improvements in long property access evaluation (#1213)
  195. ## v5.14.1
  196. - keep_numbers option added to TypeScript defs (#1208)
  197. - Fixed parsing of nested template strings (#1204)
  198. ## v5.14.0
  199. - Switched to @jridgewell/source-map for sourcemap generation (#1190, #1181)
  200. - Fixed source maps with non-terminated segments (#1106)
  201. - Enabled typescript types to be imported from the package (#1194)
  202. - Extra DOM props have been added (#1191)
  203. - Delete the AST while generating code, as a means to save RAM
  204. ## v5.13.1
  205. - Removed self-assignments (`varname=varname`) (closes #1081)
  206. - Separated inlining code (for inlining things into references, or removing IIFEs)
  207. - Allow multiple identifiers with the same name in `var` destructuring (eg `var { a, a } = x`) (#1176)
  208. ## v5.13.0
  209. - All calls to eval() were removed (#1171, #1184)
  210. - `source-map` was updated to 0.8.0-beta.0 (#1164)
  211. - NavigatorUAData was added to domprops to avoid property mangling (#1166)
  212. ## v5.12.1
  213. - Fixed an issue with function definitions inside blocks (#1155)
  214. - Fixed parens of `new` in some situations (closes #1159)
  215. ## v5.12.0
  216. - `TERSER_DEBUG_DIR` environment variable
  217. - @copyright comments are now preserved with the comments="some" option (#1153)
  218. ## v5.11.0
  219. - Unicode code point escapes (`\u{abcde}`) are not emitted inside RegExp literals anymore (#1147)
  220. - acorn is now a regular dependency
  221. ## v5.10.0
  222. - Massive optimization to max_line_len (#1109)
  223. - Basic support for import assertions
  224. - Marked ES2022 Object.hasOwn as a pure function
  225. - Fix `delete optional?.property`
  226. - New CI/CD pipeline with github actions (#1057)
  227. - Fix reordering of switch branches (#1092), (#1084)
  228. - Fix error when creating a class property called `get`
  229. - Acorn dependency is now an optional peerDependency
  230. - Fix mangling collision with exported variables (#1072)
  231. - Fix an issue with `return someVariable = (async () => { ... })()` (#1073)
  232. ## v5.9.0
  233. - Collapsing switch cases with the same bodies (even if they're not next to each other) (#1070).
  234. - Fix evaluation of optional chain expressions (#1062)
  235. - Fix mangling collision in ESM exports (#1063)
  236. - Fix issue with mutating function objects after a second pass (#1047)
  237. - Fix for inlining object spread `{ ...obj }` (#1071)
  238. - Typescript typings fix (#1069)
  239. ## v5.8.0
  240. - Fixed shadowing variables while moving code in some cases (#1065)
  241. - Stop mangling computed & quoted properties when keep_quoted is enabled.
  242. - Fix for mangling private getter/setter and .#private access (#1060, #1068)
  243. - Array.from has a new optimization when the unsafe option is set (#737)
  244. - Mangle/propmangle let you generate your own identifiers through the nth_identifier option (#1061)
  245. - More optimizations to switch statements (#1044)
  246. ## v5.7.2
  247. - Fixed issues with compressing functions defined in `global_defs` option (#1036)
  248. - New recipe for using Terser in gulp was added to RECIPES.md (#1035)
  249. - Fixed issues with `??` and `?.` (#1045)
  250. - Future reserved words such as `package` no longer require you to disable strict mode to be used as names.
  251. - Refactored huge compressor file into multiple more focused files.
  252. - Avoided unparenthesized `in` operator in some for loops (it breaks parsing because of for..in loops)
  253. - Improved documentation (#1021, #1025)
  254. - More type definitions (#1021)
  255. ## v5.7.1
  256. - Avoided collapsing assignments together if it would place a chain assignment on the left hand side, which is invalid syntax (`a?.b = c`)
  257. - Removed undefined from object expansions (`{ ...void 0 }` -> `{}`)
  258. - Fix crash when checking if something is nullish or undefined (#1009)
  259. - Fixed comparison of private class properties (#1015)
  260. - Minor performance improvements (#993)
  261. - Fixed scope of function defs in strict mode (they are block scoped)
  262. ## v5.7.0
  263. - Several compile-time evaluation and inlining fixes
  264. - Allow `reduce_funcs` to be disabled again.
  265. - Add `spidermonkey` options to parse and format (#974)
  266. - Accept `{get = "default val"}` and `{set = "default val"}` in destructuring arguments.
  267. - Change package.json export map to help require.resolve (#971)
  268. - Improve docs
  269. - Fix `export default` of an anonymous class with `extends`
  270. ## v5.6.1
  271. - Mark assignments to the `.prototype` of a class as pure
  272. - Parenthesize `await` on the left of `**` (while accepting legacy non-parenthesised input)
  273. - Avoided outputting NUL bytes in optimized RegExps, to stop the output from breaking other tools
  274. - Added `exports` to domprops (#939)
  275. - Fixed a crash when spreading `...this`
  276. - Fixed the computed size of arrow functions, which improves their inlining
  277. ## v5.6.0
  278. - Added top-level await
  279. - Beautify option has been removed in #895
  280. - Private properties, getters and setters have been added in #913 and some more commits
  281. - Docs improvements: #896, #903, #916
  282. ## v5.5.1
  283. - Fixed object properties with unicode surrogates on safari.
  284. ## v5.5.0
  285. - Fixed crash when inlining uninitialized variable into template string.
  286. - The sourcemap for dist was removed for being too large.
  287. ## v5.4.0
  288. - Logical assignment
  289. - Change `let x = undefined` to just `let x`
  290. - Removed some optimizations for template strings, placing them behind `unsafe` options. Reason: adding strings is not equivalent to template strings, due to valueOf differences.
  291. - The AST_Token class was slimmed down in order to use less memory.
  292. ## v5.3.8
  293. - Restore node 13 support
  294. ## v5.3.7
  295. Hotfix release, fixes package.json "engines" syntax
  296. ## v5.3.6
  297. - Fixed parentheses when outputting `??` mixed with `||` and `&&`
  298. - Improved hygiene of the symbol generator
  299. ## v5.3.5
  300. - Avoid moving named functions into default exports.
  301. - Enabled transform() for chain expressions. This allows AST transformers to reach inside chain expressions.
  302. ## v5.3.4
  303. - Fixed a crash when hoisting (with `hoist_vars`) a destructuring variable declaration
  304. ## v5.3.3
  305. - `source-map` library has been updated, bringing memory usage and CPU time improvements when reading input source maps (the SourceMapConsumer is now WASM based).
  306. - The `wrap_func_args` option now also wraps arrow functions, as opposed to only function expressions.
  307. ## v5.3.2
  308. - Prevented spread operations from being expanded when the expanded array/object contains getters, setters, or array holes.
  309. - Fixed _very_ slow self-recursion in some cases of removing extraneous parentheses from `+` operations.
  310. ## v5.3.1
  311. - An issue with destructuring declarations when `pure_getters` is enabled has been fixed
  312. - Fixed a crash when chain expressions need to be shallowly compared
  313. - Made inlining functions more conservative to make sure a function that contains a reference to itself isn't moved into a place that can create multiple instances of itself.
  314. ## v5.3.0
  315. - Fixed a crash when compressing object spreads in some cases
  316. - Fixed compiletime evaluation of optional chains (caused typeof a?.b to always return "object")
  317. - domprops has been updated to contain every single possible prop
  318. ## v5.2.1
  319. - The parse step now doesn't accept an `ecma` option, so that all ES code is accepted.
  320. - Optional dotted chains now accept keywords, just like dotted expressions (`foo?.default`)
  321. ## v5.2.0
  322. - Optional chaining syntax is now supported.
  323. - Consecutive await expressions don't have unnecessary parens
  324. - Taking the variable name's length (after mangling) into consideration when deciding to inline
  325. ## v5.1.0
  326. - `import.meta` is now supported
  327. - Typescript typings have been improved
  328. ## v5.0.0
  329. - `in` operator now taken into account during property mangle.
  330. - Fixed infinite loop in face of a reference loop in some situations.
  331. - Kept exports and imports around even if there's something which will throw before them.
  332. - The main exported bundle for commonjs, dist/bundle.min.js is no longer minified.
  333. ## v5.0.0-beta.0
  334. - BREAKING: `minify()` is now async and rejects a promise instead of returning an error.
  335. - BREAKING: Internal AST is no longer exposed, so that it can be improved without releasing breaking changes.
  336. - BREAKING: Lowest supported node version is 10
  337. - BREAKING: There are no more warnings being emitted
  338. - Module is now distributed as a dual package - You can `import` and `require()` too.
  339. - Inline improvements were made
  340. -----
  341. ## v4.8.1 (backport)
  342. - Security fix for RegExps that should not be evaluated (regexp DDOS)
  343. ## v4.8.0
  344. - Support for numeric separators (`million = 1_000_000`) was added.
  345. - Assigning properties to a class is now assumed to be pure.
  346. - Fixed bug where `yield` wasn't considered a valid property key in generators.
  347. ## v4.7.0
  348. - A bug was fixed where an arrow function would have the wrong size
  349. - `arguments` object is now considered safe to retrieve properties from (useful for `length`, or `0`) even when `pure_getters` is not set.
  350. - Fixed erroneous `const` declarations without value (which is invalid) in some corner cases when using `collapse_vars`.
  351. ## v4.6.13
  352. - Fixed issue where ES5 object properties were being turned into ES6 object properties due to more lax unicode rules.
  353. - Fixed parsing of BigInt with lowercase `e` in them.
  354. ## v4.6.12
  355. - Fixed subtree comparison code, making it see that `[1,[2, 3]]` is different from `[1, 2, [3]]`
  356. - Printing of unicode identifiers has been improved
  357. ## v4.6.11
  358. - Read unused classes' properties and method keys, to figure out if they use other variables.
  359. - Prevent inlining into block scopes when there are name collisions
  360. - Functions are no longer inlined into parameter defaults, because they live in their own special scope.
  361. - When inlining identity functions, take into account the fact they may be used to drop `this` in function calls.
  362. - Nullish coalescing operator (`x ?? y`), plus basic optimization for it.
  363. - Template literals in binary expressions such as `+` have been further optimized
  364. ## v4.6.10
  365. - Do not use reduce_vars when classes are present
  366. ## v4.6.9
  367. - Check if block scopes actually exist in blocks
  368. ## v4.6.8
  369. - Take into account "executed bits" of classes like static properties or computed keys, when checking if a class evaluation might throw or have side effects.
  370. ## v4.6.7
  371. - Some new performance gains through a `AST_Node.size()` method which measures a node's source code length without printing it to a string first.
  372. - An issue with setting `--comments` to `false` in the CLI has been fixed.
  373. - Fixed some issues with inlining
  374. - `unsafe_symbols` compress option was added, which turns `Symbol("name")` into just `Symbol()`
  375. - Brought back compress performance improvement through the `AST_Node.equivalent_to(other)` method (which was reverted in v4.6.6).
  376. ## v4.6.6
  377. (hotfix release)
  378. - Reverted code to 4.6.4 to allow for more time to investigate an issue.
  379. ## v4.6.5 (REVERTED)
  380. - Improved compress performance through using a new method to see if two nodes are equivalent, instead of printing them to a string.
  381. ## v4.6.4
  382. - The `"some"` value in the `comments` output option now preserves `@lic` and other important comments when using `//`
  383. - `</script>` is now better escaped in regex, and in comments, when using the `inline_script` output option
  384. - Fixed an issue when transforming `new RegExp` into `/.../` when slashes are included in the source
  385. - `AST_Node.prototype.constructor` now exists, allowing for easier debugging of crashes
  386. - Multiple if statements with the same consequents are now collapsed
  387. - Typescript typings improvements
  388. - Optimizations while looking for surrogate pairs in strings
  389. ## v4.6.3
  390. - Annotations such as `/*#__NOINLINE__*/` and `/*#__PURE__*/` may now be preserved using the `preserve_annotations` output option
  391. - A TypeScript definition update for the `keep_quoted` output option.
  392. ## v4.6.2
  393. - A bug where functions were inlined into other functions with scope conflicts has been fixed.
  394. - `/*#__NOINLINE__*/` annotation fixed for more use cases where inlining happens.
  395. ## v4.6.1
  396. - Fixed an issue where a class is duplicated by reduce_vars when there's a recursive reference to the class.
  397. ## v4.6.0
  398. - Fixed issues with recursive class references.
  399. - BigInt evaluation has been prevented, stopping Terser from evaluating BigInts like it would do regular numbers.
  400. - Class property support has been added
  401. ## v4.5.1
  402. (hotfix release)
  403. - Fixed issue where `() => ({})[something]` was not parenthesised correctly.
  404. ## v4.5.0
  405. - Inlining has been improved
  406. - An issue where keep_fnames combined with functions declared through variables was causing name shadowing has been fixed
  407. - You can now set the ES version through their year
  408. - The output option `keep_numbers` has been added, which prevents Terser from turning `1000` into `1e3` and such
  409. - Internal small optimisations and refactors
  410. ## v4.4.3
  411. - Number and BigInt parsing has been fixed
  412. - `/*#__INLINE__*/` annotation fixed for arrow functions with non-block bodies.
  413. - Functional tests have been added, using [this repository](https://github.com/terser/terser-functional-tests).
  414. - A memory leak, where the entire AST lives on after compression, has been plugged.
  415. ## v4.4.2
  416. - Fixed a problem with inlining identity functions
  417. ## v4.4.1
  418. *note:* This introduced a feature, therefore it should have been a minor release.
  419. - Fixed a crash when `unsafe` was enabled.
  420. - An issue has been fixed where `let` statements might be collapsed out of their scope.
  421. - Some error messages have been improved by adding quotes around variable names.
  422. ## v4.4.0
  423. - Added `/*#__INLINE__*/` and `/*#__NOINLINE__*/` annotations for calls. If a call has one of these, it either forces or forbids inlining.
  424. ## v4.3.11
  425. - Fixed a problem where `window` was considered safe to access, even though there are situations where it isn't (Node.js, workers...)
  426. - Fixed an error where `++` and `--` were considered side-effect free
  427. - `Number(x)` now needs both `unsafe` and and `unsafe_math` to be compressed into `+x` because `x` might be a `BigInt`
  428. - `keep_fnames` now correctly supports regexes when the function is in a variable declaration
  429. ## v4.3.10
  430. - Fixed syntax error when repeated semicolons were encountered in classes
  431. - Fixed invalid output caused by the creation of empty sequences internally
  432. - Scopes are now updated when scopes are inlined into them
  433. ## v4.3.9
  434. - Fixed issue with mangle's `keep_fnames` option, introduced when adding code to keep variable names of anonymous functions
  435. ## v4.3.8
  436. - Typescript typings fix
  437. ## v4.3.7
  438. - Parsing of regex options in the CLI (which broke in v4.3.5) was fixed.
  439. - typescript definition updates
  440. ## v4.3.6
  441. (crash hotfix)
  442. ## v4.3.5
  443. - Fixed an issue with DOS line endings strings separated by `\` and a new line.
  444. - Improved fix for the output size regression related to unused references within the extends section of a class.
  445. - Variable names of anonymous functions (eg: `const x = () => { ... }` or `var func = function () {...}`) are now preserved when keep_fnames is true.
  446. - Fixed performance degradation introduced for large payloads in v4.2.0
  447. ## v4.3.4
  448. - Fixed a regression where the output size was increased when unused classes were referred to in the extends clause of a class.
  449. - Small typescript typings fixes.
  450. - Comments with `@preserve`, `@license`, `@cc_on` as well as comments starting with `/*!` and `/**!` are now preserved by default.
  451. ## v4.3.3
  452. - Fixed a problem where parsing template strings would mix up octal notation and a slash followed by a zero representing a null character.
  453. - Started accepting the name `async` in destructuring arguments with default value.
  454. - Now Terser takes into account side effects inside class `extends` clauses.
  455. - Added parens whenever there's a comment between a return statement and the returned value, to prevent issues with ASI.
  456. - Stopped using raw RegExp objects, since the spec is going to continue to evolve. This ensures Terser is able to process new, unknown RegExp flags and features. This is a breaking change in the AST node AST_RegExp.
  457. ## v4.3.2
  458. - Typescript typing fix
  459. - Ensure that functions can't be inlined, by reduce_vars, into places where they're accessing variables with the same name, but from somewhere else.
  460. ## v4.3.1
  461. - Fixed an issue from 4.3.0 where any block scope within a for loop erroneously had its parent set to the function scopee
  462. - Fixed an issue where compressing IIFEs with argument expansions would result in some parameters becoming undefined
  463. - addEventListener options argument's properties are now part of the DOM properties list.
  464. ## v4.3.0
  465. - Do not drop computed object keys with side effects
  466. - Functions passed to other functions in calls are now wrapped in parentheses by default, which speeds up loading most modules
  467. - Objects with computed properties are now less likely to be hoisted
  468. - Speed and memory efficiency optimizations
  469. - Fixed scoping issues with `try` and `switch`
  470. ## v4.2.1
  471. - Minor refactors
  472. - Fixed a bug similar to #369 in collapse_vars
  473. - Functions can no longer be inlined into a place where they're going to be compared with themselves.
  474. - reduce_funcs option is now legacy, as using reduce_vars without reduce_funcs caused some weird corner cases. As a result, it is now implied in reduce_vars and can't be turned off without turning off reduce_vars.
  475. - Bug which would cause a random stack overflow has now been fixed.
  476. ## v4.2.0
  477. - When the source map URL is `inline`, don't write it to a file.
  478. - Fixed output parens when a lambda literal is the tag on a tagged template string.
  479. - The `mangle.properties.undeclared` option was added. This enables the property mangler to mangle properties of variables which can be found in the name cache, but whose properties are not known to this Terser run.
  480. - The v8 bug where the toString and source representations of regexes like `RegExp("\\\n")` includes an actual newline is now fixed.
  481. - Now we're guaranteed to not have duplicate comments in the output
  482. - Domprops updates
  483. ## v4.1.4
  484. - Fixed a crash when inlining a function into somewhere else when it has interdependent, non-removable variables.
  485. ## v4.1.3
  486. - Several issues with the `reduce_vars` option were fixed.
  487. - Starting this version, we only have a dist/bundle.min.js
  488. ## v4.1.2
  489. - The hotfix was hotfixed
  490. ## v4.1.1
  491. - Fixed a bug where toplevel scopes were being mixed up with lambda scopes
  492. ## v4.1.0
  493. - Internal functions were replaced by `Object.assign`, `Array.prototype.some`, `Array.prototype.find` and `Array.prototype.every`.
  494. - A serious issue where some ESM-native code was broken was fixed.
  495. - Performance improvements were made.
  496. - Support for BigInt was added.
  497. - Inline efficiency was improved. Functions are now being inlined more proactively instead of being inlined only after another Compressor pass.
  498. ## v4.0.2
  499. (Hotfix release. Reverts unmapped segments PR [#342](https://github.com/terser/terser/pull/342), which will be put back on Terser when the upstream issue is resolved)
  500. ## v4.0.1
  501. - Collisions between the arguments of inlined functions and names in the outer scope are now being avoided while inlining
  502. - Unmapped segments are now preserved when compressing a file which has source maps
  503. - Default values of functions are now correctly converted from Mozilla AST to Terser AST
  504. - JSON ⊂ ECMAScript spec (if you don't know what this is you don't need to)
  505. - Export AST_* classes to library users
  506. - Fixed issue with `collapse_vars` when functions are created with the same name as a variable which already exists
  507. - Added `MutationObserverInit` (Object with options for initialising a mutation observer) properties to the DOM property list
  508. - Custom `Error` subclasses are now internally used instead of old-school Error inheritance hacks.
  509. - Documentation fixes
  510. - Performance optimizations
  511. ## v4.0.0
  512. - **breaking change**: The `variables` property of all scopes has become a standard JavaScript `Map` as opposed to the old bespoke `Dictionary` object.
  513. - Typescript definitions were fixed
  514. - `terser --help` was fixed
  515. - The public interface was cleaned up
  516. - Fixed optimisation of `Array` and `new Array`
  517. - Added the `keep_quoted=strict` mode to mangle_props, which behaves more like Google Closure Compiler by mangling all unquoted property names, instead of reserving quoted property names automatically.
  518. - Fixed parent functions' parameters being shadowed in some cases
  519. - Allowed Terser to run in a situation where there are custom functions attached to Object.prototype
  520. - And more bug fixes, optimisations and internal changes
  521. ## v3.17.0
  522. - More DOM properties added to --mangle-properties's DOM property list
  523. - Closed issue where if 2 functions had the same argument name, Terser would not inline them together properly
  524. - Fixed issue with `hasOwnProperty.call`
  525. - You can now list files to minify in a Terser config file
  526. - Started replacing `new Array(<number>)` with an array literal
  527. - Started using ES6 capabilities like `Set` and the `includes` method for strings and arrays
  528. ## v3.16.1
  529. - Fixed issue where Terser being imported with `import` would cause it not to work due to the `__esModule` property. (PR #254 was submitted, which was nice, but since it wasn't a pure commonJS approach I decided to go with my own solution)
  530. ## v3.16.0
  531. - No longer leaves names like Array or Object or window as a SimpleStatement (statement which is just a single expression).
  532. - Add support for sections sourcemaps (IndexedSourceMapConsumer)
  533. - Drops node.js v4 and starts using commonJS
  534. - Is now built with rollup
  535. ## v3.15.0
  536. - Inlined spread syntax (`[...[1, 2, 3], 4, 5] => [1, 2, 3, 4, 5]`) in arrays and objects.
  537. - Fixed typo in compressor warning
  538. - Fixed inline source map input bug
  539. - Fixed parsing of template literals with unnecessary escapes (Like `\\a`)