UNPKG

9.84 kBMarkdownView Raw
1# Changelog
2
3## v4.6.1
4
5 - Fixed an issue where a class is duplicated by reduce_vars when there's a recursive reference to the class.
6
7## v4.6.0
8
9 - Fixed issues with recursive class references.
10 - BigInt evaluation has been prevented, stopping Terser from evaluating BigInts like it would do regular numbers.
11 - Class property support has been added
12
13## v4.5.1
14
15(hotfix release)
16
17 - Fixed issue where `() => ({})[something]` was not parenthesised correctly.
18
19## v4.5.0
20
21 - Inlining has been improved
22 - An issue where keep_fnames combined with functions declared through variables was causing name shadowing has been fixed
23 - You can now set the ES version through their year
24 - The output option `keep_numbers` has been added, which prevents Terser from turning `1000` into `1e3` and such
25 - Internal small optimisations and refactors
26
27## v4.4.3
28
29 - Number and BigInt parsing has been fixed
30 - `/*#__INLINE__*/` annotation fixed for arrow functions with non-block bodies.
31 - Functional tests have been added, using [this repository](https://github.com/terser/terser-functional-tests).
32 - A memory leak, where the entire AST lives on after compression, has been plugged.
33
34## v4.4.2
35
36 - Fixed a problem with inlining identity functions
37
38## v4.4.1
39
40*note:* This introduced a feature, therefore it should have been a minor release.
41
42 - Fixed a crash when `unsafe` was enabled.
43 - An issue has been fixed where `let` statements might be collapsed out of their scope.
44 - Some error messages have been improved by adding quotes around variable names.
45
46## v4.4.0
47
48 - Added `/*#__INLINE__*/` and `/*#__NOINLINE__*/` annotations for calls. If a call has one of these, it either forces or forbids inlining.
49
50## v4.3.11
51
52 - Fixed a problem where `window` was considered safe to access, even though there are situations where it isn't (Node.js, workers...)
53 - Fixed an error where `++` and `--` were considered side-effect free
54 - `Number(x)` now needs both `unsafe` and and `unsafe_math` to be compressed into `+x` because `x` might be a `BigInt`
55 - `keep_fnames` now correctly supports regexes when the function is in a variable declaration
56
57## v4.3.10
58
59 - Fixed syntax error when repeated semicolons were encountered in classes
60 - Fixed invalid output caused by the creation of empty sequences internally
61 - Scopes are now updated when scopes are inlined into them
62
63## v4.3.9
64 - Fixed issue with mangle's `keep_fnames` option, introduced when adding code to keep variable names of anonymous functions
65
66## v4.3.8
67
68 - Typescript typings fix
69
70## v4.3.7
71
72 - Parsing of regex options in the CLI (which broke in v4.3.5) was fixed.
73 - typescript definition updates
74
75## v4.3.6
76
77(crash hotfix)
78
79## v4.3.5
80
81 - Fixed an issue with DOS line endings strings separated by `\` and a new line.
82 - Improved fix for the output size regression related to unused references within the extends section of a class.
83 - Variable names of anonymous functions (eg: `const x = () => { ... }` or `var func = function () {...}`) are now preserved when keep_fnames is true.
84 - Fixed performance degradation introduced for large payloads in v4.2.0
85
86## v4.3.4
87
88 - Fixed a regression where the output size was increased when unused classes were referred to in the extends clause of a class.
89 - Small typescript typings fixes.
90 - Comments with `@preserve`, `@license`, `@cc_on` as well as comments starting with `/*!` and `/**!` are now preserved by default.
91
92## v4.3.3
93
94 - Fixed a problem where parsing template strings would mix up octal notation and a slash followed by a zero representing a null character.
95 - Started accepting the name `async` in destructuring arguments with default value.
96 - Now Terser takes into account side effects inside class `extends` clauses.
97 - Added parens whenever there's a comment between a return statement and the returned value, to prevent issues with ASI.
98 - 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.
99
100## v4.3.2
101
102 - Typescript typing fix
103 - 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.
104
105## v4.3.1
106
107 - Fixed an issue from 4.3.0 where any block scope within a for loop erroneously had its parent set to the function scopee
108 - Fixed an issue where compressing IIFEs with argument expansions would result in some parameters becoming undefined
109 - addEventListener options argument's properties are now part of the DOM properties list.
110
111## v4.3.0
112
113 - Do not drop computed object keys with side effects
114 - Functions passed to other functions in calls are now wrapped in parentheses by default, which speeds up loading most modules
115 - Objects with computed properties are now less likely to be hoisted
116 - Speed and memory efficiency optimizations
117 - Fixed scoping issues with `try` and `switch`
118
119## v4.2.1
120
121 - Minor refactors
122 - Fixed a bug similar to #369 in collapse_vars
123 - Functions can no longer be inlined into a place where they're going to be compared with themselves.
124 - 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.
125 - Bug which would cause a random stack overflow has now been fixed.
126
127## v4.2.0
128
129 - When the source map URL is `inline`, don't write it to a file.
130 - Fixed output parens when a lambda literal is the tag on a tagged template string.
131 - 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.
132 - The v8 bug where the toString and source representations of regexes like `RegExp("\\\n")` includes an actual newline is now fixed.
133 - Now we're guaranteed to not have duplicate comments in the output
134 - Domprops updates
135
136## v4.1.4
137
138 - Fixed a crash when inlining a function into somewhere else when it has interdependent, non-removable variables.
139
140## v4.1.3
141
142 - Several issues with the `reduce_vars` option were fixed.
143 - Starting this version, we only have a dist/bundle.min.js
144
145## v4.1.2
146
147 - The hotfix was hotfixed
148
149## v4.1.1
150
151 - Fixed a bug where toplevel scopes were being mixed up with lambda scopes
152
153## v4.1.0
154
155 - Internal functions were replaced by `Object.assign`, `Array.prototype.some`, `Array.prototype.find` and `Array.prototype.every`.
156 - A serious issue where some ESM-native code was broken was fixed.
157 - Performance improvements were made.
158 - Support for BigInt was added.
159 - Inline efficiency was improved. Functions are now being inlined more proactively instead of being inlined only after another Compressor pass.
160
161## v4.0.2
162
163(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)
164
165## v4.0.1
166
167 - Collisions between the arguments of inlined functions and names in the outer scope are now being avoided while inlining
168 - Unmapped segments are now preserved when compressing a file which has source maps
169 - Default values of functions are now correctly converted from Mozilla AST to Terser AST
170 - JSON ⊂ ECMAScript spec (if you don't know what this is you don't need to)
171 - Export AST_* classes to library users
172 - Fixed issue with `collapse_vars` when functions are created with the same name as a variable which already exists
173 - Added `MutationObserverInit` (Object with options for initialising a mutation observer) properties to the DOM property list
174 - Custom `Error` subclasses are now internally used instead of old-school Error inheritance hacks.
175 - Documentation fixes
176 - Performance optimizations
177
178## v4.0.0
179
180 - **breaking change**: The `variables` property of all scopes has become a standard JavaScript `Map` as opposed to the old bespoke `Dictionary` object.
181 - Typescript definitions were fixed
182 - `terser --help` was fixed
183 - The public interface was cleaned up
184 - Fixed optimisation of `Array` and `new Array`
185 - 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.
186 - Fixed parent functions' parameters being shadowed in some cases
187 - Allowed Terser to run in a situation where there are custom functions attached to Object.prototype
188 - And more bug fixes, optimisations and internal changes
189
190## v3.17.0
191
192 - More DOM properties added to --mangle-properties's DOM property list
193 - Closed issue where if 2 functions had the same argument name, Terser would not inline them together properly
194 - Fixed issue with `hasOwnProperty.call`
195 - You can now list files to minify in a Terser config file
196 - Started replacing `new Array(<number>)` with an array literal
197 - Started using ES6 capabilities like `Set` and the `includes` method for strings and arrays
198
199## v3.16.1
200
201 - 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)
202
203## v3.16.0
204
205 - No longer leaves names like Array or Object or window as a SimpleStatement (statement which is just a single expression).
206 - Add support for sections sourcemaps (IndexedSourceMapConsumer)
207 - Drops node.js v4 and starts using commonJS
208 - Is now built with rollup
209
210## v3.15.0
211
212 - Inlined spread syntax (`[...[1, 2, 3], 4, 5] => [1, 2, 3, 4, 5]`) in arrays and objects.
213 - Fixed typo in compressor warning
214 - Fixed inline source map input bug
215 - Fixed parsing of template literals with unnecessary escapes (Like `\\a`)