Conversation
33a049b to
c7ec490
Compare
|
That's a great hack! Never would have thought of that. I think we'll hold off merging this as I had limited success running some of its tests locally against By the way, when I run this PR against master with for a few minutes with 0% CPU. wait... as I write this: Mind you, I don't know if it runs correctly on @alexlamsl Does it run to completion successfully on your machine? What's your OS and node version? |
|
It does run successfully the whole day until just now when I was checking it out against #1450. Then, as I was pulling my hair out, you just reported the exact same breakage but against So I think that site might be under maintenance. You know, Murphy's Law. |
Doesn't necessarily mean |
|
I just run against
|
|
I think it's a time-out on the |
|
@kzc I've found the root cause - it's to do with me forgetting to flush So OSX / macOS have a shallower buffer than Windows 😜 |
|
@kzc please try again to see if this works? |
Indeed I don't expect this to merge, at least not immediately. I'll add |
|
With the latest change it now appears to work against That's pretty awesome. The script |
|
That is a great idea - in fact what I did for But let's just hard-code this one dependency within |
|
@alexlamsl Your script works so well that I'm not sure uglify is really being run. ;-) Could the script print uglify compress stats for each js file - original size and uglify size? Or perhaps just save the original js files to |
|
Right, let me do this |
|
I did not know that Having said that - it needs before/after size info and total uglify time! |
My thought exactly. Hint for a new PR has been well taken. 😜 |
|
@alexlamsl FWIW, here are some test results with different compress options on Mac... // tested against master 7f8d72d9d37396f2da05d5d824f74bd414c30119
var uglifyjs = fork("bin/uglifyjs",
[ "-mc", "warnings=false" ], // SUCCESS
// [ "-mc", "passes=2,warnings=false" ], // SUCCESS
// [ "-mc", "passes=3,warnings=false" ], // FAIL: mandreel: TypeError: undefined is not an object
// [ "-mc", "collapse_vars,passes=2,warnings=false" ], // SUCCESS
// [ "-mc", "collapse_vars,reduce_vars,warnings=false" ], // SUCCESS
// [ "-mc", "collapse_vars,warnings=false" ], // SUCCESS
// [ "-mc", "collapse_vars,passes=3,warnings=false" ], // UNKNOWN - script does not return
// [ "-mc", "reduce_vars,warnings=false" ], // FAIL in pdfjs.js
// [ "-mc", "collapse_vars,reduce_vars,passes=3,warnings=false" ], // FAIL in pdfjs.js
// [ "-mc", "collapse_vars,reduce_vars,passes=2,warnings=false" ], // FAIL in pdfjs.js
// [ "-mc", "collapse_vars,reduce_vars,warnings=false" ], // FAIL in pdfjs.js
// [ "-mc", "reduce_vars,passes=2,warnings=false" ], // FAIL in pdfjs.js
// [ "-mc", "unsafe,collapse_vars,reduce_vars,passes=2,warnings=false" ], // FAIL in pdfjs.js
{ silent: true }
);There might be genuine bugs in uglify in some compress options or some flakey I/O with node or |
|
@kzc thanks for testing (as always) 👍 The socket time-outs (which is 2 minutes by default) is most likely the cause for The script can also take in custom cli options just like Edit: that particular set of options ends with |
|
Can you try running the options that led to the pdfjs.js failures? |
Going through your list, one at a time 😎 |
|
Your errors may be different because you're running Chakra Node? |
|
That's probably true, especially when it comes to things like out of stack space. I just managed to crash the |
|
Perhaps pdf.js gets its input(s) in an async fashion that could fail. There may be a non-deterministic factor in there. |
|
Could |
|
Better still - instead of emitting: What do you think about emitting the following? |
|
or emit: |
|
That last one is probably better in terms of reading on a (narrow?) console output window. |
|
The parallel option is great for speed, but not so much for output. It's now jumbled. |
How so? By parallel I mean running multiple instances of |
|
Perhaps I'm mistaken - I thought you'd see each command followed by the uglify stats? Your new script runs in 3 minutes. The older one took 3:30. |
|
Oh you mean multiple instances of That is a zero-day "feature" due to the nature of |
I'm only running a single |
Yup - but that one instance of I'll now work to serialise the console output so as to improve readability. |
|
stdout and stderr output is broken in early 6.x versions of as per https://github.com/mishoo/UglifyJS2/blob/master/tools/node.js#L1-L5 |
|
Now that I keep typing out those parameters, wouldn't |
Perhaps when we replace yargs. Instead of |
That is actually on my TODO list - I've done some work utilising |
|
Uh oh: |
|
Unrelated A minor suggestion would be to print a success or fail message as the very last line of output. Perhaps something like "SUCCESS - 25/25 tests passed", or "FAIL - 23/25 tests passed". |
|
Currently it will throw an error message of |
|
The non-zero error code upon failure is good as it will aid |
- `test/benchmark.js` measures performance - `test/jetstream.js` verifies correctness - configurable mangle/compress/output options
- `test/benchmark.js` measures performance - `test/jetstream.js` verifies correctness - configurable mangle/compress/output options closes mishoo#1479
@kzc #1477 (comment)
Uses
phantomjsto render JetStream, intercepts all.jsfiles andbin/uglifyjs -mcthem all. Probably an overkill and may be heading in the wrong direction, but at least I had fun. 😎