Skip to content

Commit

Permalink
refactor(externs): move Closure Externs back to Closure code repository
Browse files Browse the repository at this point in the history
While Closure Compiler generally recommends to maintain the externs for
projects together with their source, this has not worked well for
AngularJS:
- Changes to externs must be tested; they can break clients. AngularJS
  has no testing infrastructure for this.
- Changes mostly come from users inside of Google and are much more
  easily submitted together with the code using them within Google's
  repository.

This change deletes the externs here and adds a README.closure.md to
document the change. They will be added back to Closure Compiler in a
separate submit.

Closes angular#5906
  • Loading branch information
mprobst authored and IgorMinar committed Jan 22, 2014
1 parent c3b5e16 commit b07afa0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1,992 deletions.
23 changes: 23 additions & 0 deletions README.closure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Using AngularJS with the Closure Compiler
=========================================

The Closure Compiler project contains externs definitions for AngularJS
JavaScript in its `contrib/externs` directory.

The definitions contain externs for use with the Closure compiler (aka
JSCompiler). Passing these files to the --externs parameter of a compiler
pass allows using type annotations for AngularJS objects. For example,
Angular's $scope objects can be annotated as:
```js
/** @type {angular.Scope} */
var scope = $scope;
```

This allows JSCompiler to type check accesses to scope, give warnings about
missing methods or incorrect arguments, and also prevents renaming of property
accesses with advanced compilation.

The externs are incomplete and maintained on an as-needed basis, but strive to
be correct. Externs for individual modules should be added in separate files.

See https://developers.google.com/closure/compiler/
17 changes: 0 additions & 17 deletions closure/README.md

This file was deleted.

Loading

0 comments on commit b07afa0

Please sign in to comment.