google-closure-compiler

google closure compile jQuery Plugin

喜你入骨 提交于 2019-12-03 09:32:30
I'm testing google closure-compiler and wanting to compile facebox Plugin with the option "Advanced" , an error occurs the function trying to find "a.H". Has anyone tried to compile with this option jQuery plugins with a good result. Thank you. EDIT: Clearly this re-naming the jQuery methods, but is it possible to include jQuery and re-name all methods equally?. EDIT example of code with the option "externs_url": with closure-compiler js input code // ==ClosureCompiler== // @output_file_name default.js // @formatting pretty_print // @compilation_level ADVANCED_OPTIMIZATIONS // @warning_level

Is it possible to make Google Closure compiler *not* inline certain functions?

蓝咒 提交于 2019-12-03 07:50:07
Closure compiler is inlining a function, but the code size is smaller if that function is not inlined (I only care about code size - this is for JS1k ). Can I tell the compiler that I don't want that function inlined? Edit: Just to explain a bit better, here's my function: function lineTo(x,y) { a.lineTo(x,y); } where a in the canvas context. Because there are so many a.lineTo s in the code, having this function used is worth it. Like this, my code is 1019 bytes (and all the lineTo s are replaced by a.lineTo ). If I change the function to: function lineTo(x,y) { a.lineTo(x,y); console.log(); }

google closure compiler and json

半腔热情 提交于 2019-12-03 06:55:46
I have a json string that I parse and then access the properties of the object with the dot notation. However, in the google closure compiler, the dot notation ( MyObject.PropertyName ) gives warning that the property isn't defined. For now, the solution I'm using is to convert my code into bracket notation ( MyObject['PropertyName'] ). This removes the warning but also prevents the compiler from doing its job. On the other hand, when I write JSON.stringify(MyObject) , the server receives a string with property names that are understandable. So my question is how do we best use the google

How can I set the language_in option for the Closure compiler?

廉价感情. 提交于 2019-12-03 05:49:26
I need to set the language_in option on the Closure compiler to prevent the IE8 parse error: ERROR - Parse error. IE8 (and below) will parse trailing commas in array and object literals incorrectly. If you are targeting newer versions of JS, set the appropriate language_in option. I did find a post in the closure group relating to this, however, the option is set directly on the java compiler, rather than through one of the build scripts. I need to be able to set it on a build script. I'm looking at the scripts in closure/bin/build/ and there are several there. I tried adding the option to

Integrate Google closure compiler with Eclipse IDE?

岁酱吖の 提交于 2019-12-03 04:24:43
问题 Does anybody know how to integrate Google closure compiler with Eclipse IDE? The thing I was trying to do is to configure Google closure compiler as a external tool for Eclipse IDE. Then I would be able to run closure compiler within IDE and minify my Javascript files with single click. Have anybody solved this problem yet? 回答1: Rock Star Apps provide a little-known plugin which does this. I just wrote a blog article on it: [removed as doesn't exist anymore]. After some googling, I also found

google closure compiler and jquery

一曲冷凌霜 提交于 2019-12-03 02:37:21
I copy-pasted my js code into the google compiler and when I copied it back into my application it didn't work. I realized that my code needs jquery so I copied the jquery code and my code into the google compiler, hoping it would easily solve the problem, but it doesn't work either. In chrome, the code bugs on the line $(document).K(function () { which is the document ready function. The error is Uncaught TypeError: Object [object Object] has no method 'K' What do I need to do to make it (tentatively) work? Thanks for your suggestions. Use @externs_url to "import" symbols in Google's Closure

How to use Google's Closure to compile JavaScript

…衆ロ難τιáo~ 提交于 2019-12-03 02:14:26
Google just released Closure , which is a compiler to minify JavaScript. On the product site, it says "The Closure Compiler has also been integrated with Page Speed". How do I use Page Speed to compile my web pages JavaScript with Closure? (Or, is there a web site that I can simply paste in my JavaScript to have closure minify it? For a single file it's simple java -jar $path_to_jar/compiler.jar --js input_file.js \ --js_output_file output_file.js For a multi-file project you can use calcdeps.py in combination with the compiler.jar #!/bin/sh$ $CALCDEPS_PATH=/path/to_calcdeps #directory

Should I use the YUI Compressor or the new Google Closure compiler to compress my JavaScript?

不问归期 提交于 2019-12-03 01:28:34
问题 YUI Compressor was the consensus best tool for minimizing, but Closure seems like it could be better. 回答1: "Whichever you find best for you" I think is the general answer at the moment - YUI has been available longer so undoubtedly will be the one which currently has the consensus as being the best tool. Whereas Closure is new to us - so there isn't the wealth of experience with Closure as there is with YUI. Hence I don't think you'd find a compelling real-world arguments of why to use

Integrate Google closure compiler with Eclipse IDE?

不打扰是莪最后的温柔 提交于 2019-12-02 18:43:06
Does anybody know how to integrate Google closure compiler with Eclipse IDE? The thing I was trying to do is to configure Google closure compiler as a external tool for Eclipse IDE. Then I would be able to run closure compiler within IDE and minify my Javascript files with single click. Have anybody solved this problem yet? Rock Star Apps provide a little-known plugin which does this. I just wrote a blog article on it: [removed as doesn't exist anymore]. After some googling, I also found this, but haven't tested it: https://github.com/greggian/Eclipse-Closure-Compiler . Update: the Rock Star

How to prevent Closure Compiler from renaming any property or method of a specific object?

只愿长相守 提交于 2019-12-02 18:07:54
问题 I am working with a huge 3rdparty library (Babylon JS) that will be served from its own CDN and cannot be included in my Closure Compiler run. The library contains one object and everything defined as parts of it. It has no externs file available so I started to write one but it is growing quickly. It would be easier to just tell Closure Compiler to not mangle any properties I am setting, including the ones I am setting on objects created by constructors on the object. EDIT: Added the name of