Skip to content

Commit b07afa0

Browse files
mprobstIgorMinar
authored andcommitted
refactor(externs): move Closure Externs back to Closure code repository
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
1 parent c3b5e16 commit b07afa0

File tree

3 files changed

+23
-1992
lines changed

3 files changed

+23
-1992
lines changed

README.closure.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Using AngularJS with the Closure Compiler
2+
=========================================
3+
4+
The Closure Compiler project contains externs definitions for AngularJS
5+
JavaScript in its `contrib/externs` directory.
6+
7+
The definitions contain externs for use with the Closure compiler (aka
8+
JSCompiler). Passing these files to the --externs parameter of a compiler
9+
pass allows using type annotations for AngularJS objects. For example,
10+
Angular's $scope objects can be annotated as:
11+
```js
12+
/** @type {angular.Scope} */
13+
var scope = $scope;
14+
```
15+
16+
This allows JSCompiler to type check accesses to scope, give warnings about
17+
missing methods or incorrect arguments, and also prevents renaming of property
18+
accesses with advanced compilation.
19+
20+
The externs are incomplete and maintained on an as-needed basis, but strive to
21+
be correct. Externs for individual modules should be added in separate files.
22+
23+
See https://developers.google.com/closure/compiler/

closure/README.md

-17
This file was deleted.

0 commit comments

Comments
 (0)