-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix negate_iife : false #2
Conversation
Defaults will scramble [IIFEs & program completion values](mishoo/UglifyJS#543), which affect the majority JS I feed into this tool.
If I understand correctly, the only use case for this is in bookmarklets, which doesn't seem like that big of a use case. Would resolving #3 alleviate the need to change this default? |
The larger issue is people breaking the code who don't know said code very well (eg myself minimizing 3rd party code). IMHO if people were minimizing their own code that they are working on, then they would use a build tool locally. |
Not really; I'll still need to verify if the flag is still flipped. I re-install browsers & OS alot (testing). |
If the problem is the possibility of breaking other's code in general, I might consider creating different modes, though. Perhaps one "normal" and one completely "safe". |
On jsDelivr, I likely have thousands of people using |
Is the complaint that it doesn't work in bookmarklets, or in which other situations can this be a problem? |
I don't use this as a bookmarklet; I visit directly https://skalman.github.io/UglifyJS-online/ & don't always remember to check the options tab/button. Other defaults are fine & don't seem destructive. |
I think you misunderstood what I was saying. |
Sorry, no, 70% of my use-case for UglifyJS-online is to minify other peoples' jQuery for [CDN hosting]. I haven't tested the actual output, but I don't have that time & I can see the IIFE is mangled. |
I don't want to merge this without understanding the benefit. Could you post or link to a script that somebody has complained about?
|
source: /*!
* jQuery JavaScript Library v2.1.1...
* Date: 2014-05-01T17:11Z
*/
(function( global, factory ) {
if ( typeof module === "object" && typeof module.exports === "object" ) {
module.exports = global.document ?
factory( global, true ) :
function( w ) {
if ( !w.document ) {
throw new Error( "jQuery requires a window with a document" );
}
return factory( w );
~~~snip~~~
jQuery.noConflict = function( deep ) {
if ( window.$ === jQuery ) {
window.$ = _$;
}
if ( deep && window.jQuery === jQuery ) {
window.jQuery = _jQuery;
}
return jQuery;
};
if ( typeof noGlobal === strundefined ) {
window.jQuery = window.$ = jQuery;
}
return jQuery;
})); After http://skalman.github.io/UglifyJS-online/ with !function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw Error("jQuery requires a...
~~~snip~~~
Z.noConflict=function(t){return e.$===Z&&(e.$=Wn),t&&e.jQuery===Z&&(e.jQuery=Rn),Z},typeof t===kt&&(e.jQuery=e.$=Z),Z}); Maybe it doesn't matter, but visually Do as you wish, I have nothing more to add to this matter. |
So do I understand correctly that the only problem is that it looks different, and that there is no functional change whatsoever? |
I don't know; I don't have time to test every JS I want minifed. |
Defaults will scramble IIFEs & program completion values, which affect the majority JS I feed into this tool. (eg any jQuery plugs)