提交学习笔记专用
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.

843 lines
33 KiB

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