3 ms·
You could build a custom jQuery copy that eliminated whatever methods you don't need. Since plugins use unknown parts of jQuery and Closure Compiler can't alway
by dmethvin 12y ago
You could build a custom jQuery copy that eliminated whatever methods you don't need. Since plugins use unknown parts of jQuery and Closure Compiler can't always detect that, you really need to do some manual labor to pull in what you need.
In the 1.8 time frame the jQuery devs made a call for people who wanted to use Closure Compiler's ADVANCED_OPTIMIZATIONS to participate, but just didn't get any community interest. CCAO style is not typical JavaScript and it doesn't seem that a lot of people use it.
- nostrademons 12y agoAt that point you're better off just writing the functionality you need from scratch - which was basically the coding standard when I joined Google Search in 2009. They've since moved to allow Closure, which was a big win for developer productivity, but OTOH the latency of the SRP has roughly quadrupled since I joined Google. Anyway, I'm firmly in the "you don't need JQuery" camp now, since most of its functionality is trivially implementable in one-liners since IE9+. I'm unlikely to go back; I've been using vanilla JS for prototypes for the last 2 years and am using it for my startup now, and have yet to encounter a case where I really miss JQuery. It was a very different world in 2006 when I learned it, or even in 2009 when I joined Google. Also, I suspect that the overlap of people that use Closure and those that use JQuery is near zero, hence why nobody in the JQuery community cared about CCAO. Both of them are highly non-typical Javascript, as is Angular. JS shows its Scheme heritage in that somehow every major framework results in completely different, mutually-incomprehensible code.
- swannodette 12y agoNot sure why you got downvoted. Thanks for the perspective on usage of Closure at Google.