4 ms·
Good luck minifying/compressing your JavaScript files without using semicolons. There's nothing I hate more than finding a promising jQuery plugin and when I in
by flyosity 16y ago
Good luck minifying/compressing your JavaScript files without using semicolons. There's nothing I hate more than finding a promising jQuery plugin and when I integrate it into our JS minifying processes it blows up because they left semicolons off of a few lines, or the whole thing.
- jamesjyu 16y agoI want to second that. I've had to contact numerous js library authors to warn them about missing semicolons which break minimization.
- deleted 16y ago[deleted]
- jacobolus 16y agoWhich minifier blows up for you? Sounds like time for a bug report filed against the tool.
- roryokane 16y agoI’ve never personally minified JavaScript, with or without semicolons, but the article “Semicolons in JavaScript are optional” linked to in the page says the author minified jQuery without semicolons with Google Closure Compiler, and the test suite passed. Is that article wrong? Did minifying semicolons use to work, but they removed that feature for some reason? Does no one actually use Closure Compiler, and the other minifiers don’t support missing semicolons? Or is the reason the plugin you found “blows up” simply the error described in “Semicolons in JavaScript are optional” in the section “The only real pitfall when coding without semicolons”, which is starting a line with “(d + e)” instead of “;(d + e)”? That article says that if a minifier doesn’t understand JavaScript that an actual JavaScript interpreter can understand, the minifier is buggy. I agree with it – if your minifier messed up the semicolon-less jQuery plugin, and if none of the situations I mentioned above was the case, then your minifier needs fixing, or you should start using a different one.
- IsaacSchlueter 16y agoUnless you can name a minifier that actually breaks in this case, I'm gonna have to call BS on this.