Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

version that works with Google Closure Compiler #20

Closed
wants to merge 1 commit into from

2 participants

@fridek

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
Owner

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 29, 2012
  1. @fridek
Something went wrong with that request. Please try again.