Ecosyste.ms: OpenCollective
An open API service for software projects hosted on Open Collective.
github.com/terser/terser
🗜 JavaScript parser, mangler and compressor toolkit for ES6+
https://github.com/terser/terser
- use a single AST_Toplevel node for all files
- keep original source filename in the tokens
c4f8c2103fd77e3a6666034c2ca19a5ef09fe68b authored over 12 years ago by Mihai Bazon <[email protected]>
e8da72d304778cdaf4570f24838effee73f6b993 authored over 12 years ago by Mihai Bazon <[email protected]>
d53e1a9931d29c875d2bb23e50a2d2f535b01890 authored over 12 years ago by Mihai Bazon <[email protected]>
a4d2340c7325ff864d2ca3937d8556eb4cbd7437 authored over 12 years ago by Mihai Bazon <[email protected]>
669874d46b42a6241f271c57d8f731ba0a2ca61a authored over 12 years ago by Mihai Bazon <[email protected]>
3da0ac4897e1b12adbdedbfa1c3a145931f0af56 authored over 12 years ago by Mihai Bazon <[email protected]>
21968285e8fad1cfe775b389c6bcd16e14b62c6c authored over 12 years ago by Mihai Bazon <[email protected]>
d91613b4a8318b7fdd0d18cf6550e6670c59f71e authored over 12 years ago by Mihai Bazon <[email protected]>
because https://github.com/mishoo/UglifyJS2/commit/43fd45154bac89b89330e13bd1f167e2a927a23c#comm...
ee669ba8784a37805cd699cc0ca38e335982eb59 authored over 12 years ago by Mihai Bazon <[email protected]>e370e3b5a4fcde13402f910a34b736847fe49a9e authored over 12 years ago by Mihai Bazon <[email protected]>
6ad414ef28e64ff7c53ee89e737f4e9d7cd2f009 authored over 12 years ago by Mihai Bazon <[email protected]>
45a3970ca35e0c640a761601d0854a4c7c5a5cf0 authored over 12 years ago by Mihai Bazon <[email protected]>
if undefined is defined, ;-), we replace AST_Undefined nodes to a reference
to the "undefined" v...
14481de0e9141eff41877f56876f7e6a78c3d059 authored over 12 years ago by Mihai Bazon <[email protected]>
07f1d56f69a5190d33400d4e5d4032edcaf016ff authored over 12 years ago by Mihai Bazon <[email protected]>
5e60a60b3b9ddea872187cf6568ebbcad58c1a60 authored over 12 years ago by Mihai Bazon <[email protected]>
5d781ec6f8689f102db1c0666c725bd64b463df2 authored over 12 years ago by Mihai Bazon <[email protected]>
0f418d654e035b8547340c4d4c03802a01a532b8 authored over 12 years ago by Mihai Bazon <[email protected]>
21c34a17922f826d3c1d1fa230fb08788393f69b authored over 12 years ago by Mihai Bazon <[email protected]>
optimizations of if/return/continue seem to be even better now
7b6a402916fe697049c38f6ee89c644fcf93c8d4 authored over 12 years ago by Mihai Bazon <[email protected]>
if (foo) continue;
...body...
==>
if (!foo) { ...body ... }
Only when the parent block is the...
397bf56d2597d4c2849e380e103b92b87303785f authored over 12 years ago by Mihai Bazon <[email protected]>4e0262bdfb4097a2d2ff000d38f5c847631f0eb2 authored over 12 years ago by Mihai Bazon <[email protected]>
var XXX;
for (var YYY; ...)
==>
for (var XXX,YYY; ...)
86c14d0988960b5fc52551f143f0ae4361794b4b authored over 12 years ago by Mihai Bazon <[email protected]>shortened to x === void 0 (or x === [][0] in unsafe mode)
43fd45154bac89b89330e13bd1f167e2a927a23c authored over 12 years ago by Mihai Bazon <[email protected]>when unsafe, compress undefined as [][0]
50d1670e4266b7cefaccb4eef779ee6e08c980e1 authored over 12 years ago by Mihai Bazon <[email protected]>
function f() {
if (foo) return x();
if (!bar) return y();
}
==>
function f() {
return fo...
- a = a + x ==> a+=x
- joining consecutive var statements (hoisting is not always desirable)
- x...
93b973c99dd25aeff66ff31f2881e9ce252eaac6 authored over 12 years ago by Mihai Bazon <[email protected]>
- do multiple passes in tighten_body if it was changed
- transform if (foo) return x; return y; ...
f5027ec1fc67d6daeb51714eeddd06350cae00d6 authored over 12 years ago by Mihai Bazon <[email protected]>
a132841fb920f6815eb6d153f4329242354f1cae authored over 12 years ago by Mihai Bazon <[email protected]>
prefer to always use > and >= operators (idea from Closure)
2b1e4628e0ee3e73d2e9d00635e51067ec36cd52 authored over 12 years ago by Mihai Bazon <[email protected]>2b4093ba8342b79bac3f9f89428817231728bb01 authored over 12 years ago by Mihai Bazon <[email protected]>
9a629abe00101d56ccc1a9bd01a90b9f7f19421f authored over 12 years ago by Mihai Bazon <[email protected]>
- all symbols now have a `thedef` property which is a SymbolDef object,
instead of the `uniq` ...
- discard statements with no side effects (unsafe? could be)
- safer hoist_vars (needs some reva...
1579c0fb97bb781a624199decab92e19c77d74d6 authored over 12 years ago by Mihai Bazon <[email protected]>
6b9aeb5325203a9f4c8e3bdd6bd3f45f8520ee2e authored over 12 years ago by Mihai Bazon <[email protected]>
a41e6cfabb0befc0b71c95aa55ac0568cce36518 authored over 12 years ago by Mihai Bazon <[email protected]>
16b12c62875c67a7ca50f6ee184dcb6f476ea350 authored over 12 years ago by Mihai Bazon <[email protected]>
1c8ba35844f4032fd9f12961a0feee1a78153aa3 authored over 12 years ago by Mihai Bazon <[email protected]>
( v1 report: https://github.com/mishoo/UglifyJS/pull/458 )
5a8e6ce735f6fbdf32fc730735843b225424e357 authored over 12 years ago by Mihai Bazon <[email protected]>43c75c9248f3f2fe3732b263fc03d73528f005c8 authored over 12 years ago by Mihai Bazon <[email protected]>
048d6906ae6f43b60cfb0c025c242743f6d2c16f authored over 12 years ago by Mihai Bazon <[email protected]>
a few more tests and some cleanups.
919b2733ab52d3072bb4276210fe442bc0ade5fd authored over 12 years ago by Mihai Bazon <[email protected]>b77574ea1c25e2630dcde000ae0fa32b01f8311e authored over 12 years ago by Mihai Bazon <[email protected]>
9bb1a84d6bef8fa95d025d65bd0c2772bceca404 authored over 12 years ago by Mihai Bazon <[email protected]>
0afafe64fcbaf720889b8906a91dafb6dc409cdd authored over 12 years ago by Mihai Bazon <[email protected]>
c7b484b64fdce8ed922f18376b7edf3cb40112f1 authored over 12 years ago by Mihai Bazon <[email protected]>
and finally it seems we beat v1 in terms of compression
0503513dcc9e4dc9f01ffc894245076de9f48cb0 authored over 12 years ago by Mihai Bazon <[email protected]>
The following nodes were instances of AST_BlockStatement: AST_Scope,
AST_SwitchBlock, AST_Switch...
1b5183dd5ee7d2b147f5862c9abf8f45f50fc82f authored over 12 years ago by Mihai Bazon <[email protected]>
optimize away while(false), and transform while(true) ==> for(;;).
UNSAFE:
some expressions ar...
376667a8188083e4e64ef56bf10f38e4f831447f authored over 12 years ago by Mihai Bazon <[email protected]>3459c40cf9d17c6c791a86d387bba85e965c37b6 authored over 12 years ago by Mihai Bazon <[email protected]>
86cfb5be86603b472085920a82905b22c9d06fea authored over 12 years ago by Mihai Bazon <[email protected]>
e5f1cec6aa5998a681ad3c890a07d62d0cbb8d06 authored over 12 years ago by Mihai Bazon <[email protected]>
(XXX: should add tests before anything else)
37eecc16a419361672c0c055e0246ee7deb439b7 authored over 12 years ago by Mihai Bazon <[email protected]>f03138daa805c01293a2b60f96231989906aca59 authored over 12 years ago by Mihai Bazon <[email protected]>
f70226461732321780a04f5c5dd02ed753ede0cf authored over 12 years ago by Mihai Bazon <[email protected]>
6d0db4ce14fd67681bdda1d1861517763eff4c6e authored over 12 years ago by Mihai Bazon <[email protected]>
This fixes output for:
if (foo) {
moo: if (bar) {
break moo;
}
...
d6efa8b28dc0a937bc154bf5f2e5d5450be5c1d5 authored over 12 years ago by Mihai Bazon <[email protected]>
replace nodes with a single statement.
looks stable for now, though mess begins to sink in. nee...
66c869c8f6d4392efb56a15c6663a1f93b74da88 authored over 12 years ago by Mihai Bazon <[email protected]>Revert "minor perf. improvements"
This reverts commit 24bfd55a22afd791d4a97694641831cfbd27fb14.
...
596af60587a9badd43846aede9936e68868e61b2 authored over 12 years ago by Mihai Bazon <[email protected]>
f2f370cee3708c0d9431594f81e192099fc6900c authored over 12 years ago by Mihai Bazon <[email protected]>
24bfd55a22afd791d4a97694641831cfbd27fb14 authored over 12 years ago by Mihai Bazon <[email protected]>
plugged in @fitzgen's source-map library
52bcca288fe560670584b24cb170f09c250514e6 authored over 12 years ago by Mihai Bazon <[email protected]>48440dc250d0a8b72a8064fa97760fe9962f7511 authored over 12 years ago by Mihai Bazon <[email protected]>
6569e66bf87e5b170ac01f52b32e66639d09b899 authored over 12 years ago by Mihai Bazon <[email protected]>
86cff2029f15b0883622957a5a98d9c27956914e authored over 12 years ago by Mihai Bazon <[email protected]>
[1,,2,] ==> [1,,2] instead of [1,undefined,2]
1b6bcca7170c8f08f255448533c211cdb1010f34 authored over 12 years ago by Mihai Bazon <[email protected]>
if (foo) {
with (bar)
if (baz)
x();
} else y();
(the compressor removes the bracket...
7fcb6bcb1270d1688512e25704125edb5b35b3c5 authored over 12 years ago by Mihai Bazon <[email protected]>ce8e8d57c0d346dba9527b7a11b03364ce9ad1bb authored over 12 years ago by Mihai Bazon <[email protected]>
bf70205b15ae11135c8e4e7bd99cecff28df73ba authored over 12 years ago by Mihai Bazon <[email protected]>
58a3b5e93f2b8390bc5e091c03ceb3feae5c4e39 authored over 12 years ago by Mihai Bazon <[email protected]>
8dfa9fe7e58c742b7835523daa423b12ada2718c authored over 12 years ago by Mihai Bazon <[email protected]>
4437e7af1931f995686511938ad80f704ef5925e authored over 12 years ago by Mihai Bazon <[email protected]>
a8e49f15361cce98fdecb20535df4b4f0de553ca authored over 12 years ago by Mihai Bazon <[email protected]>
8d233c38d485020bdb9d86865cf50a8199fbfc27 authored over 12 years ago by Mihai Bazon <[email protected]>
95b18e54a4632cc06a4fb36fbf631c6b1d852892 authored over 12 years ago by Mihai Bazon <[email protected]>
159a6f048cfabc6bdee0bb1274eeb0d6ab75b79a authored over 12 years ago by Mihai Bazon <[email protected]>
the statements if, for, do, while and with might have an AST_EmptyStatement
as body; if that's t...
fb8c9e3a48501c0a49ec30ba0a60cad7053adc3f authored over 12 years ago by Mihai Bazon <[email protected]>
1b839eb35bfb7cb28c59ee80bd88e395f33711ca authored over 12 years ago by Mihai Bazon <[email protected]>
ffe58a9961ced012b40c16b93f9fe2370293431b authored over 12 years ago by Mihai Bazon <[email protected]>
(moved pretty much everything that relates to scope in scope.js, added a
module for NodeJS that ...
(they can't be handled the same way as variables in a scope)
92bd53b513c6cf030d96ed627efc50dd1875ba85 authored over 12 years ago by Mihai Bazon <[email protected]>159333f4c51e70a758160975a190646ff55bf66b authored over 12 years ago by Mihai Bazon <[email protected]>
- added walker for AST_ObjectProperty
- handle redefinitions properly (only mangle one symbol, m...
458e251d7ed6e9ac97849237264caa40a40c76b3 authored over 12 years ago by Mihai Bazon <[email protected]>
1fe0ff9fff86b5d5fba3f4d1499479d2f23511df authored over 12 years ago by Mihai Bazon <[email protected]>
6c35135ace95bb90c33cadeb8c16a43415eef454 authored over 12 years ago by Mihai Bazon <[email protected]>
4488758d485b0b624d4858f764bdf08b10365d3b authored over 12 years ago by Mihai Bazon <[email protected]>
cd8ae5f712fa64ac2d6dff0c5028d8bc70d331ed authored over 12 years ago by Mihai Bazon <[email protected]>
who would have thought that str.charAt(str.length - 1) is not a constant,
instant operation? se...
901f77047e581c79132f93451f057629788d0e9f authored over 12 years ago by Mihai Bazon <[email protected]>
07cbc8d3afee368ed143f62302d1b1a51e0f09bc authored over 12 years ago by Mihai Bazon <[email protected]>
4fb6021b0bd68fff881adfe2781e991f9fd2416f authored over 12 years ago by Mihai Bazon <[email protected]>