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
375
questions
1
vote
1
answer
23
views
No results in Browser with "Getting Started with the Closure Library"
I am following the given steps to try,
"Getting Started with the Closure Library".
https://developers.google.com/closure/library/docs/gettingstarted
Step 1: Download and Setup the Closure ...
0
votes
1
answer
78
views
how to install google closure library with angular 10
I want to include the google closure library in my angular10 project. I'm installing using npm install google-closure-library but the following error given Could not find a declaration file for ...
0
votes
1
answer
78
views
Error in Google Closure Compiler - When accessing to the Google Closure Compiler Service API occurred error with HTTP status code 'MethodNotAllowed'
During minification of JS code, readed from the file '/Content/Assets/BasicMapWidget/basic-map-widget.js', by Closure Remote JS minifier error has occurred.
See more details:
When accessing to the ...
0
votes
0
answers
41
views
How to use custom Blockly modules with Parcel?
I need to use custom Blockly modules with Parcel.
I started to fork the blockly-samples repository, then cd blockly-samples/examples/blockly-parcel, and npm install;
npm start -> Parcel builds ...
0
votes
1
answer
162
views
Google closure - goog.require could not find goog.structs.PriorityQueue
I'm trying to use the PriorityQueue functionality provided by Google Closure, but I can't seem to be able to figure out how to do it without using the Closure Compiler. Since I'm not using any custom ...
3
votes
0
answers
270
views
require('google-closure-library') in create-react-app causes Uncaught SyntaxError: Identifier 'module' has already been declared
This can be reproduced by 3 simple steps.
Create a new Create React App: npx create-react-app myApp
Install Google Closure Library: npm install google-closure-library
Import closure library into ...
2
votes
1
answer
1k
views
How could I effectively convert google-closure javascript to modern ES6?
I have a code base that uses the google-closure style modules goog.provide and classes, etc.
I want to modernize this code base but it's roughly 15k lines of code and I was hoping a tool could help me....
0
votes
1
answer
69
views
Can I compile SJCL library with Google closure compiler?
I have a vanilla javascript project that is compiled and minified using Closure Compiler v20181210. I want to use SJCL in that project for crypto.
I copied this file into my own project and wrote ...
5
votes
2
answers
6k
views
Which function does this jsaction call?
I'm trying to figure the path google drive takes to load it's folder content, from when a folder name is double clicked till the point where that folders contents are loaded.
I've noticed that ...
0
votes
0
answers
42
views
How to closure compile but still provide interface API to uncompiled 'extensions'
I would like to compile an 'sdk' that is providing an API.
How could a compiled file provide an 'interface' that uncompiled extensions could use to plug into to compiled SDK?
Example:
API clients ...
1
vote
1
answer
58
views
goog.cryp.Hmac cannot reproduce result from crypt from node js
I am trying to reproduce HMAC signature described here.
The example is using crypt from nodejs, however, in my case, I need to use the google closure library. So I tried to reproduce the HMAC ...
0
votes
1
answer
75
views
Javascript Dot-Syntax function disappears in listen callback
I'm trying to update Annotorious (https://annotorious.github.io/#) to the latest version of Closure / Javascript.
When I compile it with "SIMPLE" optimizations, dot-syntax functions seem to ...
2
votes
0
answers
127
views
How to provide multiple dependencies in --chunk for closure compiler?
I have this requirement where i have test.js file dependent on x and y modules. So i was trying something like,
The below code generates x and y successfully but breaks on producing the test module.
...
1
vote
2
answers
64
views
Does plovr support the latest closure library?
I was using plovr as closure compiler for the latest google closure library, but it think it plays nicely. Why is this so?
Link=http://plovr.com/docs.html
Thanks in advance for the help,
Kiran
2
votes
0
answers
356
views
Google Closure - Import Legacy Class in ES6 Module Class
I have a code base written using ES5, and I want to update just part of the code to ES6 using Modules.
This is the code I have:
goog.module('farm.animal.Cow');
// Legacy class using es5
var Animal = ...
4
votes
1
answer
202
views
How to fix encryption of sha256 hmac on google closure library?
Multiple Hmac encrypters ouput a different result of google closure library.
I've tried multiple Hmac encrypters and they output the same result. However, when using google closure library, both in ...
1
vote
1
answer
242
views
Click event in event listener written in Google Closure not working?
I am new to JavaScript, My question is when I try this JS in chrome browser console it works, But in my JS file it's not working
I attached the code, For HTML design I used google MDL, For JS I used ...
0
votes
1
answer
2k
views
Angular 6 include google closure library
I want to include google closure library into my angular 6 application. I have applied
npm install google-closure-compiler and npm install google-closure-library.
The app can be compiled and ...
1
vote
1
answer
540
views
How to prevent Closure Compiler from renaming any property or method of a specific object?
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 ...
0
votes
1
answer
137
views
Google closure get value from DOM element
I'm using Google closure on top of ClojureScript, what is the way to get a value from a "select" in a html element?
I'm trying :
(.value (gdom/getElement "select-combo"))
but I'm getting:
...
0
votes
1
answer
60
views
Recursive Call with goog.dom.animationFrame
I am trying to use google closure animationFrame feature.
I would like to create an animation task with it and to call that created task recursively.
I defined a def named animationTask.
When I try ...
4
votes
1
answer
662
views
How is lastIndexOf() better than indexOf() in this case? [duplicate]
Here's Google's implementation of String.startsWith() taken from Closure Library:
goog.string.startsWith = function(str, prefix) {
return str.lastIndexOf(prefix, 0) == 0;
};
I was wondering why ...
4
votes
0
answers
307
views
Accessing google-closure-library methods goog.require and goog.provide
I need to use google-closure-library so I installed this package via npm and put piece of code below (from here) in my webpack (version 3.6.0) config file:
module: {
rules: [
{
...
0
votes
0
answers
110
views
Wrap google-closure-library variables for angular project
So, following on from this question
I now have my module both in bower and npm, I can import it fine to my project and declare it in app.module, even attempt to use it in my controller:
index.html:
...
1
vote
1
answer
172
views
how can I use goog.provide and @externs at the same time?
I'm trying to simplify our code a bit by addressing minification issues that tend to make us use something like oVar["stuff"]["things"] rather than oVar.stuff.things
I'm running into an issue using ...
2
votes
1
answer
643
views
Google Blockly `namespace never provided` Error with closure-compiler.jar
I asked at this issue, but I still can't solve a problem. I get error like required "Blockly" namespace never provided .
I follow Google bLockly Advanced Compilation tutorial to try. I did not create ...
3
votes
1
answer
977
views
Google Closure suppress warning messages for a particular file
I am using google closure compiler to compress all the javascript into single file.
While compliance it give lot of warning messages.In my case I have already compressed third party JS files, Which ...
1
vote
1
answer
80
views
Canceling JavaScript promises
I am using Google JS closure library
https://developers.google.com/closure/library/
I have the following code:
if (endDate >= wap.com.ifx.util.IfxComponentUtil.yyyymmdd(currentDate) && ...
0
votes
0
answers
41
views
css property display works with setTimeout otherwise not
PROBLEM SETTING
I am working on a project which contain a lot of JavaScript files. The library i am using is Google closure library. I am calling a function, let say "save()" from a file (let say "a....
2
votes
2
answers
1k
views
Any JavaScript code coverage tools for client-server apps in Google Closure?
I'm trying to get code coverage for unit tests in a Google Closure client-server project. We have code coverage for the server side, and need client side coverage.
JSCover runs its own server. Our ...
1
vote
2
answers
891
views
How to export symbols from modules compiled by Closure Compiler?
I have many js es6 modules compiled by Closure Compiler (Advanced level) in a single library file.
I failed to export some symbols using /** @export */ or using goog.exportSymbol('whatever', whatever)...
0
votes
0
answers
714
views
required namespace never provided -- ES6 Modules and Closure
I am trying to use ES6 modules while compiling my code using Closure. While it is discouraged, it seems supported.
I have tried to reduce an example to the minimum and this is my current situation.
...
0
votes
1
answer
53
views
Using event at google closure template
I have some problems about google closure template. I'm doing a navigator of websites, which a little kind of complex and with multiple events; now i am using template to create navigator DOM ...
3
votes
2
answers
775
views
google closure library sanitizer.sanitize removes my id on dom elements
I am dynamically updating tabs with content using goog.dom.safeHtmlToNode
since the newer release of the google closure library removed the dom fragment method: goog.dom.htmlToDocumentFragment(...
2
votes
2
answers
433
views
Accessing `goog.require`d object in closure library without compilation
I'm experimenting with the google closure library, and am working through the
official XhrIo guide.
I ran into some trouble with the xhr-quick2.js example, reproduced below:
goog.require('goog.net....
2
votes
1
answer
437
views
How to correctly wrap Google Closure UI Component as Rum Component
I would like to use Google Closure UI components from ClojureScript with the Rum/React library.
I started with goog.ui.DatePicker, but still cannot wrap it correctly. The code underneath renders the ...
2
votes
2
answers
851
views
Prevent default addition of deps.js
I am trying to use google closure library for my web app's javascript. I have my JS script in static directory along with closure library:
static/
app.js
closure-library
JS code is combined into ...
5
votes
1
answer
342
views
Closure compiler dependency calculation much slower than closurebuilder.py
Previously, I have been using the following build script in order to compile a Closure project:
# BUILD SCRIPT 1:
closure-library/closure/bin/build/closurebuilder.py \
--root=closure-library/ \
...
0
votes
1
answer
111
views
Google Closure equivalent of jQuery's ".on()"
I'm working with a project in Google Closure, and I'd like to attach event listeners to query selectors so that they apply likewise to dynamically added elements. If I were using jQuery, I might do ...
1
vote
0
answers
48
views
Can I customize toolbar default action in Closure JS?
I want to customise toolbar action in closure js.
I want to give class-name to font-color palette.
I came up with creating a custom toolbar button from scratch.
But it takes so long.
So, If I can ...
1
vote
1
answer
87
views
Can 'goog.nullFunction' fit a specific function signature?
When some experiment flag is on, I register an injection as :
'abcFactory': name.space.createSomeModel
and inject the factory as below:
/**
* @param {!function(!Object): !some.DataType} abcFactory
...
1
vote
1
answer
564
views
Is there an equivalent of parseInt() in Google Closure?
I want to use every good thing that is provided in Google Closure Library. Some of them are not that convenient. For example the goog.date.Date is not well compatible to JavaScript's natural Date().
...
0
votes
2
answers
193
views
Google Closure XhrIo PROGRESS EventType
I registered a EventType.PROGRESS listener along with a EventType.COMPLETElistener to a XhrIo object. I call the XhrIo.send method post some form data. The COMPLETE listener fires as expected. But the ...
0
votes
1
answer
57
views
Google Compiler not assigning empty arrays to variables?
So I am pretty new to using Google Compiler and am running into a few issues. The first is that in my preprocessed code I am setting an empty array to a variable which will be populated later on, but ...
0
votes
1
answer
95
views
Content Security Policy with google closure
I am trying to enable CSP for my web application. My policy is something like:
"default-src 'self' gap: cdvfile:;"
I am using google closure for javascript. However without javascript ...
2
votes
1
answer
197
views
What does @code mean in Google Closure?
An example is here:
* An implementation of {@code goog.events.Listenable} with full W3C
* EventTarget-like support (capture/bubble mechanism,
https://developer.pubref.org/static/apidoc/global/...
1
vote
1
answer
333
views
How to select dropdown (append option) in google closure?
I have question about Google Closure.
I'm using lib :
goog.base.js
goog.dom.js
goog.events.Event
goog.events.EventTarget
goog.ui.MenuItem
goog.ui.Select
I want append option in my dropdown on ...
0
votes
0
answers
103
views
JavaScript doesn't throw error
I am confused about JS behavior, actualy develop large app in CoffeScript, Este-library, Google-closure and React. For sure I can share more info or code, if no idea comes.
This "non-throwing" ...
1
vote
1
answer
454
views
google closure compiler - not inlining goog lib function calls?
I wrote a JavaScrip application a few years back using the closure framework and compiler. It uses goog.require, goog.provides and goog.inherits a lot, and was working fine using the old python script ...
4
votes
1
answer
310
views
How to use emscripten in conjunction with the closure tools
For optimal performance I'd like to use emscripten in conjunction with the closure tools but poorly I can't call the function I've defined in JavaScript from emscripten.
Note that I extracted a ...