Questions tagged [google-closure-library]

Closure Library is a JavaScript framework used by Google and one of three components to Closure Tools, an open source toolset to aid with developing front-end web applications

Important links:

374 questions
3
votes
1 answer

How to use Google Closure compiler

I'm trying to migrate from the closurebuilder.py script to the Closure compiler because of this message: ../../closure-library/closure/bin/build/closurebuilder.py: Closure Compiler now natively understands and orders Closure dependencies and is…
3
votes
3 answers

How to solve the Google Closure namespace hell?

My new job is to write component-oriented JavaScript with Google Closure library. I adore events, components, services and modules. But the work is super-harsh because of the need to write code cluttered with namespaces. Following code is…
Light-wharf
  • 147
  • 1
  • 7
3
votes
2 answers

Google Closure Builder - prevent base.js insertion

When I build my js project with the Google Closure Builder (SIMPLE_OPTIMIZATIONS), closure include the base.js file in the compiled js file. I dont use the closure-lib. Only goog.provide and goog.require. Is there any way to prevent this insertion?
3
votes
3 answers

ClosureCompiler: create_name_map_files from Java API

from command-line i can get a alias list of the function renaming from compiler.jar Help says: java -jar compiler.jar --help [...] --create_name_map_files : If true, variable renaming and …
3
votes
2 answers

How to do localization in Google Closure

Currently I am using just plain text in my Closure application. I want to add localizations to those text. I just found several articles about goog.getMsg function which is used to do this kind of localization. As far as I understood it is done in…
3
votes
0 answers

Google closure depswriter.py --root_with_prefix, what is prefix and root for?

I went through sample in https://developers.google.com/closure/library/docs/depswriter and many readins on another related question in depswriter.py complains 'The command line is too long' After housr of googling, and meddling with sample code from…
3
votes
3 answers

Typecasting in Javascript / google closure library

I am passing a complex object consisting of goog.structs.Set from my content script to background page through chrome.extension.SendMessage API. On the other side, this goog.structs.Set is received as an Object. How can I typecast it back to…
vivek.m
  • 3,213
  • 5
  • 33
  • 48
3
votes
1 answer

Using google closure library inside chrome extension content script

I am trying to use google closure library inside content script of chrome extension. This is how content_scripts look like in manifest.json "content_scripts": [ { "matches": [""], "js": [ …
vivek.m
  • 3,213
  • 5
  • 33
  • 48
3
votes
2 answers

goog.dom.query TypeError in ClojureScript

I'm trying to use goog.dom.query from ClojureScript. (:require [goog.dom.query :as q]) … (q/query ".foo.bar") produces the following error in the JS console at runtime: Uncaught TypeError: Object function…
Matthew H
  • 5,831
  • 8
  • 47
  • 82
3
votes
1 answer

Loading files through goog.require in a script block fails

When using goog.require inside a Gives: goog.dom is undefined What's wrong with this usage?
Kai
  • 5,260
  • 5
  • 29
  • 36
3
votes
1 answer

WIKI: How to use Lime (how to use closure-compiler with 3rd party (closure) libraries)

The following post inspired me to have a look at limeJS, as a side project I'm working on and off an a Yatzee game (mostly off) and thought that might be a nice library to use. As a beginner in google-closure I had some difficulties running…
3
votes
2 answers

Google Closure Library: What's the "correct" way to parse a boolean?

One of the things I have learned in dealing with Google Closure is that the library has virtually everything I could possibly want in terms of raw data manipulation and management. What's up to me is to build the components on top of it. Today I was…
Technetium
  • 5,902
  • 2
  • 43
  • 54
3
votes
1 answer

jquery vs google closure ajax

I've been looking into the google closure library for ajax calls, and I've gone through an example that looks like: goog.events.listen(request, "complete", function(){ if (request.isSuccess()) { // do something cool } else { // display…
Jeff Storey
  • 56,312
  • 72
  • 233
  • 406
3
votes
1 answer

How to use goog.module to load modules dynamically

I want to use goog.module of google closure library to implement JS module lazy loading. I've been able to use the modules by typing goog.require(module_name). However, the script module will be loaded at the beginning in this way. So I'd like to…
Fei
  • 1,906
  • 20
  • 36
3
votes
3 answers

Any way to use goog.require in development with convention-over-configuration?

Is there any way I can use Google Closure goog.require to manage JS dependencies, without having to register each namespace explicitly in a dependencies.js file? I like the idea of the compiler for production, but for development, I'd like some kind…