6 ms·
UglifyJS 3 Released
- scotth 9y agoWhat was improved with this release?
- deleted 9y ago[deleted]
- mjpuser 9y agoHere are the commits. Looks like the biggest backwards compatibility issue comes from the "Drop Angular" commit. He also changed the screw_ie8 option to be called ie8 now. A few bug fixes, too, but I'm definitely paraphrasing here. https://github.com/mishoo/UglifyJS2/compare/v2.8.23...v3.0.0 https://github.com/mishoo/UglifyJS2/compare/v2.8.23...v3.0.0
- davnicwil 9y ago> He also changed the screw_ie8 option to be called ie8 That's a shame, I always enjoy that silly bit of humour every time I scan my uglify configs! I totally get why it's safer to not do that sort of thing, nonetheless it does have a certain charm when done sparingly. I wonder if the change was in response to some specific feedback / complaints?
- carrotmirror 9y agoMaybe in Victorian times using the word 'screw' would be considered offensive. The explanation is likely much more inoccuous. Using negative variable names is confusing and leads to programmer errors.
- gavinpc 9y agoUglify is a mature and widely-used package. I use it and I love it. It's been years since uglify2, and I was excited to see this. But... it appears that there are no release notes for version 3, apart from the three negative points at the top of the README: backwards incompatible, twice as slow on the latest Node, and still no ES6 (edit out of the box). No rationale for (or detail of) the breaking change is given. Really bizzare.
- pygy_ 9y agoGiven the (rude and unhelpful) reply from the team, I suppose it was a premature release. https://github.com/mishoo/UglifyJS2/issues/1875 https://github.com/mishoo/UglifyJS2/issues/1875
- Thorncorona 9y agoThe issue opener's phrasing was probably why the response was also rude.
- lucideer 9y agoWhile the issue opener is quite brisk and curt, they hardly goes as far as overt rudeness. The blank non-response is astoundingly rude and dismissive in contrast.
- carrotmirror 9y agoGive me a break. The project maintainer is volunteering his time to help the javascript community and is doing a fantastic job fixing dozens of bugs and adding new optimizations and features - often the same day as issues are opened. Rather than nag him, step up and review the commits yourself and make a pull request implementing a ChangeLog.
- lucideer 9y agoExactly. And asking the opener (or somebody in general) to do so would've been a reasonable and polite response. Unceremoniously closing the ticket on the other hand seems to me to indicate the maintainer really doesn't care.
- gcb0 9y agoit now mangles property names. but still to see if as good as the custom solution we have. it's something we did since early 2000 and save us a good 30% of size. but dangerous as hell.
- lamlam 9y agoUglifyJS2 also supports this with the --mangle-props option [1]. Is there something different about how this is done in UglifyJS3? [1] https://github.com/mishoo/UglifyJS2/blob/master/README.md#usage https://github.com/mishoo/UglifyJS2/blob/master/README.md#us...
- sotojuan 9y agoDefinitely not a confusing repository name :-)
- Touche 9y agoSadly it still only supports ES5.
- abritinthebay 9y agoES6 is supported behind a flag
- phpnode 9y agoNope, it's supported in the Harmony branch, which is still under development
- abritinthebay 9y agoHuh, thanks for the heads up. Could have sworn that was in there.
- abritinthebay 9y agoRealized I was thinking about Uglify-ES which _also_ came out. So.. there are options :D
- imcotton 9y agoI've switched to google-closure-compiler-js, which eats ES6 by default.
- paulddraper 9y agoIn my experience: slightly smaller js, and significantly slower.
- frik 9y agoClosure compiler understands your code, it is using Java based Rhino Javascript engine. And using "advanced mode" it is really good - just make sure you read the docu to understand advanced mode! edit: What you meant with "it barely understands your code" is probably: if you compress just one JS and they access third party libraries, you have to write some annotation OR import their object namespaces (the annotation style is a bit weird in JS world and looks like Java Doc comments, but you can completely avoid it as I mentioned; read the documentation) Closure Compiler compiles from JavaScript to better JavaScript. It parses your JavaScript, analyzes it, removes dead code and rewrites and minimizes what's left. It also checks syntax, variable references, and types, and warns about common JavaScript pitfalls. UglifyJS and co don't understand Javascript, they do regex/string replace operations which is faster, but you get bigger code output and less warranty as they don't understand JS.
- abritinthebay 9y agoIt barely understands your code. To get any real benefit out of it you have to write your JS using Googles special rules, idiosyncrasies, and idioms. Then you'll get a lot of use out of it.
- moomin 9y agoWhich is exactly the approach ClojureScript takes: it writes the annoying annotations for you.
- 9y ago
- kjsthree 9y agoYou can handle es6+ with the harmony flag but if you're already using Babel is there any reason to use Uglify over Babili? I believe Babili generates minified/mangled output directly from the Babel AST which would be way more performant during the dev cycle.
- Androider 9y agoBabili is interesting for sure, but it's at version 0.0.12, clearly marked as beta, requires a bleeding edge Babel, and is 4-6 times slower than Uglify and produces larger output bundle in every single benchmark case with popular libraries on the Babili page itself. So yes, there is clearly still plenty of reasons to use boring old Uglify.
- abritinthebay 9y agoBecause Babili rarely works on Production code (in my experience). I'm sure some people can get it to work but on anything vaguely complex it always errors out for me. It's alpha software for a reason.
- bmpafa 9y agoSimilar experience. Tried it once last week & it was exceptions all the way down. Dunno why Babili is attractive w/ battle-tested uglify still making big moves.
- abritinthebay 9y agoIf you start a project with it it probably works fine (in that you can fix as you go).
- syncopatience 9y agoIf the concern is Uglify slowing down the dev cycle, you could turn it off for development builds.
- angry-hacker 9y agoHow much does these uglifiers slow down the code for a the client? Especially if you're using a mobile or slow arm machine? I started to think about these things when u started using an arm based chromebook. Stupidly bloated js heavy sites started to stand out. Facebook is unusable, slightly better if you disable extensions.
- jsnk 9y ago>How much does these uglifiers slow down the code for a the client? I thought minification is good for the client. Smaller payload, easier for browser to parse the code because it doesn't have any unnecessary white space, comments and characters. Also not the best solution to security, but does obscure the code to make it harder for malicious client to read through the code.
- koolba 9y agoMinification makes code both faster to download (less total bytes) and faster to execute (less memory usage for symbols and dead code elimination).
- angry-hacker 9y agoWell, in most cases my test with minifiers is that output code performs worse than uncompressed code.
- Klathmon 9y agoWhat minifiers? Some do very much trade speed for size, but in my experience the opposite is overwhelmingly true.
- iso-8859-1 9y agoSupport for pure annotations was added. https://github.com/mishoo/UglifyJS2/commit/1e51586996ae4fdac68a8ea597c20ab170809c43 https://github.com/mishoo/UglifyJS2/commit/1e51586996ae4fdac... This will enable removing unused transpiled classes from e.g. Babel. See https://github.com/mishoo/UglifyJS2/issues/1261 https://github.com/mishoo/UglifyJS2/issues/1261
- DonHopkins 9y agoSyntactic Sugar Sculptures!
- tomByrer 9y agoThere is a separate branch for ES2015+ here: https://github.com/mishoo/UglifyJS2/tree/harmony https://github.com/mishoo/UglifyJS2/tree/harmony The new primary committer, alexlamsl, is good about responding to bugs & pushing out new versions fast: https://github.com/mishoo/UglifyJS2/issues?q=is%3Aissue+is%3Aopen+label%3Aharmony https://github.com/mishoo/UglifyJS2/issues?q=is%3Aissue+is%3... But there is still no CHANGELOG. He is aggressive at updating the docs, so you'll have to look at diffs yourself.