Skip to content Skip to sidebar Skip to footer

Google Closure And Generated Getters/setters

I'm trying to get KineticJS to work with Google Closure Compiler. KineticJS, however, generated it's getters & setters based on the name of the variables. Something like this:

Solution 1:

Which answer is best depends on which compilation mode you are using and how you are the library.

If you are using ADVANCED mode and compiling the library with your other sources, rewriting is likely best (I assume this is what you are trying to do currently). However, if you are loading the library separately or concatenating the library source to your ADVANCED compiled source, extern definitions are a good option (this is a good approach if library maintainers don't support Closure Compiler ADVANCED compilation).

There are various tools that people have created to help auto-generate externs for libraries but it usually best if someone creates the externs and maintains them with the library. Some library externs are hosted in the Closure Compiler source repository and maintained by the community so that is always an option.


Post a Comment for "Google Closure And Generated Getters/setters"