Google Closure, a web code thing.
Google Closure, a web code thing.
I've been picking at its documentation. It's not like jQuery, where you load an entire .js file to use a few modules. It actually is python based and only sends you the exact "minimized" javascript the user needs for his/her instance. When you write the code you don't use basic html and javascript, but a goog.xxx.xxx() kind of syntax.
It's suppose to be compatible and better for making big web apps, which I want to start doing.
It's also different to jQuery in the way you install and use it. Instead of google hosting the entire, like with jQuery APIs, service on their servers you must install it on your own system (edit: on your own web server, that is). I'm still not sure why.
There are also no version numbers of Closure, unlike jQuery which is on 1.7(?). Meaning, they just add junk to it, but only release class names that pass a rigorous testing process.
Any one here use it? Anyone disagree with my summary above?
It's suppose to be compatible and better for making big web apps, which I want to start doing.
It's also different to jQuery in the way you install and use it. Instead of google hosting the entire, like with jQuery APIs, service on their servers you must install it on your own system (edit: on your own web server, that is). I'm still not sure why.
There are also no version numbers of Closure, unlike jQuery which is on 1.7(?). Meaning, they just add junk to it, but only release class names that pass a rigorous testing process.
Any one here use it? Anyone disagree with my summary above?
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
- Krom
- DBB Database Master
- Posts: 16139
- Joined: Sun Nov 29, 1998 3:01 am
- Location: Camping the energy center. BTW, did you know you can have up to 100 characters in this location box?
- Contact:
Re: Google Closure, a web code thing.
I'd say up front that most technically oriented people aren't going to install some piece of software on their PC just to make one website work in their browser. Flash and Java leave a bad enough taste already, more plugins is not a good thing.
Re: Google Closure, a web code thing.
I use the Closure compiler somewhat regularly. I thought that the compiler *was* the Closure project, but apparently there's a lot more to it than that.
Re: Google Closure, a web code thing.
It's installed on the server side, like all Python web stuff.Krom wrote:I'd say up front that most technically oriented people aren't going to install some piece of software on their PC just to make one website work in their browser. Flash and Java leave a bad enough taste already, more plugins is not a good thing.
@jeff, you use it just to clean up your js files? edit: you mean you use this ( http://closure-compiler.appspot.com/home )regularly, or something else? I thought it was a pretty cool web app.
edit:
Here's what I've been looking at.
https://developers.google.com/closure/l ... s/tutorial
Code: Select all
goog.provide('tutorial.notepad');
goog.provide('tutorial.notepad.Note');
goog.require('goog.dom');
goog.require('goog.ui.Zippy');
/**
* Iterates over a list of note data objects, creates a Note instance
* for each one, and tells the instance to build its DOM structure.
*/
tutorial.notepad.makeNotes = function(data, noteContainer) {
var notes = [];
for (var i = 0; i < data.length; i++) {
var note =
new tutorial.notepad.Note(data[i].title, data[i].content, noteContainer);
notes.push(note);
note.makeNoteDom();
}
return notes;
};
/**
* Manages the data and interface for a single note.
*/
tutorial.notepad.Note = function(title, content, noteContainer) {
this.title = title;
this.content = content;
this.parent = noteContainer;
};
/**
* Creates the DOM structure for the note and adds it to the document.
*/
tutorial.notepad.Note.prototype.makeNoteDom = function() {
// Create DOM structure to represent the note.
this.headerElement = goog.dom.createDom('div',
{'style': 'background-color:#EEE'}, this.title);
this.contentElement = goog.dom.createDom('div', null, this.content);
var newNote = goog.dom.createDom('div', null,
this.headerElement, this.contentElement);
// Add the note's DOM structure to the document.
goog.dom.appendChild(this.parent, newNote);
return new goog.ui.Zippy(this.headerElement, this.contentElement);
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
Re: Google Closure, a web code thing.
I'd assume that that's a Web frontend for what I use:
http://closure-compiler.googlecode.com/ ... latest.zip
Used like so:
Or for my purposes, I usually automate it as a Makefile rule:
http://closure-compiler.googlecode.com/ ... latest.zip
Used like so:
Code: Select all
java -jar compiler.jar < input.js > output.js
Code: Select all
all: build/list.js build/of.js build/javascript.js build/files.js
build/%.js: %.js
java -jar compiler.jar < $< > $@
clean:
rm -f build/*.js
Re: Google Closure, a web code thing.
I've seen people use that too. Someone was asking about using it with out having to set up a whole project, which I assume means installing it into your apache server.
Jeff, you don't use any of their fancy goog libraries?
Jeff, you don't use any of their fancy goog libraries?
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
Re: Google Closure, a web code thing.
The compiler is just a standalone tool, so no reason for why your server should need to use it, unless you want to do something questionable like automatically optimize dynamically generated javascript.
I don't know anything about this library though. I guess I've never had any reason to look beyond jquery. If you find anything cool about it, let us know.
I don't know anything about this library though. I guess I've never had any reason to look beyond jquery. If you find anything cool about it, let us know.
Re: Google Closure, a web code thing.
I might go further into it. However dudes like this offer stuff that makes more sense to me: http://raphaeljs.com/
Check out his demo on a diagram: http://raphaeljs.com/graffle.html
apparently this stuff even work in IE6. I'll have to try it later.
This Raphael guy turns javascript into something that looks like pygame, to me:
That makes a circle! I tried it. It works.
It defines a space and then imports a class then applies an attribute. Very similar to what I've seen in pygame or wxpython. It's not as noob friendly as jQuery is, so it's tough on me. Google's Closure, in contrast, is noob proof. I have yet to install anything of theirs...
Check out his demo on a diagram: http://raphaeljs.com/graffle.html
apparently this stuff even work in IE6. I'll have to try it later.
This Raphael guy turns javascript into something that looks like pygame, to me:
Code: Select all
var paper = Raphael(10, 50, 320, 200);
var circle = paper.circle(50, 40, 10);
circle.attr("fill", "#f00");
circle.attr("stroke", "#fff");
It defines a space and then imports a class then applies an attribute. Very similar to what I've seen in pygame or wxpython. It's not as noob friendly as jQuery is, so it's tough on me. Google's Closure, in contrast, is noob proof. I have yet to install anything of theirs...
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
- Krom
- DBB Database Master
- Posts: 16139
- Joined: Sun Nov 29, 1998 3:01 am
- Location: Camping the energy center. BTW, did you know you can have up to 100 characters in this location box?
- Contact:
Re: Google Closure, a web code thing.
Ah ok, the way you wrote your post it sounded like it had to be installed on the client.Isaac wrote:It's installed on the server side, like all Python web stuff.Krom wrote:I'd say up front that most technically oriented people aren't going to install some piece of software on their PC just to make one website work in their browser. Flash and Java leave a bad enough taste already, more plugins is not a good thing.
Re: Google Closure, a web code thing.
Update on this. That raphael js has a creator, Dmitry Baranovskiy, that is bad mouthing google's Closure Library:Isaac wrote:I might go further into it. However dudes like this offer stuff that makes more sense to me: http://raphaeljs.com/
Check out his demo on a diagram: http://raphaeljs.com/graffle.html
""" “Just what the world needs—another sucky JavaScript library,” he said. When I asked him what made it ‘sucky’, he elaborated. “It’s a JavaScript library written by Java developers who clearly don’t get JavaScript.” """ Source: http://www.sitepoint.com/google-closure ... avascript/
Maybe he's saying this because he feels like his library is competing with Closure? Or maybe he's right. Maybe the Closure library, not to be confused with the Closure Compiler, is crap.
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
Re: Google Closure, a web code thing.
In the article, he does plug jquery, so I don't think he minds plugging other libraries per se.
Re: Google Closure, a web code thing.
I'm just going to write my own javascript library and learn javascript on the way.
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉