Hi
in v2.7.0 supporting of ie8 was disabled by default. It's breaking change, don't you thing?
I tried to enable support of ie8 by adding screw_ie8: false in config, but it seems that I can change it only from cli.
The API works in 2.7.0 as it always has:
$ cat min.js
var screw_ie8 = false;
var src = "console.log({var:'\v'});";
console.log(require("uglify-js").minify(src, {
fromString: true,
compress: { screw_ie8: screw_ie8 },
mangle: { screw_ie8: screw_ie8 },
output: { screw_ie8: screw_ie8 },
}).code);
$ node min.js
console.log({"var":"\x0B"});
This issue can be closed.
Please be reminded that ie8 support will be dropped somewhere in the future anyway
I don't see a need to remove the screw_ie8 functionality already in place unless it places a burden on maintenance. Having said that, ie6/7/8 combined market share is in the single digit range and falling.
Enabling ie8 support in uglify produces incorrect code for modern ES5 compliant browsers for a number of try/catch scenarios: https://github.com/mishoo/UglifyJS2/issues/1204#issuecomment-232567004. Best to favor correct code generation for the 95% of browsers in use today by having screw_ie8: true as the default.
It appears that gulp-uglify and grunt-contrib-uglify each have pending pull requests to upgrade to [email protected].
rollup's package.json has "uglify-js": "^2.6.2" allowing it to use [email protected]
webpack has "uglify-js": "~2.6.0" meaning it will use [email protected]
There is some resistance on grunt-contrib-uglify on upgrading to 2.7.0 due to some relying on ie8 being not supported by default.
But meh, the pain isn't too big yet on my side despite the peak of response, and I also didn't hear very specific stories about users being affected by theses issues so far (although these issues might be rare and if it happens anyway, chances are pretty slim to be reported).
It's their prerogative to use any particular uglify version or settings. It would be to their advantage to use the latest uglify version to get the latest bug fixes.
https://github.com/gruntjs/grunt-contrib-uglify/blob/master/package.json
"name": "grunt-contrib-uglify",
"description": "Minify JavaScript files with UglifyJS",
"version": "2.0.0",
is using:
"uglify-js": "~2.7.0",
Why you broking API in minor versions?