-
-
Notifications
You must be signed in to change notification settings - Fork 179
Conversation
# Conflicts: # src/index.js
# Conflicts: # package.json
* Putting back try-catch (wrong asset handling) * Adding banner for comments after being sure comments are presents * Correcting filter extraction * Correcting error handling
@hulkish Honestly, I'm not so familiar with unit testing like this. I corrected the existing ones (only the configuration given to the plugin). I might need help on this, if anyone wants to lend a hand :) |
@Hartorn sure, you wanna give me access to your fork and ill add the test. |
@Hartorn Nvm, I see you've already included your updates to the tests: https://github.com/webpack-contrib/uglifyjs-webpack-plugin/pull/63/files This looks good to me, 👍 🌮 |
@hulkish @michael-ciniawsky Already invited you both to my fork, maybe it will be useful. I pushed the modifications to the package-lock, did not pay attention the repo was in npm 5. @hulkish I thought you were talking about adding new cases for uglify-es options. |
src/index.js
Outdated
warnings, | ||
parse: parse || {}, | ||
compress: compress || {}, | ||
/* eslint-disable no-undefined */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eslint-disable-next-line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to find a way to avoid the options nesting
@@ -33,6 +27,14 @@ describe('when applied with all options', () => { | |||
return `License information can be found in ${licenseFile}`; | |||
}, | |||
}, | |||
uglifyOptions: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible to keep the individual options in the top level e.g via filter()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I felt like they were too many options to keep them at top level. (https://github.com/mishoo/UglifyJS2/tree/harmony#minify-options-structure)
That way, I thought it was easier to understand what's coming from the plugin, or what's coming from UglifyJs, and so easier to read the docs according to the need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm.. I basically agree 😛, but uglifyOptions
is too verbose (but no better idea atm, just complaining :D). What's your opinion on removing warningFilters
&& extractComments
? 🙃 What is especially the usecase for warningFilters
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warningFilters
: I think it can be used by some people to filter for example on node_modules and still see warnings about their code, maybe to check dead code presence, or optimisation.
extractComment
: It is for copyright/license reason I think => that way, the file you load is still small, plus a preamble redirecting to another file containing all the copyrights/licenses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright
src/index.js
Outdated
parse: parse || {}, | ||
compress: compress || {}, | ||
// eslint-disable-next-line no-undefined | ||
mangle: mangle === undefined || mangle === null ? true : mangle, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mangle == null is idiomatic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@graingert I don't understand this. What you mean is that I should not test mangle === null
but only mangle === undefined ? true : mangle
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mangle === undefined || mangle === null
is the same as mangle == null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thks for the explanation.
What are the |
Smash it in
Smash it in
Smash it in
…On 5 Jul 2017 22:53, "Michael Ciniawsky" ***@***.***> wrote:
I did already and ask in slack aswell no response until now ¯_(ツ)_/¯
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#63 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAZQTLC2rF0mlzWXvWCOeMkx4_EPM9b-ks5sLAXAgaJpZM4OKAfG>
.
|
|
@jdalton @graingert ... |
For all involved, this is staying on a beta tag at minimum, until the test suite is reliable. I personally wouldn't have merged this yet given Tobias should have looked at it & we didn't answer the performance question though I do understand everyones desire to get this in master. |
The latest version of striptags is causing the build task to fail because it uses ES6, which is not supported by the version of Uglify that Webpack is using. As soon as [1] is published to a main release and Webpack updates to use that release, we should be able to upgrade striptags to the latest version. [1] webpack-contrib/uglifyjs-webpack-plugin#63
See webpack-contrib/uglifyjs-webpack-plugin#63 and https://github.com/mishoo/UglifyJS2/tree/harmony for more information about this. Fix angular#7532
See webpack-contrib/uglifyjs-webpack-plugin#63 and https://github.com/mishoo/UglifyJS2/tree/harmony for more information about this. Fix angular#7532
This hasn't been released yet, has it? edit: Apologies. Answered my own question. Yes, it has been released. |
@michael-ciniawsky @hulkish @graingert : Here is the new PR.
This PR is about moving to uglify-es (following of #55, due to messy chained rebase/push-force, etc...)
Here is a quick sum up of the modifications, please ask for precisions if needed.
minify(code, options)
, which go through all the steps of minification (parse, compress, mangle, output)so the try-catch is not needed (test if there is an error key in the return of the function)warn_function
so we can use that for the banner thing (License file, comments, ...)Basically, we do not need to use any other function than minify from uglify, it is mainly about giving proper options, handle the source maps and output.
I did not had time to update the docs, I will do in the next days.
TODO :
[ ] Update the documentation
[ ] Add new test for the new functionnalities