Show HN: JSMin fork (allows Bootstrap's idiom)
github.comHey all,
Mr. Crockford has recently refused to fix JSMin (https://github.com/twitter/bootstrap/issues/3057).
Thus, I've fixed it. You can get the updated code from https://github.com/shawnpresser/JSMin/blob/master/jsmin.c
The fix was simple. It simply scans for "newline, optional whitespace, exclamation point" and replaces the newline with a semicolon.
I've given special attention to safety. This code works exactly as JSMin did, except it implements the aforementioned semicolon substitution, thus supporting the Javascript idiom:
a()
!b && c()
I hope this proves useful to someone (possibly the authors of Bootstrap). It was a fun project.I like the doing instead of all the talking. Kudos for this.
Well that discussion is pretty crazy and very polarized.
JSMin guy thinks fixing it is stupid, and the bootstrap guy says that since it works in browsers it should work in JSMin.
So they've reached an impasse. Unfortunately emotions and strong words were used right away which polarizes the conversation.
Being completely pragmatic about it, it seems that bootstrap should probably change, instead of JSMin. But I don't think either will so both sides lose, and potentially make their tools available to a smaller audience.
Please send a pull request to Crockford :)