Online minification mangling code

Posted on
  • Has anyone else noticed that if online minification is used, things get trashed? It seems like > and => characters get inserted inappropriately.

    This happens with the keypad module, for example.

  • Hey DrAzzy,

    Yep, I noticed the same thing a few days ago. I'm now using offline minification instead.

    Jon

  • Oh, great. Thanks for letting me know.

    Just so others know... If you choose Closure (online) - Simple Optimisations for the normal Minification settings,

    setTimeout(function(e) {
      console.log("Hello World");
    }, 100);
    

    Gets converted to:

    setTimeout((a)=>{console.log("Hello World")},100);
    

    Which is an Ecmascript 6 feature to allow you to write even more incomprehensible JavaScript code.

    I'd turned on ES6 support in the Web IDE's compiler so that we could properly minify binary literals, but it looks like they've added some ways to cut down the number of characters even further now by using some other bits of ES6. I'll see what I can do to fix it.

  • Ok, I've just updated it on GitHub, but the changes won't take effect until I next update the Web IDE.

    Thanks for the heads up.

  • Is online minification the default setting? If it is, I think you need to fast track getting this fix out there.

  • Minification is off by default for code in the Web IDE's editor pane. It's the default for modules, but about the only time that'll ever have any effect is when someone does require("http://..../X.js") - which I think is quite rare.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Online minification mangling code

Posted by Avatar for DrAzzy @DrAzzy

Actions