Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

version that works with Google Closure Compiler #20

wants to merge 1 commit into


None yet
2 participants

fridek commented Mar 29, 2012

Closure Compiler in advanced mode needs a special syntax for global objects and goog.provide/require annotations. As far as I could test it, the submitted version works nicely.


toji commented Mar 29, 2012

That's very interesting! Thank you for taking the time to figure this out!

Looking at the code, I'm curious if there's a way to allow the code to nicely work with both the goog.provide syntax and the CommonJS compatible version. I'd love to bundle it all into a single file if possible so that neither version falls behind the other. I'll look into that briefly, but if I can't find a good common ground I'll at least pull your variant in.

Thanks again!

fridek commented Mar 29, 2012

The usual way is to provide an extern file that specifies all the variable names that shouldn't be renamed. Example for jQuery: http://code.google.com/p/closure-compiler/source/browse/trunk/contrib/externs/jquery-1.7.js
However, it has a negative impact on compilation, the best option is to compile all files using the compiler (and gl-matrix has a perfect JSDoc for that, well done!). Could you test if my version works with CommonJS (after removing goog.provide)? If it does, I could add a few lines to detect if complier is used and drop goog.provide if not.

@toji toji closed this Jan 2, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment