Downgrade uglify-js from 3.1.8 to 3.1.1

Summary:
Uglify@3.1.7 is causing some perf issues (more specifically, this commit: 5b4b07e9a7) that are impacting TTI on RN views and increased memory usage.

More specifically, code like:

```
function nonTrivialFn(pre) {
  return pre + Math.random();
}
function hotFunctionCalledALotOfTimes(num) {
  return nonTrivialFn(num + Math.random());
}
hotFunctionCalledALotOfTimes(3);
hotFunctionCalledALotOfTimes(5);
```

in v3.1.7 gets converted to:

```
function hotFunctionCalledALotOfTimes(num){
  return function(pre) {
    return pre + Math.random();
  }(num + Math.random())
}
hotFunctionCalledALotOfTimes(3);
hotFunctionCalledALotOfTimes(5);
```

This causes a function creation each time `hotFunctionCalledALotOfTimes` is called.

By comparison, in v3.1.6, that previous code was converted to:

```
function nonTrivialFn(pre){
  return pre + Math.random()
}
function hotFunctionCalledALotOfTimes(num){
  return nonTrivialFn(num + Math.random())
}
hotFunctionCalledALotOfTimes(3);
hotFunctionCalledALotOfTimes(5);
```

Reviewed By: jeanlauliac, alexeylang

Differential Revision: D6296740

fbshipit-source-id: b3988d886e607103ec3ae6b9763b2f0411a8aa3c
This commit is contained in:
Rafael Oleza 2017-11-10 04:40:43 -08:00 committed by Facebook Github Bot
parent e08b34239e
commit 1dec296000
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@
"source-map": "^0.5.6", "source-map": "^0.5.6",
"temp": "0.8.3", "temp": "0.8.3",
"throat": "^4.1.0", "throat": "^4.1.0",
"uglify-es": "^3.1.8", "uglify-es": "^3.1.0",
"wordwrap": "^1.0.0", "wordwrap": "^1.0.0",
"write-file-atomic": "^1.2.0", "write-file-atomic": "^1.2.0",
"xpipe": "^1.0.5" "xpipe": "^1.0.5"