Externs files for Backbone.js for use with Google Closure Compiler for the following versions:
- 0.9.10 (RC for 1.0)
Testing the externs
The quick and dirty approach that is currently taken to "testing" the externs (i.e. ensuring that all necessary Backbone methods are defined, that they specify the right parameters and return types, etc.) is to just grab the qunit test code from the Backbone library, specify some additional externs for qunit, underscore, jquery, and json, and run the tests through Closure Compiler with advanced optimizations on.
You can do this for yourself thus.
- install closure compiler
- make sure ruby is installed
cdto the directory for the externs version in question
This will spit out some errors, all of which should be false positives, related to some deliberately funky ways that the Backbone tests call Backbone and Underscore methods.
Licensed under the MIT licence.